diff --git a/src/bundle/Resources/config/services/test/components.yaml b/src/bundle/Resources/config/services/test/components.yaml index 0db27a3b02..3b5b333d20 100644 --- a/src/bundle/Resources/config/services/test/components.yaml +++ b/src/bundle/Resources/config/services/test/components.yaml @@ -53,3 +53,5 @@ services: Ibexa\AdminUi\Behat\Component\IbexaDropdown: ~ Ibexa\AdminUi\Behat\Component\CreateNewPopup: ~ + + Ibexa\AdminUi\Behat\Component\PropertiesList: ~ diff --git a/src/lib/Behat/Component/PropertiesList.php b/src/lib/Behat/Component/PropertiesList.php new file mode 100644 index 0000000000..86479842b1 --- /dev/null +++ b/src/lib/Behat/Component/PropertiesList.php @@ -0,0 +1,40 @@ +getHTMLPage()->find($this->getLocator('tabContent'))->assert()->isVisible(); + } + + public function verifyValue(string $label, string $value): void + { + $this->getHTMLPage() + ->findAll($this->getLocator('globalPropertiesItem')) + ->getByCriterion(new ChildElementTextCriterion($this->getLocator('globalPropertiesLabel'), $label)) + ->find($this->getLocator('globalPropertiesValue')) + ->assert()->textEquals($value); + } + + protected function specifyLocators(): array + { + return [ + new VisibleCSSLocator('tabContent', '.ibexa-tab-content'), + new VisibleCSSLocator('globalPropertiesItem', '.ibexa-details__item'), + new VisibleCSSLocator('globalPropertiesLabel', '.ibexa-details__item-label'), + new VisibleCSSLocator('globalPropertiesValue', '.ibexa-details__item-content'), + ]; + } +}