I am trying to configure my acceptance.suite.yml in Codeception to allow me to run the test in various browsers on Browser Stack.
class_name: WebGuy
modules:
enabled:
- WebDriver
config:
WebDriver:
url: 'http://www.heyday.co.nz'
host: 'hub.browserstack.com'
port: 80
browsers: firefox
capabilities:
How would I add say, IE8 and Safari for example? Your help appreciated.
Use Environments.
That chapter describes your use case, but I will copy some details to avoid giving a link only answer.
For cases where you need to run tests with different configurations you can define different config environments.
acceptance.suite.yml
class_name: AcceptanceTester
modules:
enabled:
- WebDriver
- \Helper\Acceptance
config:
WebDriver:
url: 'http://127.0.0.1:8000/'
browser: 'firefox'
env:
phantom:
modules:
config:
WebDriver:
browser: 'phantomjs'
chrome:
modules:
config:
WebDriver:
browser: 'chrome'
firefox:
# nothing changed
You can easily switch between those configs by running tests with --env option. To run tests only for PhantomJS you need to pass --env phantom option:
php codecept.phar run acceptance --env phantom
To run tests in all 3 browsers, just list all the environments:
php codecept.phar run acceptance --env phantom --env chrome --env firefox
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With