Currently I use the parallel profile in cucumber.yml to load an environment specific file and hooks.rb to set the browser. I run my tests using 'parallel_cucumber features'. There is not much in my hooks.rb file:
Before do
@browser = Watir::Browser.new :firefox
end
After do
@browser.close
end
The profile looks like this:
parallel: FIG_NEWTON_FILE=local.yml --no-source --color --format pretty
Is there a way to change my hooks.rb file so that all features run against a set of browsers (firefox, chrome, safari)? Is possible to pass the file name or environment through the command line?
You can definitely pass the environment name through the command line. Check out my env.rb file:
Now when I run cucumber, I call the environment by doing: