Skip to content

Instantly share code, notes, and snippets.

@dmonllao
Last active December 29, 2015 23:59
Show Gist options
  • Save dmonllao/7746252 to your computer and use it in GitHub Desktop.
Save dmonllao/7746252 to your computer and use it in GitHub Desktop.
Behat cross-browser config excluding non-supported tags
// Remember to move the @_only_local tag to the non-local servers.
// Set servers IPs.
$linuxip = '127.0.0.1';
$windowsip = '192.168.xxx.xxx';
$osxip = '192.168.xxx.xxx';
$CFG->behat_config = array(
'phantomjs-linux' => array(
'filters' => array(
'tags' => '~@_switch_window&&~@_only_local&&@javascript'
),
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'wd_host' => 'http://' . $linuxip . ':4444/wd/hub'
)
)
)
),
'chrome-linux' => array(
'filters' => array(
'tags' => '~@_switch_window&&@javascript'
),
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'browser' => 'chrome',
'wd_host' => 'http://' . $linuxip . ':4444/wd/hub'
)
)
)
),
'chrome-osx' => array(
'filters' => array(
'tags' => '~@_switch_window&&~@_only_local&&@javascript'
),
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'browser' => 'chrome',
'wd_host' => 'http://' . $osxip . ':4444/wd/hub'
)
)
)
),
'chrome-win' => array(
'filters' => array(
'tags' => '~@_switch_window&&~@_only_local&&@javascript'
),
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'browser' => 'chrome',
'wd_host' => 'http://' . $windowsip . ':4444/wd/hub'
)
)
)
),
'firefox-linux' => array(
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'browser' => 'firefox',
'wd_host' => 'http://' . $linuxip . ':4444/wd/hub'
)
)
)
),
'firefox-osx' => array(
'filters' => array(
'tags' => '~@_only_local&&@javascript'
),
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'browser' => 'firefox',
'wd_host' => 'http://' . $osxip . ':4444/wd/hub'
)
)
)
),
'firefox-win' => array(
'filters' => array(
'tags' => '~@_only_local&&@javascript'
),
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'browser' => 'firefox',
'wd_host' => 'http://' . $windowsip . ':4444/wd/hub'
)
)
)
),
'safari-osx' => array(
'filters' => array(
'tags' => '~@_alerts&&~@_switch_window&&~@_only_local&&@javascript'
),
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'browser' => 'safari',
'wd_host' => 'http://' . $osxip . ':4444/wd/hub'
)
)
)
),
'ie-win' => array(
'filters' => array(
'tags' => '~@_switch_window&&~@_only_local&&@javascript'
),
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'selenium2' => array(
'browser' => 'iexplore',
'wd_host' => 'http://' . $windowsip . ':4444/wd/hub'
)
)
)
)
);
@stronk7
Copy link

stronk7 commented Dec 13, 2013

BTW, I run here firefox on macs without any exclusion. The conf above excludes @_only_local.

@stronk7
Copy link

stronk7 commented Dec 13, 2013

And chrome on macs only with "~@_switch_window"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment