Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a better name than the one I came up with 😄 💪

{
$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'),
];
}
}