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:33:07 +08:00 committed by David Monllao
parent 8dccd20f76
commit c2df9b3b90
2 changed files with 3 additions and 2 deletions

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%]

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());