aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-24 18:06:20 +0100
committerBackportbot <backportbot-noreply@rullzer.com>2018-11-27 16:56:38 +0000
commitfc0a1d10159e60d1e76a3f141b5c13da7a633c1f (patch)
tree9770ba195dd60ebc469b560f07836dbec499b410
parent2706bc7df7801e1ad4fed82922387d11e4726233 (diff)
downloadnextcloud-server-fc0a1d10159e60d1e76a3f141b5c13da7a633c1f.tar.gz
nextcloud-server-fc0a1d10159e60d1e76a3f141b5c13da7a633c1f.zip
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>
-rw-r--r--tests/acceptance/features/bootstrap/CommentsAppContext.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/acceptance/features/bootstrap/CommentsAppContext.php b/tests/acceptance/features/bootstrap/CommentsAppContext.php
index 5d19412c30e..57e60afa60e 100644
--- a/tests/acceptance/features/bootstrap/CommentsAppContext.php
+++ b/tests/acceptance/features/bootstrap/CommentsAppContext.php
@@ -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");
+ }
}
/**