Skip to content

Commit d156ca6

Browse files
barbaragrbarbaragr
andauthored
IBX-10972: Added wait condition until button is loaded and active (#1786)
* Revert "Revert "Added wait until button is loaded"" This reverts commit 7702d93. * Timeout added * Timeout added --------- Co-authored-by: barbaragr <[email protected]>
1 parent afd71af commit d156ca6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/lib/Behat/Component/CreateUrlAliasModal.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Behat\Mink\Session;
1111
use Ibexa\Behat\Browser\Component\Component;
12+
use Ibexa\Behat\Browser\Element\Condition\ElementTransitionHasEndedCondition;
1213
use Ibexa\Behat\Browser\Locator\VisibleCSSLocator;
1314

1415
final class CreateUrlAliasModal extends Component
@@ -36,6 +37,8 @@ public function createNewUrlAlias(string $path, string $languageName, bool $redi
3637
if ($redirect !== $redirectToggleState->hasClass('ibexa-toggle--is-checked')) {
3738
$this->getHTMLPage()->find($this->getLocator('redirectToggle'))->click();
3839
}
40+
41+
$this->getHTMLPage()->setTimeout(5)->waitUntilCondition(new ElementTransitionHasEndedCondition($this->getHTMLPage(), $this->getLocator('createButton')));
3942
$this->getHTMLPage()->find($this->getLocator('createButton'))->click();
4043
}
4144

src/lib/Behat/Page/ContentViewPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public function isBookmarked(): bool
310310

311311
public function createNewUrlAlias(string $path, string $languageName, bool $redirect): void
312312
{
313-
$this->getHTMLPage()->find($this->getLocator('addUrlAliasButton'))->click();
313+
$this->getHTMLPage()->setTimeout(3)->find($this->getLocator('addUrlAliasButton'))->click();
314314
$this->createUrlAliasModal->createNewUrlAlias($path, $languageName, $redirect);
315315
}
316316

0 commit comments

Comments
 (0)