From 09d94f32335eeff4084d3170e003a08ae8c1f22e Mon Sep 17 00:00:00 2001 From: Emmet O'Grady Date: Tue, 1 Sep 2020 16:03:10 +0100 Subject: [PATCH 1/2] Allow setting browserstack.local --- .../ServiceContainer/Driver/BrowserStackFactory.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php index 66aa3fa7..4314cca6 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php @@ -1,5 +1,4 @@ @@ -7,7 +6,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace Behat\MinkExtension\ServiceContainer\Driver; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; @@ -21,7 +19,6 @@ public function getDriverName() { return 'browser_stack'; } - /** * {@inheritdoc} */ @@ -36,7 +33,6 @@ public function configure(ArrayNodeDefinition $builder) ->end() ; } - /** * {@inheritdoc} */ @@ -44,13 +40,15 @@ public function buildDriver(array $config) { $config['wd_host'] = sprintf('%s:%s@hub.browserstack.com/wd/hub', $config['username'], $config['access_key']); + if ($config['capabilities']['browserstack-local']) { + $config['capabilities']['extra_capabilities']['browserstack.local'] = true; + } + return parent::buildDriver($config); } - protected function getCapabilitiesNode() { $node = parent::getCapabilitiesNode(); - $node ->children() ->scalarNode('project')->end() @@ -60,6 +58,7 @@ protected function getCapabilitiesNode() ->scalarNode('os_version')->end() ->scalarNode('device')->end() ->booleanNode('browserstack-debug')->end() + ->booleanNode('browserstack-local')->end() ->booleanNode('browserstack-tunnel')->end() ->booleanNode('emulator')->end() ->booleanNode('acceptSslCert')->end() From 0691ae1af6748fd1258eab4355700a9220a34cec Mon Sep 17 00:00:00 2001 From: Emmet O'Grady Date: Tue, 1 Sep 2020 16:06:11 +0100 Subject: [PATCH 2/2] Revert spacing --- .../ServiceContainer/Driver/BrowserStackFactory.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php b/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php index 4314cca6..e892a12d 100644 --- a/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php +++ b/src/Behat/MinkExtension/ServiceContainer/Driver/BrowserStackFactory.php @@ -1,4 +1,5 @@ @@ -6,6 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Behat\MinkExtension\ServiceContainer\Driver; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; @@ -19,6 +21,7 @@ public function getDriverName() { return 'browser_stack'; } + /** * {@inheritdoc} */ @@ -33,6 +36,7 @@ public function configure(ArrayNodeDefinition $builder) ->end() ; } + /** * {@inheritdoc} */ @@ -46,9 +50,11 @@ public function buildDriver(array $config) return parent::buildDriver($config); } + protected function getCapabilitiesNode() { $node = parent::getCapabilitiesNode(); + $node ->children() ->scalarNode('project')->end()