From f6737e43e90b6fc56bd4ccce2f872eed0a1af3e4 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Thu, 15 Feb 2018 16:34:48 +0100 Subject: Move locators above step definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../features/bootstrap/CommentsAppContext.php | 47 ++++++++++++---------- 1 file 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"); - } } -- cgit v1.2.3