简体   繁体   中英

how to give path of feature file in runner file

in src/test/featurefile, i have created two folder US-Portals and Canada-Portals, these two folders contains multiple feature files. how can i provide path in runner file for feature file for both portals?

features = { "src/test/featurefile/" }, 
plugin = { "pretty", "html:target/cucumber-html-report",
    "junit:target/cucumber-junit-report/allcukes.xml", "json:target/cucumber-report.json",
    "json:target/cucumber.json", "usage:target/cucumber-usage.json" },

tags = { "@SaveContract_US_BMW, @SaveContract_Canada_BMW" }

To execute all feature files in the folder src/test/featurefile ( include both US-Portals and Canada-Portals folders)

features={"src/test/featurefile"} 

To execute all feature files in the folder US-Portals

features =  { "src/test/featurefile/US-Portals"}

To execute all feature files in the folder Canada-Portals

features =  { "src/test/featurefile/Canada-Portals"}

To execute a single feature file in US-Portals folder (eg. sample1.feature)

features =  { "src/test/featurefile/US-Portals/sample1.feature"}

To execute a single feature file in US-Canada folder (eg. sample1.feature)

features =  { "src/test/featurefile/US-Canada/sample1.feature"}

No need to pass tags value if you want to execute all files. if you pass it, it will execute only the scenario/feature with that tag. All other scnenarios/features are skipped.

Note: Feature file name and tag names are case sensitive.

您可以像这样包含所有功能所在的路径:

features = {"classpath:demo_features"}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM