Karate Can';无法启用@ignore功能的注释
空手道为特征添加了@ignore注释 我试图@ignore annotation,但它未启用,并且该功能正在运行。Karate Can';无法启用@ignore功能的注释,karate,Karate,空手道为特征添加了@ignore注释 我试图@ignore annotation,但它未启用,并且该功能正在运行。 (使用空手道0.9.2) 我如何使用@ignore注释进行功能 @ignore Feature: API test Background: * url 'http://localhost:8089' Scenario: Get all rentacycles Given path '/rentacycles' When method get Then
(使用空手道0.9.2) 我如何使用@ignore注释进行功能
@ignore
Feature: API test
Background:
* url 'http://localhost:8089'
Scenario: Get all rentacycles
Given path '/rentacycles'
When method get
Then status 200
And assert response.size() === 5
没有“特殊”注释(实际上只有一个)
因此,您可以自由使用注释的任何名称
重要的是,当您运行测试时,您必须提到要使用哪个注释。请参阅文档:
也许这个例子会很清楚:
要使用标记运行测试,请执行以下操作:
mvn test -Dkarate.options="--tags @smoke"
你要求的是不要跑:
mvn test -Dkarate.options="--tags ~@smoke"
通常,这是在JUnit runner上设置的,如:
>没有“特殊”注释(实际上只有一个@parallel=false),这是真的吗?我不知道。我也尝试使用@KarateOptions,但它不能启用。有什么问题吗?@takanorig我试过你的代码,我认为它工作正常。如果在功能
#@ignore
中注释掉,它将开始运行。另外,只需将此添加到ExamplesTest
中,您的构建就会变成绿色:@KarateOptions(tags=“~@ignore”)
谢谢您的建议。它能够启用“忽略注释”。@takanorig太棒了!
@KarateOptions(tags = "~@ignore")