mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-38787 behat: Move to the new Javascript-based test class manager
This commit is contained in:
parent
373a8e052c
commit
eff79d5378
@ -104,7 +104,7 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
|
||||
$exceptionlocator = $locator[1];
|
||||
|
||||
// If we are in a @javascript session all contents would be displayed as HTML characters.
|
||||
if (get_class($this->getSession()->getDriver()) === 'Behat\Mink\Driver\Selenium2Driver') {
|
||||
if ($this->running_javascript()) {
|
||||
$locator[1] = html_entity_decode($locator[1], ENT_NOQUOTES);
|
||||
}
|
||||
|
||||
@ -405,4 +405,13 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
|
||||
return $this->transform_selector($selectortype, $element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the scenario is running in a browser that can run Javascript or not.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected function running_javascript() {
|
||||
return get_class($this->getSession()->getDriver()) === 'Moodle\BehatExtension\Driver\MoodleSelenium2Driver';
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user