diff --git a/src/FacebookFactory.php b/src/FacebookFactory.php index d44c719d..1dac985b 100644 --- a/src/FacebookFactory.php +++ b/src/FacebookFactory.php @@ -11,6 +11,7 @@ namespace SilverStripe\MinkFacebookWebDriver; use Behat\MinkExtension\ServiceContainer\Driver\Selenium2Factory; +use Facebook\WebDriver\Remote\WebDriverBrowserType; use Symfony\Component\DependencyInjection\Definition; /** @@ -38,11 +39,13 @@ public function buildDriver(array $config) $extraCapabilities = $config['capabilities']['extra_capabilities']; unset($config['capabilities']['extra_capabilities']); - // PATCH: Disable W3C mode in chromedriver until we have capacity to actively adopt it - $extraCapabilities['chromeOptions'] = array_merge( - isset($extraCapabilities['chromeOptions']) ? $extraCapabilities['chromeOptions'] : [], - ['w3c' => false] - ); + if ($config['browser'] === WebDriverBrowserType::CHROME && (isset($extraCapabilities['chromeOptions']) === false || isset($extraCapabilities['chromeOptions']['w3c']) === false)) { + // PATCH: Disable W3C mode in chromedriver until we have capacity to actively adopt it + $extraCapabilities['chromeOptions'] = array_merge( + isset($extraCapabilities['chromeOptions']) ? $extraCapabilities['chromeOptions'] : [], + ['w3c' => false] + ); + } $capabilities = array_replace($this->guessCapabilities() ?? [], $extraCapabilities, $config['capabilities']); diff --git a/src/FacebookWebDriver.php b/src/FacebookWebDriver.php index b8b93180..bb7a1069 100755 --- a/src/FacebookWebDriver.php +++ b/src/FacebookWebDriver.php @@ -269,9 +269,6 @@ public static function getDefaultCapabilities() 'platform' => 'ANY', 'browser' => self::DEFAULT_BROWSER, 'name' => 'Behat Test', - 'deviceOrientation' => 'portrait', - 'deviceType' => 'tablet', - 'selenium-version' => '3.5.3' ]; }