]> source.dussan.org Git - nextcloud-server.git/commitdiff
Wait for the new user form to be visible 33791/head
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Thu, 1 Sep 2022 10:46:37 +0000 (12:46 +0200)
committerDaniel Calviño Sánchez <danxuliu@gmail.com>
Thu, 1 Sep 2022 11:47:51 +0000 (13:47 +0200)
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 <danxuliu@gmail.com>
tests/acceptance/features/bootstrap/UsersSettingsContext.php

index ce03564710469e0c5e8bea424fcd8245fe3be492..ff440119e341058dd77d135e7539f2fcd20fd39c 100644 (file)
@@ -293,8 +293,12 @@ class UsersSettingsContext implements Context, ActorAwareInterface {
         * @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");
+               }
        }
 
        /**