diff --git a/features/standard/ContentTree.feature b/features/standard/ContentTree.feature new file mode 100644 index 0000000000..9cde76bbec --- /dev/null +++ b/features/standard/ContentTree.feature @@ -0,0 +1,25 @@ +@IbexaOSS @IbexaHeadless @IbexaCommerce @IbexaExperience @javascript +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" + + 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