|
| 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