From 7cc79d06cdde556ec96c811fc7b4563f87cdff5e Mon Sep 17 00:00:00 2001 From: Sergii Bondarenko Date: Wed, 10 Feb 2016 18:46:21 +0200 Subject: [PATCH] Added selectors translations --- src/Context/RawPageContext.php | 1 + src/Context/TqContext.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/Context/RawPageContext.php b/src/Context/RawPageContext.php index e25185a..0d896eb 100644 --- a/src/Context/RawPageContext.php +++ b/src/Context/RawPageContext.php @@ -188,6 +188,7 @@ public function element($locator, $selector) throw new \RuntimeException(sprintf('Locator "%s" was not specified.')); } + $selector = t($selector); $element = $this->{'find' . $map[$locator]}($selector); $this->throwNoSuchElementException($selector, $element); diff --git a/src/Context/TqContext.php b/src/Context/TqContext.php index 3db114d..b3e910d 100644 --- a/src/Context/TqContext.php +++ b/src/Context/TqContext.php @@ -221,6 +221,8 @@ public function beforeScenario(BehatScope\BeforeScenarioScope $scope) { self::collectTags($scope->getScenario()->getTags()); + // No need to keep working element between scenarios. + $this->unsetWorkingElement(); // Any page should be visited due to using jQuery and checking the cookies. $this->visitPath('/'); // By "Goutte" session we need to visit any page to be able to set a cookie