Skip to content

Commit a085e8c

Browse files
committed
Merge branch '4.5'
2 parents 33686e6 + e0d0b1d commit a085e8c

File tree

5 files changed

+30
-43
lines changed

5 files changed

+30
-43
lines changed

src/lib/Behat/Component/Fields/ContentRelationSingle.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Behat\Mink\Session;
1212
use Ibexa\AdminUi\Behat\Component\Table\TableBuilder;
1313
use Ibexa\AdminUi\Behat\Component\UniversalDiscoveryWidget;
14+
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
1415
use Ibexa\Behat\Browser\Locator\CSSLocatorBuilder;
1516
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;
1617
use PHPUnit\Framework\Assert;
@@ -46,18 +47,19 @@ public function __construct(Session $session, UniversalDiscoveryWidget $universa
4647
public function setValue(array $parameters): void
4748
{
4849
if (!$this->isRelationEmpty()) {
49-
$this->getHTMLPage()->find($this->getLocator('buttonRemove'))->mouseOver();
50-
usleep(100 * 5000); // 500ms
51-
$this->getHTMLPage()->find($this->getLocator('buttonRemove'))->click();
50+
$this->getHTMLPage()
51+
->find($this->getLocator('buttonRemove'))
52+
->execute(new MouseOverAndClick());
5253
}
5354

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

58-
$this->getHTMLPage()->setTimeout(5)->find($buttonLocator)->mouseOver();
59-
usleep(100);
60-
$this->getHTMLPage()->find($buttonLocator)->click();
59+
$this->getHTMLPage()
60+
->setTimeout(5)
61+
->find($buttonLocator)
62+
->execute(new MouseOverAndClick());
6163

6264
$this->universalDiscoveryWidget->verifyIsLoaded();
6365
$this->universalDiscoveryWidget->selectContent($parameters['value']);

src/lib/Behat/Component/SubItemsList.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Ibexa\AdminUi\Behat\Component\Table\TableBuilder;
1414
use Ibexa\AdminUi\Behat\Component\Table\TableInterface;
1515
use Ibexa\Behat\Browser\Component\Component;
16+
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
1617
use Ibexa\Behat\Browser\Element\Condition\ElementNotExistsCondition;
1718
use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion;
1819
use Ibexa\Behat\Browser\Locator\CSSLocator;
@@ -46,23 +47,20 @@ public function sortBy(string $columnName, bool $ascending): void
4647
return;
4748
}
4849

49-
$header = $this->getHTMLPage()
50+
$this->getHTMLPage()
5051
->setTimeout(3)
5152
->findAll($this->getLocator('horizontalHeaders'))
52-
->getByCriterion(new ElementTextCriterion($columnName));
53-
$header->mouseOver();
54-
usleep(100 * 2500); // 250 ms TODO: Remove after redesign
55-
$header->click();
53+
->getByCriterion(new ElementTextCriterion($columnName))
54+
->execute(new MouseOverAndClick());
55+
5656
$isSortedDescending = $this->getHTMLPage()->findAll($this->getLocator('sortingOrderDescending'))->any();
5757

5858
if (!$isSortedDescending && !$ascending) {
59-
$header = $this->getHTMLPage()
59+
$this->getHTMLPage()
6060
->setTimeout(3)
6161
->findAll($this->getLocator('horizontalHeaders'))
62-
->getByCriterion(new ElementTextCriterion($columnName));
63-
$header->mouseOver();
64-
usleep(100 * 2500); // 250 ms TODO: Remove after redesign
65-
$header->click();
62+
->getByCriterion(new ElementTextCriterion($columnName))
63+
->execute(new MouseOverAndClick());
6664
}
6765

6866
$verificationLocator = $ascending ?

src/lib/Behat/Component/Table/TableRow.php

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use Behat\Mink\Session;
1212
use Ibexa\Behat\Browser\Component\Component;
13+
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
1314
use Ibexa\Behat\Browser\Element\ElementInterface;
1415
use Ibexa\Behat\Browser\Locator\LocatorCollection;
1516
use Ibexa\Behat\Browser\Locator\LocatorInterface;
@@ -32,10 +33,7 @@ public function __construct(Session $session, ElementInterface $element, Locator
3233

3334
public function goToItem(): void
3435
{
35-
// TODO: Revisit during redesign
36-
$this->element->find($this->getLocator('link'))->mouseOver();
37-
usleep(100 * 5000); // 500ms
38-
$this->element->find($this->getLocator('link'))->click();
36+
$this->element->find($this->getLocator('link'))->execute(new MouseOverAndClick());
3937
}
4038

4139
public function select(): void
@@ -45,34 +43,24 @@ public function select(): void
4543

4644
public function edit(): void
4745
{
48-
// TODO: Revisit during redesign
49-
$this->element->find($this->getLocator('edit'))->mouseOver();
50-
usleep(100 * 5000); // 500ms
51-
$this->element->find($this->getLocator('edit'))->click();
46+
$this->element->find($this->getLocator('edit'))->execute(new MouseOverAndClick());
5247
}
5348

5449
public function copy(): void
5550
{
56-
// TODO: Revisit during redesign
57-
$this->element->find($this->getLocator('copy'))->mouseOver();
58-
usleep(100 * 5000); // 500ms
59-
$this->element->find($this->getLocator('copy'))->click();
51+
$this->element->find($this->getLocator('copy'))->execute(new MouseOverAndClick());
6052
}
6153

6254
public function deactivate(): void
6355
{
64-
// TODO: Revisit during redesign
65-
$this->element->find($this->getLocator('de-active'))->mouseOver();
66-
usleep(100 * 5000); // 500ms
67-
$this->element->find($this->getLocator('de-active'))->click();
56+
$this->element->find($this->getLocator('de-active'))->execute(new MouseOverAndClick());
6857
}
6958

7059
public function activate(): void
7160
{
72-
// TODO: Revisit during redesign
73-
$this->element->find($this->getLocator('active'))->mouseOver();
74-
usleep(100 * 5000); // 500ms
75-
$this->element->find($this->getLocator('active'))->click();
61+
$this->element
62+
->find($this->getLocator('active'))
63+
->execute(new MouseOverAndClick());
7664
}
7765

7866
public function assign(): void

src/lib/Behat/Page/ContentTypeUpdatePage.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace Ibexa\AdminUi\Behat\Page;
1010

11+
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
1112
use Ibexa\Behat\Browser\Element\Condition\ElementExistsCondition;
1213
use Ibexa\Behat\Browser\Element\Condition\ElementNotExistsCondition;
1314
use Ibexa\Behat\Browser\Element\Condition\ElementsCountCondition;
@@ -108,9 +109,9 @@ public function addFieldDefinition(string $fieldName)
108109

109110
public function clickAddButton(): void
110111
{
111-
$this->getHTMLPage()->find($this->getLocator('contentTypeAddButton'))->mouseOver();
112-
usleep(100 * 5000); // 500ms
113-
$this->getHTMLPage()->find($this->getLocator('contentTypeAddButton'))->click();
112+
$this->getHTMLPage()
113+
->find($this->getLocator('contentTypeAddButton'))
114+
->execute(new MouseOverAndClick());
114115
$this->getHTMLPage()
115116
->setTimeout(3)
116117
->waitUntilCondition(

src/lib/Behat/Page/RoleUpdatePage.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Ibexa\AdminUi\Behat\Component\ContentActionsMenu;
1414
use Ibexa\AdminUi\Behat\Component\IbexaDropdown;
1515
use Ibexa\AdminUi\Behat\Component\UniversalDiscoveryWidget;
16+
use Ibexa\Behat\Browser\Element\Action\MouseOverAndClick;
1617
use Ibexa\Behat\Browser\Element\Criterion\ChildElementTextCriterion;
1718
use Ibexa\Behat\Browser\Element\Criterion\ElementTextCriterion;
1819
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;
@@ -135,10 +136,7 @@ public function selectSubtreeLimitationForPolicy(string $itemPath)
135136
->findAll($this->getLocator('button'))
136137
->filterBy(new ElementTextCriterion('Select Locations'))
137138
->toArray();
138-
139-
$buttons[1]->mouseOver();
140-
usleep(100 * 2500); // 250 ms TODO: Remove after redesign is done
141-
$buttons[1]->click();
139+
$buttons[1]->execute(new MouseOverAndClick());
142140

143141
$this->universalDiscoveryWidget->verifyIsLoaded();
144142
$this->universalDiscoveryWidget->selectContent($itemPath);

0 commit comments

Comments
 (0)