通过空手道示例表的行号过滤方案大纲

时间:2019-11-15 12:47:14

标签: cucumber karate

是否可以通过空手道中的行号过滤表格?

 Scenario Outline: name is <name> and age is <age>
  * def temp = '<name>'
  * match temp == name
  * match temp == __row.name

  Examples:
    | name | age |
    | Bob  | 5   |
    | Nyan | 6   |

@CucumberOptions(features = "src/test/resources/feature/scenarios.feature:2")

上面的命令应该只运行提到的表的第二行

1 个答案:

答案 0 :(得分:1)

是的,它适用于0.9.5.RC4

@RunWith(Karate.class)
@KarateOptions(features = "classpath:com/myco/test.feature:9")
public class TestRunner {        

}

====

Feature:

Scenario Outline:
* print x

Examples:
| x |
| 1 |
| 2 |