Skip to content

Commit 91d572f

Browse files
[Behat] IBX-6335: Added PropertiesList component (#898)
* IBX-6335: Added PropertiesList component * IBX-6335: Fixed CR remarks --------- Co-authored-by: katarzynazawada <>
1 parent 0c47993 commit 91d572f

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/bundle/Resources/config/services/test/components.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ services:
5353
Ibexa\AdminUi\Behat\Component\IbexaDropdown: ~
5454

5555
Ibexa\AdminUi\Behat\Component\CreateNewPopup: ~
56+
57+
Ibexa\AdminUi\Behat\Component\PropertiesList: ~
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
declare(strict_types=1);
8+
9+
namespace Ibexa\AdminUi\Behat\Component;
10+
11+
use Ibexa\Behat\Browser\Component\Component;
12+
use Ibexa\Behat\Browser\Element\Criterion\ChildElementTextCriterion;
13+
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;
14+
15+
class PropertiesList extends Component
16+
{
17+
public function verifyIsLoaded(): void
18+
{
19+
$this->getHTMLPage()->find($this->getLocator('tabContent'))->assert()->isVisible();
20+
}
21+
22+
public function verifyValue(string $label, string $value): void
23+
{
24+
$this->getHTMLPage()
25+
->findAll($this->getLocator('globalPropertiesItem'))
26+
->getByCriterion(new ChildElementTextCriterion($this->getLocator('globalPropertiesLabel'), $label))
27+
->find($this->getLocator('globalPropertiesValue'))
28+
->assert()->textEquals($value);
29+
}
30+
31+
protected function specifyLocators(): array
32+
{
33+
return [
34+
new VisibleCSSLocator('tabContent', '.ibexa-tab-content'),
35+
new VisibleCSSLocator('globalPropertiesItem', '.ibexa-details__item'),
36+
new VisibleCSSLocator('globalPropertiesLabel', '.ibexa-details__item-label'),
37+
new VisibleCSSLocator('globalPropertiesValue', '.ibexa-details__item-content'),
38+
];
39+
}
40+
}

0 commit comments

Comments
 (0)