MDL-52427 behat: Fixed question selectors

As class is changed, we need to convert selector
to check if class is contained, rather then checking
selecting with specific class.
This commit is contained in:
Rajesh Taneja
2015-12-22 10:43:18 +08:00
committed by David Monllao
parent ea78dbdf50
commit 6fccd1fe35
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ XPATH
XPATH
, 'question' => <<<XPATH
.//div[contains(concat(' ', normalize-space(@class), ' '), ' que ')]
[contains(div[@class='content']/div[@class='formulation'], %locator%)]
[contains(div[@class='content']/div[contains(concat(' ', normalize-space(@class), ' '), ' formulation ')], %locator%)]
XPATH
, 'region' => <<<XPATH
.//*[self::div | self::section | self::aside | self::header | self::footer][./@id = %locator%]
+2 -1
View File
@@ -76,7 +76,8 @@ class behat_question extends behat_question_base {
// Split in two checkings to give more feedback in case of exception.
$exception = new ElementNotFoundException($this->getSession(), 'Question "' . $questiondescription . '" ');
$questionxpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' que ')]" .
"[contains(div[@class='content']/div[@class='formulation'], {$questiondescriptionliteral})]";
"[contains(div[@class='content']/div[contains(concat(' ', normalize-space(@class), ' '), ' formulation ')]," .
"{$questiondescriptionliteral})]";
$this->find('xpath', $questionxpath, $exception);
$exception = new ExpectationException('Question "' . $questiondescription . '" state is not "' . $state . '"', $this->getSession());