如何用jar文件指定单个方案? [英] How to specify a single scenario with jar file?
问题描述
我正在尝试按照这篇文章来运行特定的场景,而在运行展位时却无法做到这一点独立版本(v0.9.1).
I am trying to follow this post to run a specific scenario and I am failing at doing this when running the stand-alone version (v0.9.1).
我的实验:
(1)
java -Dkarate.options="--name ^bla$" -jar karate.jar features/many.feature
它从功能文件运行所有方案.
It runs all scenarios from the feature file.
(2)
java -Dkarate.options="classpath:features/many.feature --name ^bla$" -jar karate.jar
在不执行测试用例的情况下启动UI.
starts the UI without executing a test case.
我在这里想念什么?
推荐答案
使用tags
将是一种方便的方法
using tags
will be a convenient way for this
在每种情况之前添加一个不同的标签,并在使用空手道独立呼叫时通过-t
传递标签名称
add a different tag before each scenario and pass the tag name with -t
while calling with karate standalone
许多功能
Feature: Many scenario
@s1
Scenario: SOne
* print 'first scenario'
@s2
Scenario: Stwo
* print 'second scenario'
现在通过脚本标签
java -jar karate.jar many.feature -t @s1
这篇关于如何用jar文件指定单个方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!