I want to run a scenario in multiple browsers by tagging it with the desired browser(s).
For example:
Feature: Smoke Test
@Chrome @Firefox
Scenario: the site should launch in all browsers
Given the site is online
When I navigate to site
Then the site should display in all browsers
I am currently able to run tests on one browser at a time with:
Feature: Smoke Test
@Chrome
Scenario: the site should launch in all browsers
Given the site is online
When I navigate to site
Then the site should display in all browsers
@Firefox
Scenario: the site should launch in all browsers
Given the site is online
When I navigate to site
Then the site should display in all browsers
How can this be implemented? Or, if it cannot, why?
If you use JUnit to run your scenarios you can use
@CucumberOptions
to specify which tags to execute, and use separate test classes for the two tags:Launching of the browser should be possible with scenario hooks, which can also specify to which tags they apply: