]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add missing waits when finding elements in the acceptance tests
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Sun, 17 Jan 2021 16:39:35 +0000 (17:39 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 8 Mar 2021 07:59:32 +0000 (07:59 +0000)
As no timeout was specified the elements were tried to be found just
once. This caused the steps to fail if the elements did not appear yet
in the page when they were tried to be found.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
tests/acceptance/features/bootstrap/AppSettingsContext.php
tests/acceptance/features/bootstrap/AppsManagementContext.php
tests/acceptance/features/bootstrap/UsersSettingsContext.php

index b2b6744a36b81528653b234060b26a16fa2416bb..d7ee4a2eb004bbbb7b71a803584f9daad672981c 100644 (file)
@@ -74,7 +74,7 @@ class AppSettingsContext implements Context, ActorAwareInterface {
         * @Given I open the settings
         */
        public function iOpenTheSettings() {
-               $this->actor->find(self::appSettingsOpenButton())->click();
+               $this->actor->find(self::appSettingsOpenButton(), 10)->click();
        }
 
        /**
@@ -84,11 +84,11 @@ class AppSettingsContext implements Context, ActorAwareInterface {
                $locator = self::CheckboxInTheSettings($id);
 
                // If locator is not visible, fallback to label
-               if (!$this->actor->find(self::CheckboxInTheSettings($id))->isVisible()) {
+               if (!$this->actor->find(self::CheckboxInTheSettings($id), 10)->isVisible()) {
                        $locator = self::checkboxLabelInTheSettings($id);
                }
 
-               $this->actor->find($locator)->click();
+               $this->actor->find($locator, 10)->click();
        }
 
        /**
index 1f3b2dbe28ab642a2c39334442d085bf53294495..d86b972c85bdb092e44086dc5f06d22bc329a84c 100644 (file)
@@ -209,7 +209,7 @@ class AppsManagementContext implements Context, ActorAwareInterface {
         * @Given /^I see that the "([^"]*)" is disabled$/
         */
        public function iSeeThatTheIsDisabled($bundle) {
-               PHPUnit\Framework\Assert::assertEquals('Enable all', $this->actor->find(self::bundleButton($bundle))->getValue());
+               PHPUnit\Framework\Assert::assertEquals('Enable all', $this->actor->find(self::bundleButton($bundle), 2)->getValue());
        }
 
        /**
index 020da466128261eabb872a7b4893bf473d56b1d9..cc542bf2fc412ec0f4ca5b4ade6e6ee563ba5f65 100644 (file)
@@ -176,21 +176,21 @@ class UsersSettingsContext implements Context, ActorAwareInterface {
         * @When I click the New user button
         */
        public function iClickTheNewUserButton() {
-               $this->actor->find(self::newUserButton())->click();
+               $this->actor->find(self::newUserButton(), 10)->click();
        }
 
        /**
         * @When I click the :action action in the :user actions menu
         */
        public function iClickTheAction($action, $user) {
-               $this->actor->find(self::theAction($action, $user))->click();
+               $this->actor->find(self::theAction($action, $user), 10)->click();
        }
 
        /**
         * @When I open the actions menu for the user :user
         */
        public function iOpenTheActionsMenuOf($user) {
-               $this->actor->find(self::actionsMenuOf($user))->click();
+               $this->actor->find(self::actionsMenuOf($user), 10)->click();
        }
 
        /**