Skip to content
Snippets Groups Projects
Commit 33368a52 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2894501 by cspitzlay, dawehner, zaporylie, larowlan, alexpott, hchonov,...

Issue #2894501 by cspitzlay, dawehner, zaporylie, larowlan, alexpott, hchonov, Lendude: Allow for separate mink driver settings for Javascript tests
parent 3cf53f5f
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,8 @@
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/>
<!-- To disable deprecation testing uncomment the next line. -->
<!-- <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/> -->
<!-- Example for changing the driver args to mink tests MINK_DRIVER_ARGS value: '["http://127.0.0.1:8510"]' -->
<!-- Example for changing the driver args to phantomjs tests MINK_DRIVER_ARGS_PHANTOMJS value: '["http://127.0.0.1:8510"]' -->
</php>
<testsuites>
<testsuite name="unit">
......
......@@ -63,6 +63,13 @@ protected function tearDown() {
parent::tearDown();
}
/**
* {@inheritdoc}
*/
protected function getMinkDriverArgs() {
return getenv('MINK_DRIVER_ARGS_PHANTOMJS') ?: parent::getMinkDriverArgs();
}
/**
* Asserts that the element with the given CSS selector is visible.
*
......
......@@ -344,12 +344,12 @@ protected function initMink() {
* When provided default Mink driver class can't be instantiated.
*/
protected function getDefaultDriverInstance() {
// Get default driver params from environment if availables.
if ($arg_json = getenv('MINK_DRIVER_ARGS')) {
// Get default driver params from environment if available.
if ($arg_json = $this->getMinkDriverArgs()) {
$this->minkDefaultDriverArgs = json_decode($arg_json, TRUE);
}
// Get and check default driver class from environment if availables.
// Get and check default driver class from environment if available.
if ($minkDriverClass = getenv('MINK_DRIVER_CLASS')) {
if (class_exists($minkDriverClass)) {
$this->minkDefaultDriverClass = $minkDriverClass;
......@@ -394,6 +394,18 @@ protected function initBrowserOutputFile() {
}
}
/**
* Get the Mink driver args from an environment variable, if it is set. Can
* be overridden in a derived class so it is possible to use a different
* value for a subset of tests, e.g. the JavaScript tests.
*
* @return string|false
* The JSON-encoded argument string. False if it is not set.
*/
protected function getMinkDriverArgs() {
return getenv('MINK_DRIVER_ARGS');
}
/**
* Provides a Guzzle middleware handler to log every response received.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment