无法启用@ignore注释功能 [英] Can't be enable to @ignore annotation for the features
问题描述
空手道具有@ignore功能注释.
Karate has @ignore annotation for the features.
https://github.com/intuit/karate#data-driven-features
我尝试@ignore批注,但未启用,并且该功能运行.
(使用空手道0.9.2)
I try to @ignore annotation, but it is not enable and the feature runs.
(use karate 0.9.2)
如何使用@ignore注释功能?
How can I use @ignore annotation for the features?
@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
推荐答案
There is no "special" annotation (actually there is just one which is @parallel=false
)
因此您可以自由使用任何名称作为注释.
So you can freely use any name for the annotation.
重要的是在运行测试时,必须提及要使用的哪个批注.请参阅文档: https://github.com/intuit/karate#tags
What is important is when you run your tests, you have to mention which annotation to use. See the documentation: https://github.com/intuit/karate#tags
也许这个例子很清楚: first.feature
Maybe this example will be clear: first.feature
要运行带有标签的测试:
To run tests with a tag:
mvn test -Dkarate.options="--tags @smoke"
您要问的是不要运行:
mvn test -Dkarate.options="--tags ~@smoke"
通常,这是在JUnit运行器上设置的,例如此示例:
Normally this is set on the JUnit runner like this example:
@KarateOptions(tags = "~@ignore")
这篇关于无法启用@ignore注释功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!