mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
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:
parent
8dccd20f76
commit
c2df9b3b90
@ -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%]
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user