From 9280616f561cc99f06ca5206a279d669be6d9655 Mon Sep 17 00:00:00 2001 From: juskora Date: Fri, 14 Mar 2025 12:10:16 +0100 Subject: [PATCH 1/5] Added basic test coverage for content tree --- features/standard/ContentTree.feature | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 features/standard/ContentTree.feature diff --git a/features/standard/ContentTree.feature b/features/standard/ContentTree.feature new file mode 100644 index 0000000000..60e4f6e70b --- /dev/null +++ b/features/standard/ContentTree.feature @@ -0,0 +1,25 @@ +@IbexaOSS @IbexaHeadless @IbexaCommerce @IbexaExperience @javascript @contenttree +Feature: Content tree basic operations + + Scenario: It is possible to display items on Content tree + Given I create "article" Content items + | title | short_title | parentPath | language | + | Article1 | art1 | root | eng-GB | + | Article2 | art2 | root | eng-GB | + | Article3 | art3 | root | eng-GB | + And I am logged as admin + And I'm on Content view Page for "root/art1" + + Scenario: New Content item can be created under chosen nested node + Given I am logged as admin + And I'm on Content view Page for "root/art1" + When I start creating a new content "Article" + And I set content fields + | label | value | + | Title | Arttest | + | Short title | arttest | + | Intro | TestArticleIntro | + And I perform the "Publish" action + And I should be on Content view Page for "root/art1/arttest" + + From 4327fa2214764ddfc6aff3a7e1d2c4bfb86b6581 Mon Sep 17 00:00:00 2001 From: juskora Date: Fri, 14 Mar 2025 12:18:19 +0100 Subject: [PATCH 2/5] Added dependencies.json --- dependencies.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 dependencies.json diff --git a/dependencies.json b/dependencies.json new file mode 100644 index 0000000000..9c8e43e182 --- /dev/null +++ b/dependencies.json @@ -0,0 +1,11 @@ +{ + "recipesEndpoint": "", + "packages": [ + { + "requirement": "dev-IBX-9519-behat-coverage-contentree as 4.6.x-dev", + "repositoryUrl": "https://github.com/ibexa/behat", + "package": "ibexa/behat", + "shouldBeAddedAsVCS": false + } + ] +} \ No newline at end of file From 5b50d2eafe0a8b24b2209a40041eaaa678742857 Mon Sep 17 00:00:00 2001 From: Justyna Koralewicz <79849375+juskora@users.noreply.github.com> Date: Fri, 14 Mar 2025 12:24:53 +0100 Subject: [PATCH 3/5] Update ContentTree.feature --- features/standard/ContentTree.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/standard/ContentTree.feature b/features/standard/ContentTree.feature index 60e4f6e70b..9cde76bbec 100644 --- a/features/standard/ContentTree.feature +++ b/features/standard/ContentTree.feature @@ -1,4 +1,4 @@ -@IbexaOSS @IbexaHeadless @IbexaCommerce @IbexaExperience @javascript @contenttree +@IbexaOSS @IbexaHeadless @IbexaCommerce @IbexaExperience @javascript Feature: Content tree basic operations Scenario: It is possible to display items on Content tree From 1a471f30704d301362ff08271566a92d0506546c Mon Sep 17 00:00:00 2001 From: juskora Date: Fri, 14 Mar 2025 13:17:42 +0100 Subject: [PATCH 4/5] Removed dependencies.json --- dependencies.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 dependencies.json diff --git a/dependencies.json b/dependencies.json deleted file mode 100644 index 9c8e43e182..0000000000 --- a/dependencies.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "recipesEndpoint": "", - "packages": [ - { - "requirement": "dev-IBX-9519-behat-coverage-contentree as 4.6.x-dev", - "repositoryUrl": "https://github.com/ibexa/behat", - "package": "ibexa/behat", - "shouldBeAddedAsVCS": false - } - ] -} \ No newline at end of file From 0c87681f40b2d6aab4997f72e8b8f32262f2545e Mon Sep 17 00:00:00 2001 From: juskora Date: Wed, 19 Mar 2025 15:23:45 +0100 Subject: [PATCH 5/5] Added content tree coverage test --- src/lib/Behat/Component/ContentTree.php | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/lib/Behat/Component/ContentTree.php diff --git a/src/lib/Behat/Component/ContentTree.php b/src/lib/Behat/Component/ContentTree.php new file mode 100644 index 0000000000..a782969c5a --- /dev/null +++ b/src/lib/Behat/Component/ContentTree.php @@ -0,0 +1,52 @@ +getHTMLPage()->find($this->getLocator('header'))->assert()->textEquals('Content tree'); + $this->clearSearch(); + $this->getHTMLPage()->setTimeout(10)->find($this->getLocator('header'))->assert()->isVisible('Content tree'); + } + public function verifyItemExists(string $itemPath): void + { + Assert::assertTrue($this->itemExists($itemPath)); + } + + public function itemExists(string $itemPath): bool + { + $this->clearSearch(); + + + } + + private function findNestedTreeElement(BaseElementInterface $baseElement, string $searchedElementName, int $indent): ElementInterface + { + return + } + + protected function specifyLocators(): array + { + return [ + new VisibleCSSLocator('header','.ibexa-content-tree-container .c-tb-header__name-content'), + new VisibleCSSLocator('toggler','.c-tb-contextual-menu__toggler'), + new VisibleCSSLocator('item', '.c-tb-list-item-single__element .c-tb-list-item-single__element--main') + ]; + } +} \ No newline at end of file