From ee68e4cf4409fb750cd0e994cc57ad50b2d8feb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 1 Sep 2022 12:46:37 +0200 Subject: [PATCH] Wait for the new user form to be visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before it was checked if the new user form was visible, but it was not waited for it. It seems that it can happen that the new user form is in the DOM, and therefore found, but not visible yet when the tests run, which caused them to (randomly) fail. Due to that now it is explicitly waited until it is visible, rather than assuming that it is visible as soon as it appears in the DOM. Signed-off-by: Daniel Calviño Sánchez --- .../features/bootstrap/UsersSettingsContext.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/features/bootstrap/UsersSettingsContext.php b/tests/acceptance/features/bootstrap/UsersSettingsContext.php index ce03564710469..ff440119e3410 100644 --- a/tests/acceptance/features/bootstrap/UsersSettingsContext.php +++ b/tests/acceptance/features/bootstrap/UsersSettingsContext.php @@ -293,8 +293,12 @@ public function iSeeThatTheListOfUsersDoesNotContainsTheUser($user) { * @Then I see that the new user form is shown */ public function iSeeThatTheNewUserFormIsShown() { - Assert::assertTrue( - $this->actor->find(self::newUserForm(), 10)->isVisible()); + if (!WaitFor::elementToBeEventuallyShown( + $this->actor, + self::newUserForm(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + Assert::fail("The new user form is not shown yet after $timeout seconds"); + } } /**