无法启用@ignore注释功能 [英] Can't be enable to @ignore annotation for the features

查看:96
本文介绍了无法启用@ignore注释功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

空手道具有@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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆