diff --git a/src/lib/Behat/Component/CreateUrlAliasModal.php b/src/lib/Behat/Component/CreateUrlAliasModal.php index e5117fc2fe..47e3f2cc9e 100644 --- a/src/lib/Behat/Component/CreateUrlAliasModal.php +++ b/src/lib/Behat/Component/CreateUrlAliasModal.php @@ -9,6 +9,7 @@ use Behat\Mink\Session; use Ibexa\Behat\Browser\Component\Component; +use Ibexa\Behat\Browser\Element\Condition\ElementTransitionHasEndedCondition; use Ibexa\Behat\Browser\Locator\VisibleCSSLocator; final class CreateUrlAliasModal extends Component @@ -36,6 +37,8 @@ public function createNewUrlAlias(string $path, string $languageName, bool $redi if ($redirect !== $redirectToggleState->hasClass('ibexa-toggle--is-checked')) { $this->getHTMLPage()->find($this->getLocator('redirectToggle'))->click(); } + + $this->getHTMLPage()->setTimeout(5)->waitUntilCondition(new ElementTransitionHasEndedCondition($this->getHTMLPage(), $this->getLocator('createButton'))); $this->getHTMLPage()->find($this->getLocator('createButton'))->click(); } diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php index 1cc0dfb18d..53b3ed8cc2 100644 --- a/src/lib/Behat/Page/ContentViewPage.php +++ b/src/lib/Behat/Page/ContentViewPage.php @@ -310,7 +310,7 @@ public function isBookmarked(): bool public function createNewUrlAlias(string $path, string $languageName, bool $redirect): void { - $this->getHTMLPage()->find($this->getLocator('addUrlAliasButton'))->click(); + $this->getHTMLPage()->setTimeout(3)->find($this->getLocator('addUrlAliasButton'))->click(); $this->createUrlAliasModal->createNewUrlAlias($path, $languageName, $redirect); }