在Cucumber Feature文件中,我有一个名为Scenario_2的场景,标签为:@tag1@tag2@tag3。
在Runner类中,我使用tags=“@tag2和@tag3”。
事实上,Feature文件中没有匹配的标签,但它打印了Scenario_2中的所有行`
这怎么可能?。
@tag1 @tag2 @tag3
Scenario: Scenario_2
Given This is the first step in Second Scenario
When This is the second step in Second Scenario
Then This is the third step in Second Scenario
@RunWith(Cucumber.class)
@CucumberOptions(features = {"src/test/resources/features/cucumbertags_26.feature"},
glue = {"com.stepdefinitions"},
tags = "@tag2 and @tag3",
monochrome = true)
public class TestRunner_SamplePage
{
}
Output:
-------
^This is the first step in Second Scenario$
^This is the second step in Second Scenario$
^This is the third step in Second Scenario$