當我執行某個條件時,我需要獲取將要運行的所有場景和標簽的串列。例如當我運行命令時
mvn clean test -Dcucumber.filter.tags='@Regression and @login
執行來自不同功能的測驗用例串列,但要獲得該串列,我必須等待套件的執行完全完成。
我想知道是否有任何方法可以在執行開始之前或至少在開始時獲取該串列。目前我是手動做的,但是需要很長時間,因為有很多測驗用例
如果您有任何關于黃瓜或 Maven 的資訊,我將不勝感激。
uj5u.com熱心網友回復:
在您的CucumberOptions中,您可以使用dryRun = true. 它列印將要執行的場景串列。記住dryRun目的是不同的,但你可以在你的情況下使用它。
CucumberOptions
@CucumberOptions(features = "src\\test\\resources\\features", glue = { "cucumberStep" }, dryRun = true, plugin = {
"pretty", "html:report/TestReport.html" }, monochrome = true, stepNotifications = true, tags = "@Test4 and @Test")
輸出:
@Regression @Test
Scenario Outline: decision # src/test/resources/features/xPeriment.feature:26
When I populate the "Decision Title" field with "testinput "user1" titlepart2" # cucumberStep.stepDef.populate(java.lang.String,java.lang.String)
@Regression @Test
Scenario Outline: decision # src/test/resources/features/xPeriment.feature:27
When I populate the "Decision Title" field with "testinput "user1" titlepart2" # cucumberStep.stepDef.populate(java.lang.String,java.lang.String)
@Regression @Test
Scenario Outline: decision # src/test/resources/features/xPeriment.feature:28
When I populate the "Decision Title" field with "testinput "user1" titlepart2" # cucumberStep.stepDef.populate(java.lang.String,java.lang.String)
@All @Test4
Scenario: Verify the content of the pdf file_1. # src/test/resources/features/xPeriment2.feature:20
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/507969.html
