Skip to content

Commit 0c87681

Browse files
committed
Added content tree coverage test
1 parent 1a471f3 commit 0c87681

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5+
* @license For full copyright and license information view LICENSE file distributed with this source code.
6+
*/
7+
8+
declare(strict_types=1);
9+
10+
namespace Ibexa\AdminUi\Behat\Component;
11+
12+
use Behat\Mink\Session;
13+
use Ibexa\Behat\Browser\Component\Component;
14+
use Ibexa\Behat\Browser\Element\BaseElementInterface;
15+
use Ibexa\Behat\Browser\Element\ElementInterface;
16+
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;
17+
18+
19+
class ContentTree extends Component
20+
{
21+
public function verifyIsLoaded(): void
22+
{
23+
$this->getHTMLPage()->find($this->getLocator('header'))->assert()->textEquals('Content tree');
24+
$this->clearSearch();
25+
$this->getHTMLPage()->setTimeout(10)->find($this->getLocator('header'))->assert()->isVisible('Content tree');
26+
}
27+
public function verifyItemExists(string $itemPath): void
28+
{
29+
Assert::assertTrue($this->itemExists($itemPath));
30+
}
31+
32+
public function itemExists(string $itemPath): bool
33+
{
34+
$this->clearSearch();
35+
36+
37+
}
38+
39+
private function findNestedTreeElement(BaseElementInterface $baseElement, string $searchedElementName, int $indent): ElementInterface
40+
{
41+
return
42+
}
43+
44+
protected function specifyLocators(): array
45+
{
46+
return [
47+
new VisibleCSSLocator('header','.ibexa-content-tree-container .c-tb-header__name-content'),
48+
new VisibleCSSLocator('toggler','.c-tb-contextual-menu__toggler'),
49+
new VisibleCSSLocator('item', '.c-tb-list-item-single__element .c-tb-list-item-single__element--main')
50+
];
51+
}
52+
}

0 commit comments

Comments
 (0)