Hello,
I wanted to know whether we can use tags/annotations to group scenarios in a feature. Also, can we pass these tags/annotations as parameters when executing the project through a command prompt or Jenkins?
Regards,
Shreyas
Hello,
I wanted to know whether we can use tags/annotations to group scenarios in a feature. Also, can we pass these tags/annotations as parameters when executing the project through a command prompt or Jenkins?
Regards,
Shreyas
A) Yes, we can use tags/annotations to group scenarios in a feature. It is gherkin syntax only so you can group feature file / scenarios as well.
Example:
@ModuleA
Feature: View Order
As Analyst user
I want to view existing Order available within the system
So that I can take corrective action
Background:
Given user is logged into Order application
@smoke
Scenario: View Order List
Given user is able to access the Order module
When user has clicked on Order menu
Then user should be able to view Order
B) Since Katalon is not maven based project, I don’t think we can use options like,
mvn test -Dcucumber.options= <Specify feature file OR Tags, etc>
The only handy way I can figure out is -
1. Create multiple runners as per your project need
2. Use runners into multiple tests.
something similar -
CucumberKW.runWithCucumberRunner(MyCucumberSmokeRunner.class)
CucumberKW.runWithCucumberRunner(MyCucumberModuleARunner.class)
CucumberKW.runWithCucumberRunner(MyCucumberModuleBRunner.class)
3. Then generate Command
katalon -noSplash -runMode=console -consoleLog -projectPath=“automation.prj” -retry=0 -testSuitePath=“Test Suites/TestSuitesRunBDDTests” -executionProfile=“default” -browserType=“Firefox”
Where,
TestSuitesRunBDDTests = test cases which has runner attached.
Hope this helps!
Any of the devs (@devalex88 @ThanhTo) have input on this? Projects with many different tags would benefit from this greatly.