diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-11-22 05:20:26 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-11-22 05:20:26 +0100 |
commit | 139e2218d17a5d43265a7c101046f0d597e01dee (patch) | |
tree | 3311b52fc709277b5c1a42b67f004e003c668ce3 /tests/acceptance/features/bootstrap | |
parent | b7767a51f140d3f588278f053f3a9e1eb84e4346 (diff) | |
download | nextcloud-server-139e2218d17a5d43265a7c101046f0d597e01dee.tar.gz nextcloud-server-139e2218d17a5d43265a7c101046f0d597e01dee.zip |
Add acceptance tests for switching to the comments of another file
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance/features/bootstrap')
-rw-r--r-- | tests/acceptance/features/bootstrap/CommentsAppContext.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/CommentsAppContext.php b/tests/acceptance/features/bootstrap/CommentsAppContext.php index 13d8af4e60e..5d19412c30e 100644 --- a/tests/acceptance/features/bootstrap/CommentsAppContext.php +++ b/tests/acceptance/features/bootstrap/CommentsAppContext.php @@ -63,6 +63,15 @@ class CommentsAppContext implements Context, ActorAwareInterface { } /** + * @return Locator + */ + public static function emptyContent() { + return Locator::forThe()->css(".emptycontent")-> + descendantOf(FilesAppContext::detailsView())-> + describedAs("Empty content in details view in Files app"); + } + + /** * @When /^I create a new comment with "([^"]*)" as message$/ */ public function iCreateANewCommentWithAsMessage($commentText) { @@ -71,10 +80,29 @@ 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()); + } + + /** * @Then /^I see a comment with "([^"]*)" as message$/ */ public function iSeeACommentWithAsMessage($commentText) { PHPUnit_Framework_Assert::assertTrue( $this->actor->find(self::commentWithText($commentText), 10)->isVisible()); } + + /** + * @Then /^I see that there is no comment with "([^"]*)" as message$/ + */ + public function iSeeThatThereIsNoCommentWithAsMessage($commentText) { + try { + PHPUnit_Framework_Assert::assertFalse( + $this->actor->find(self::commentWithText($commentText))->isVisible()); + } catch (NoSuchElementException $exception) { + } + } } |