Skip to content

Commit

Permalink
Merge branch '4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Oct 6, 2023
2 parents 33686e6 + e0d0b1d commit a085e8c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 43 deletions.
14 changes: 8 additions & 6 deletions src/lib/Behat/Component/Fields/ContentRelationSingle.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Behat\Mink\Session;
use Ibexa\AdminUi\Behat\Component\Table\TableBuilder;
use Ibexa\AdminUi\Behat\Component\UniversalDiscoveryWidget;
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
use Ibexa\Behat\Browser\Locator\CSSLocatorBuilder;
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;
use PHPUnit\Framework\Assert;
Expand Down Expand Up @@ -46,18 +47,19 @@ public function __construct(Session $session, UniversalDiscoveryWidget $universa
public function setValue(array $parameters): void
{
if (!$this->isRelationEmpty()) {
$this->getHTMLPage()->find($this->getLocator('buttonRemove'))->mouseOver();
usleep(100 * 5000); // 500ms
$this->getHTMLPage()->find($this->getLocator('buttonRemove'))->click();
$this->getHTMLPage()
->find($this->getLocator('buttonRemove'))
->execute(new MouseOverAndClick());
}

$buttonLocator = CSSLocatorBuilder::base($this->parentLocator)
->withDescendant($this->getLocator('selectContent'))
->build();

$this->getHTMLPage()->setTimeout(5)->find($buttonLocator)->mouseOver();
usleep(100);
$this->getHTMLPage()->find($buttonLocator)->click();
$this->getHTMLPage()
->setTimeout(5)
->find($buttonLocator)
->execute(new MouseOverAndClick());

$this->universalDiscoveryWidget->verifyIsLoaded();
$this->universalDiscoveryWidget->selectContent($parameters['value']);
Expand Down
18 changes: 8 additions & 10 deletions src/lib/Behat/Component/SubItemsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Ibexa\AdminUi\Behat\Component\Table\TableBuilder;
use Ibexa\AdminUi\Behat\Component\Table\TableInterface;
use Ibexa\Behat\Browser\Component\Component;
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
use Ibexa\Behat\Browser\Element\Condition\ElementNotExistsCondition;
use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion;
use Ibexa\Behat\Browser\Locator\CSSLocator;
Expand Down Expand Up @@ -46,23 +47,20 @@ public function sortBy(string $columnName, bool $ascending): void
return;
}

$header = $this->getHTMLPage()
$this->getHTMLPage()
->setTimeout(3)
->findAll($this->getLocator('horizontalHeaders'))
->getByCriterion(new ElementTextCriterion($columnName));
$header->mouseOver();
usleep(100 * 2500); // 250 ms TODO: Remove after redesign
$header->click();
->getByCriterion(new ElementTextCriterion($columnName))
->execute(new MouseOverAndClick());

$isSortedDescending = $this->getHTMLPage()->findAll($this->getLocator('sortingOrderDescending'))->any();

if (!$isSortedDescending && !$ascending) {
$header = $this->getHTMLPage()
$this->getHTMLPage()
->setTimeout(3)
->findAll($this->getLocator('horizontalHeaders'))
->getByCriterion(new ElementTextCriterion($columnName));
$header->mouseOver();
usleep(100 * 2500); // 250 ms TODO: Remove after redesign
$header->click();
->getByCriterion(new ElementTextCriterion($columnName))
->execute(new MouseOverAndClick());
}

$verificationLocator = $ascending ?
Expand Down
28 changes: 8 additions & 20 deletions src/lib/Behat/Component/Table/TableRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use Behat\Mink\Session;
use Ibexa\Behat\Browser\Component\Component;
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
use Ibexa\Behat\Browser\Element\ElementInterface;
use Ibexa\Behat\Browser\Locator\LocatorCollection;
use Ibexa\Behat\Browser\Locator\LocatorInterface;
Expand All @@ -32,10 +33,7 @@ public function __construct(Session $session, ElementInterface $element, Locator

public function goToItem(): void
{
// TODO: Revisit during redesign
$this->element->find($this->getLocator('link'))->mouseOver();
usleep(100 * 5000); // 500ms
$this->element->find($this->getLocator('link'))->click();
$this->element->find($this->getLocator('link'))->execute(new MouseOverAndClick());
}

public function select(): void
Expand All @@ -45,34 +43,24 @@ public function select(): void

public function edit(): void
{
// TODO: Revisit during redesign
$this->element->find($this->getLocator('edit'))->mouseOver();
usleep(100 * 5000); // 500ms
$this->element->find($this->getLocator('edit'))->click();
$this->element->find($this->getLocator('edit'))->execute(new MouseOverAndClick());
}

public function copy(): void
{
// TODO: Revisit during redesign
$this->element->find($this->getLocator('copy'))->mouseOver();
usleep(100 * 5000); // 500ms
$this->element->find($this->getLocator('copy'))->click();
$this->element->find($this->getLocator('copy'))->execute(new MouseOverAndClick());
}

public function deactivate(): void
{
// TODO: Revisit during redesign
$this->element->find($this->getLocator('de-active'))->mouseOver();
usleep(100 * 5000); // 500ms
$this->element->find($this->getLocator('de-active'))->click();
$this->element->find($this->getLocator('de-active'))->execute(new MouseOverAndClick());
}

public function activate(): void
{
// TODO: Revisit during redesign
$this->element->find($this->getLocator('active'))->mouseOver();
usleep(100 * 5000); // 500ms
$this->element->find($this->getLocator('active'))->click();
$this->element
->find($this->getLocator('active'))
->execute(new MouseOverAndClick());
}

public function assign(): void
Expand Down
7 changes: 4 additions & 3 deletions src/lib/Behat/Page/ContentTypeUpdatePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Ibexa\AdminUi\Behat\Page;

use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
use Ibexa\Behat\Browser\Element\Condition\ElementExistsCondition;
use Ibexa\Behat\Browser\Element\Condition\ElementNotExistsCondition;
use Ibexa\Behat\Browser\Element\Condition\ElementsCountCondition;
Expand Down Expand Up @@ -108,9 +109,9 @@ public function addFieldDefinition(string $fieldName)

public function clickAddButton(): void
{
$this->getHTMLPage()->find($this->getLocator('contentTypeAddButton'))->mouseOver();
usleep(100 * 5000); // 500ms
$this->getHTMLPage()->find($this->getLocator('contentTypeAddButton'))->click();
$this->getHTMLPage()
->find($this->getLocator('contentTypeAddButton'))
->execute(new MouseOverAndClick());
$this->getHTMLPage()
->setTimeout(3)
->waitUntilCondition(
Expand Down
6 changes: 2 additions & 4 deletions src/lib/Behat/Page/RoleUpdatePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Ibexa\AdminUi\Behat\Component\ContentActionsMenu;
use Ibexa\AdminUi\Behat\Component\IbexaDropdown;
use Ibexa\AdminUi\Behat\Component\UniversalDiscoveryWidget;
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
use Ibexa\Behat\Browser\Element\Criterion\ChildElementTextCriterion;
use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion;
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;
Expand Down Expand Up @@ -135,10 +136,7 @@ public function selectSubtreeLimitationForPolicy(string $itemPath)
->findAll($this->getLocator('button'))
->filterBy(new ElementTextCriterion('Select Locations'))
->toArray();

$buttons[1]->mouseOver();
usleep(100 * 2500); // 250 ms TODO: Remove after redesign is done
$buttons[1]->click();
$buttons[1]->execute(new MouseOverAndClick());

$this->universalDiscoveryWidget->verifyIsLoaded();
$this->universalDiscoveryWidget->selectContent($itemPath);
Expand Down

0 comments on commit a085e8c

Please sign in to comment.