diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-02-15 18:34:48 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-02-16 14:24:35 +0300 |
commit | f6737e43e90b6fc56bd4ccce2f872eed0a1af3e4 (patch) | |
tree | a5edb1f8601737058a8d4d24f1132aab898b2da3 /tests | |
parent | 38a03f319371d4599b0027feeded70c89a2fc4e2 (diff) |
Move locators above step definitions
The locators are moved above the step definitions for consistency with
other context files; besides that I made some minor adjustments for
consistency too in the locator descriptions and identation, and moved
the locators for ".newCommentRow" descendants together.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/features/bootstrap/CommentsAppContext.php | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/tests/acceptance/features/bootstrap/CommentsAppContext.php b/tests/acceptance/features/bootstrap/CommentsAppContext.php index 64d1dc69bc4..83a2476eb91 100644 --- a/tests/acceptance/features/bootstrap/CommentsAppContext.php +++ b/tests/acceptance/features/bootstrap/CommentsAppContext.php @@ -26,6 +26,32 @@ use Behat\Behat\Context\Context; class CommentsAppContext implements Context, ActorAwareInterface { use ActorAware; + /** + * @return Locator + */ + public static function newCommentField() { + return Locator::forThe()->css("div.newCommentRow .message")-> + descendantOf(FilesAppContext::currentSectionDetailsView())-> + describedAs("New comment field in current section details view in Files app"); + } + + /** + * @return Locator + */ + public static function submitNewCommentButton() { + return Locator::forThe()->css("div.newCommentRow .submit")-> + descendantOf(FilesAppContext::currentSectionDetailsView())-> + describedAs("Submit new comment button in current section details view in Files app"); + } + + /** + * @return Locator + */ + public static function commentFields() { + return Locator::forThe()->css(".comments .comment .message")-> + descendantOf(FilesAppContext::currentSectionDetailsView())-> + describedAs("Comment fields in current section details view in Files app"); + } /** * @When /^I create a new comment with "([^"]*)" as message$/ @@ -58,25 +84,4 @@ class CommentsAppContext implements Context, ActorAwareInterface { } return true; } - - /** - * @return Locator - */ - public static function newCommentField() { - return Locator::forThe()->css("div.newCommentRow .message")->descendantOf(FilesAppContext::currentSectionDetailsView())-> - describedAs("New comment field in the details view in Files app"); - } - - public static function commentFields() { - return Locator::forThe()->css(".comments .comment .message")->descendantOf(FilesAppContext::currentSectionDetailsView())-> - describedAs("Comment fields in the details view in Files app"); - } - - /** - * @return Locator - */ - public static function submitNewCommentButton() { - return Locator::forThe()->css("div.newCommentRow .submit")->descendantOf(FilesAppContext::currentSectionDetailsView())-> - describedAs("Submit new comment button in the details view in Files app"); - } } |