Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions features/standard/ContentTree.feature
Original file line number Diff line number Diff line change
@@ -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"


52 changes: 52 additions & 0 deletions src/lib/Behat/Component/ContentTree.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

declare(strict_types=1);

namespace Ibexa\AdminUi\Behat\Component;

use Behat\Mink\Session;
use Ibexa\Behat\Browser\Component\Component;
use Ibexa\Behat\Browser\Element\BaseElementInterface;
use Ibexa\Behat\Browser\Element\ElementInterface;
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;


Comment on lines +17 to +18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

class ContentTree extends Component
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class ContentTree extends Component
final class ContentTree extends Component

{
public function verifyIsLoaded(): void
{
$this->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
}

Check failure on line 42 in src/lib/Behat/Component/ContentTree.php

View workflow job for this annotation

GitHub Actions / Tests (7.4)

Syntax error, unexpected '}', expecting ';' on line 42

Check failure on line 42 in src/lib/Behat/Component/ContentTree.php

View workflow job for this annotation

GitHub Actions / Tests (8.0)

Syntax error, unexpected '}', expecting ';' on line 42

Check failure on line 42 in src/lib/Behat/Component/ContentTree.php

View workflow job for this annotation

GitHub Actions / Tests (8.1)

Syntax error, unexpected '}', expecting ';' on line 42

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')
];
}
}
Loading