Merge pull request #12697 from nextcloud/backport/12649/stable14

[stable14] Make acceptance tests for comments more robust
This commit is contained in:
Daniel Kesselberg 2018-11-27 21:25:10 +01:00 committed by GitHub
commit b8311b0dd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -24,6 +24,7 @@ Feature: app-comments
And I open the details view for "Folder"
And I open the "Comments" tab in the details view
And I create a new comment with "Comment in Folder" as message
And I see a comment with "Comment in Folder" as message
And I open the details view for "welcome.txt"
# The "Comments" tab should already be opened
When I create a new comment with "Comment in welcome.txt" as message

View file

@ -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");
}
}
/**