Skip to content

Commit fec8d12

Browse files
committed
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>
1 parent 337cd25 commit fec8d12

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/acceptance/features/bootstrap/FilesAppContext.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,14 @@ public function iShareTheLinkFor($fileName) {
320320
$this->actor->find(FileListContext::shareActionForFile(self::currentSectionMainView(), $fileName), 10)->click();
321321

322322
$this->actor->find(self::shareLinkAddNewButton(), 5)->click();
323+
324+
// Wait until the menu was opened after the share creation to continue.
325+
if (!WaitFor::elementToBeEventuallyShown(
326+
$this->actor,
327+
self::shareLinkMenu(),
328+
$timeout = 5 * $this->actor->getFindTimeoutMultiplier())) {
329+
PHPUnit_Framework_Assert::fail("The share link menu is not open yet after $timeout seconds");
330+
}
323331
}
324332

325333
/**

0 commit comments

Comments
 (0)