MDL-39489 behat: Updating to 2.6 moodlehq/behat-extension tag

Also solving new problem after Behat
2.5 upgrade.
This commit is contained in:
David Monllao
2013-10-15 15:09:04 +08:00
parent f8eff10319
commit 89cf999a8d
3 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -8,6 +8,6 @@
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/dbUnit": "1.2.*",
"moodlehq/behat-extension": "1.25.6"
"moodlehq/behat-extension": "1.26.*"
}
}
+6 -3
View File
@@ -32,6 +32,7 @@ require_once(__DIR__ . '/../../behat/behat_base.php');
use Behat\Behat\Event\SuiteEvent as SuiteEvent,
Behat\Behat\Event\ScenarioEvent as ScenarioEvent,
Behat\Behat\Event\StepEvent as StepEvent,
Behat\Mink\Exception\DriverException as DriverException,
WebDriver\Exception\NoSuchWindow as NoSuchWindow,
WebDriver\Exception\UnexpectedAlertOpen as UnexpectedAlertOpen,
WebDriver\Exception\UnknownError as UnknownError,
@@ -143,14 +144,16 @@ class behat_hooks extends behat_base {
throw new coding_exception('Behat only can modify the test database and the test dataroot!');
}
$moreinfo = 'More info in ' . behat_command::DOCS_URL . '#Running_tests';
$driverexceptionmsg = 'Selenium server is not running, you need to start it to run tests that involve Javascript. ' . $moreinfo;
try {
$session = $this->getSession();
} catch (CurlExec $e) {
// Exception thrown by WebDriver, so only @javascript tests will be caugth; in
// behat_util::is_server_running() we already checked that the server is running.
$moreinfo = 'More info in ' . behat_command::DOCS_URL . '#Running_tests';
$msg = 'Selenium server is not running, you need to start it to run tests that involve Javascript. ' . $moreinfo;
throw new Exception($msg);
throw new Exception($driverexceptionmsg);
} catch (DriverException $e) {
throw new Exception($driverexceptionmsg);
} catch (UnknownError $e) {
// Generic 'I have no idea' Selenium error. Custom exception to provide more feedback about possible solutions.
$this->throw_unknown_exception($e);
@@ -56,6 +56,9 @@ class behat_transformations extends behat_base {
* @return string The string with the arguments fixed.
*/
public function arg_replace_slashes($string) {
if (!is_scalar($string)) {
return $string;
}
return str_replace('\"', '"', $string);
}
@@ -67,6 +70,9 @@ class behat_transformations extends behat_base {
* @return string
*/
public function arg_replace_nasty_strings($argument) {
if (!is_scalar($argument)) {
return $argument;
}
return $this->replace_nasty_strings($argument);
}