|
|
@@ -62,6 +62,15 @@ class CommentsAppContext implements Context, ActorAwareInterface { |
|
|
|
describedAs("Comment with text \"$text\" in details view in Files app"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @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$/ |
|
|
|
*/ |
|
|
@@ -70,6 +79,14 @@ class CommentsAppContext implements Context, ActorAwareInterface { |
|
|
|
$this->actor->find(self::submitNewCommentButton())->click(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @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$/ |
|
|
|
*/ |
|
|
@@ -77,4 +94,15 @@ class CommentsAppContext implements Context, ActorAwareInterface { |
|
|
|
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) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |