mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 01:50:33 -04:00
Wait for the empty content element to be shown
When the "Comments" tab is open the empty content element is always in the DOM, although it is only shown once the message collection was fetched and there were no messages. Due to this it is necessary to explicitly wait for it to be shown instead of relying on the implicit wait made to find the element; otherwise it would be found immediately and if the collection was not fetched yet it would not be visible, causing the test to fail. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
ea17e962bf
commit
d5725cb3d9
1 changed files with 6 additions and 2 deletions
|
|
@ -83,8 +83,12 @@ class CommentsAppContext implements Context, ActorAwareInterface {
|
|||
* @Then /^I see that there are no comments$/
|
||||
*/
|
||||
public function iSeeThatThereAreNoComments() {
|
||||
PHPUnit_Framework_Assert::assertTrue(
|
||||
$this->actor->find(self::emptyContent(), 10)->isVisible());
|
||||
if (!WaitFor::elementToBeEventuallyShown(
|
||||
$this->actor,
|
||||
self::emptyContent(),
|
||||
$timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
|
||||
PHPUnit_Framework_Assert::fail("The no comments message is not visible yet after $timeout seconds");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue