Skip to content
Snippets Groups Projects
Commit d5725cb3 authored by Daniel Calviño Sánchez's avatar Daniel Calviño Sánchez
Browse files

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: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>
parent ea17e962
No related branches found
No related tags found
No related merge requests found
...@@ -83,8 +83,12 @@ class CommentsAppContext implements Context, ActorAwareInterface { ...@@ -83,8 +83,12 @@ class CommentsAppContext implements Context, ActorAwareInterface {
* @Then /^I see that there are no comments$/ * @Then /^I see that there are no comments$/
*/ */
public function iSeeThatThereAreNoComments() { public function iSeeThatThereAreNoComments() {
PHPUnit_Framework_Assert::assertTrue( if (!WaitFor::elementToBeEventuallyShown(
$this->actor->find(self::emptyContent(), 10)->isVisible()); $this->actor,
self::emptyContent(),
$timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
PHPUnit_Framework_Assert::fail("The no comments message is not visible yet after $timeout seconds");
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment