4 * This file is part of the Behat MinkExtension.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\MinkExtension\ServiceContainer\Driver;
13 use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
15 class BrowserStackFactory extends Selenium2Factory
20 public function getDriverName()
22 return 'browser_stack';
28 public function configure(ArrayNodeDefinition $builder)
32 ->scalarNode('username')->defaultValue(getenv('BROWSERSTACK_USERNAME'))->end()
33 ->scalarNode('access_key')->defaultValue(getenv('BROWSERSTACK_ACCESS_KEY'))->end()
34 ->scalarNode('browser')->defaultValue('firefox')->end()
35 ->append($this->getCapabilitiesNode())
43 public function buildDriver(array $config)
45 $config['wd_host'] = sprintf('%s:%s@hub.browserstack.com/wd/hub', $config['username'], $config['access_key']);
47 return parent::buildDriver($config);
50 protected function getCapabilitiesNode()
52 $node = parent::getCapabilitiesNode();
56 ->scalarNode('project')->end()
57 ->scalarNode('resolution')->end()
58 ->scalarNode('build')->info('will be set automatically based on the TRAVIS_JOB_NUMBER environment variable if available')->end()
59 ->scalarNode('os')->end()
60 ->scalarNode('os_version')->end()
61 ->scalarNode('device')->end()
62 ->booleanNode('browserstack-debug')->end()
63 ->booleanNode('browserstack-tunnel')->end()
64 ->booleanNode('emulator')->end()