summaryrefslogtreecommitdiffstats
path: root/tests/acceptance
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-02 14:08:03 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-02 14:24:52 +0100
commitfec8d12fc568c70ebae86e4d8c22fc90df54d4de (patch)
tree3879ab9140d9cb26fd9003066147eab769250f6d /tests/acceptance
parent337cd251872371f064968cdd8731929124ac4fb3 (diff)
downloadnextcloud-server-fec8d12fc568c70ebae86e4d8c22fc90df54d4de.tar.gz
nextcloud-server-fec8d12fc568c70ebae86e4d8c22fc90df54d4de.zip
Wait for the link share menu to open in acceptance tests
In the acceptance tests the link share menu is automatically opened if needed before interacting with an item in the menu; if the menu is not open it is opened by clicking on its toggle. However, since a recent change the link share menu is automatically opened by the regular UI after the link share is created. This causes that, sometimes, after the creation of a link share the acceptance tests check whether the menu is shown or not before the menu was automatically opened; as the menu is not open then the acceptance tests proceed to click on the toggle, but in the meantime the link share was created and the menu opened, so clicking on the toggle now closes it. As the menu is closed it is not possible to interact with its items and the test fails. To prevent that now the acceptance tests wait for the link share menu to open after a link share is created before continuing with the other steps. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance')
-rw-r--r--tests/acceptance/features/bootstrap/FilesAppContext.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppContext.php b/tests/acceptance/features/bootstrap/FilesAppContext.php
index 459028813b5..73fc04000e9 100644
--- a/tests/acceptance/features/bootstrap/FilesAppContext.php
+++ b/tests/acceptance/features/bootstrap/FilesAppContext.php
@@ -320,6 +320,14 @@ class FilesAppContext implements Context, ActorAwareInterface {
$this->actor->find(FileListContext::shareActionForFile(self::currentSectionMainView(), $fileName), 10)->click();
$this->actor->find(self::shareLinkAddNewButton(), 5)->click();
+
+ // Wait until the menu was opened after the share creation to continue.
+ if (!WaitFor::elementToBeEventuallyShown(
+ $this->actor,
+ self::shareLinkMenu(),
+ $timeout = 5 * $this->actor->getFindTimeoutMultiplier())) {
+ PHPUnit_Framework_Assert::fail("The share link menu is not open yet after $timeout seconds");
+ }
}
/**