-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
0c47993
commit 91d572f
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
]; | ||
} | ||
} |