Skip to content

Commit

Permalink
[Behat] IBX-6335: Added PropertiesList component (#898)
Browse files Browse the repository at this point in the history
* IBX-6335: Added PropertiesList component

* IBX-6335: Fixed CR remarks

---------

Co-authored-by: katarzynazawada <>
  • Loading branch information
katarzynazawada authored Sep 13, 2023
1 parent 0c47993 commit 91d572f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bundle/Resources/config/services/test/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ services:
Ibexa\AdminUi\Behat\Component\IbexaDropdown: ~

Ibexa\AdminUi\Behat\Component\CreateNewPopup: ~

Ibexa\AdminUi\Behat\Component\PropertiesList: ~
40 changes: 40 additions & 0 deletions src/lib/Behat/Component/PropertiesList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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 Ibexa\Behat\Browser\Component\Component;
use Ibexa\Behat\Browser\Element\Criterion\ChildElementTextCriterion;
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;

class PropertiesList extends Component
{
public function verifyIsLoaded(): void
{
$this->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'),
];
}
}

0 comments on commit 91d572f

Please sign in to comment.