MDL-38787 behat: Move to the new Javascript-based test class manager

This commit is contained in:
David Monllao 2013-03-28 16:59:18 +08:00
parent 373a8e052c
commit eff79d5378

View File

@ -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';
}
}