/**
* {@inheritdoc}
+ *
+ * To use a webdriver based approach, please use DrupalSelenium2Driver::class.
+ * We will switch the default later.
*/
protected $minkDefaultDriverClass = PhantomJSDriver::class;
* {@inheritdoc}
*/
protected function initMink() {
- // Set up the template cache used by the PhantomJS mink driver.
- $path = $this->tempFilesDirectory . DIRECTORY_SEPARATOR . 'browsertestbase-templatecache';
- $this->minkDefaultDriverArgs = [
- 'http://127.0.0.1:8510',
- $path,
- ];
- if (!file_exists($path)) {
- mkdir($path);
+ if ($this->minkDefaultDriverClass === DrupalSelenium2Driver::class) {
+ $this->minkDefaultDriverArgs = ['chrome', NULL, 'http://localhost:4444/'];
+ }
+ elseif ($this->minkDefaultDriverClass === PhantomJSDriver::class) {
+ // Set up the template cache used by the PhantomJS mink driver.
+ $path = $this->tempFilesDirectory . DIRECTORY_SEPARATOR . 'browsertestbase-templatecache';
+ $this->minkDefaultDriverArgs = [
+ 'http://127.0.0.1:8510',
+ $path,
+ ];
+ if (!file_exists($path)) {
+ mkdir($path);
+ }
}
try {
parent::tearDown();
}
+ /**
+ * {@inheritdoc}
+ */
+ protected function getMinkDriverArgs() {
+ if ($this->minkDefaultDriverClass === DrupalSelenium2Driver::class) {
+ return getenv('MINK_DRIVER_ARGS_WEBDRIVER') ?: getenv('MINK_DRIVER_ARGS_PHANTOMJS') ?: parent::getMinkDriverArgs();
+ }
+ elseif ($this->minkDefaultDriverClass === PhantomJSDriver::class) {
+ return getenv('MINK_DRIVER_ARGS_PHANTOMJS') ?: parent::getMinkDriverArgs();
+ }
+ return parent::getMinkDriverArgs();
+ }
+
/**
* Asserts that the element with the given CSS selector is visible.
*
return $this->getSession()->evaluateScript($script) ?: [];
}
+ /**
+ * {@inheritdoc}
+ */
+ protected function getHtmlOutputHeaders() {
+ // The webdriver API does not support fetching headers.
+ return '';
+ }
+
}