我有一个奇怪的问题,我无法用命令行提供的标记覆盖runner中的标记。
跑步者class:-
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {"pretty",
"timeline:target/cucumber-timeline/",
"json:target/cucumber-report/cucumber.json",
"junit:target/cucumber-report/report-xml.xml"},
dryRun = false,
useFileNameCompatibleName = true,
stepNotifications = true,
strict = true,
features = "src/test/resources/features",
snippets = CucumberOptions.SnippetType.CAMELCASE,
glue = {"com.Novatel"},
tags = {"@smoke"})
public class RunCucumberIT {
}
示例功能file:-
@sampleTest
Feature: Testing the website navigation
Scenario: Navigate to the the site1
Given I click on the URL
Then I navigate to the site
@smoke
Scenario: Navigate to bbc1
Given I navigate to the url
Then I am able to view the news
我设置了下面的sys属性run:-
mvn clean verify -DCucumber.filter.tags="@sampleTest"
但它只是忽略了上面的标签来运行特性,并使用@smoke tag运行第二个场景,但这不是我想要的,因为我需要从命令行使用自己的标签来运行特性。我知道这是可能的,但我不知道为什么它不起作用。我在谷歌上搜索了好几个小时,运气都不好。我使用cucumber5.0.0和junit4.12。
任何帮助都将不胜感激。谢谢
暂无答案!
目前还没有任何答案,快来回答吧!