Merge pull request #12649 from nextcloud/make-acceptance-tests-for-comments-more-robust

Make acceptance tests for comments more robust
This commit is contained in:
Morris Jobke 2018-11-26 11:23:01 +01:00 committed by GitHub
commit 217002701e
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");
}
}
/**