【发布时间】:2020-11-23 19:53:39
【问题描述】:
假设,我在 1 个功能文件下有许多场景 - GamePlay.feature。
Feature: Game play
@TestCase_1 @Regression
Scenario: Breaker joins a game
Given the Maker has started a game with the word "silky"
When the Breaker joins the Maker's game
Then the Breaker must guess a word with 5 characters
@TestCase_2 @Regression
Scenario: Breaker joins a game
Given the Maker has started a game with the word "soft"
When the Breaker joins the Maker's game
Then the Breaker must guess a word with 4 characters
.
.
. and many more
假设我想复制测试用例 #2(Scenario、Given、When、Then)的测试步骤并将它们粘贴到新的功能文件中(GameLost.feature)。 我将根据标签搜索场景(例如 -@TestCase_2) 新的功能文件 GameLost.feature 应该看起来像 -
Feature: Game lost
@TestCase_2 @Regression
Scenario: Breaker joins a game
Given the Maker has started a game with the word "soft"
When the Breaker joins the Maker's game
Then the Breaker must guess a word with 4 characters
我如何在 Java 中做到这一点?
【问题讨论】:
-
有什么建议吗?
标签: java parsing cucumber gherkin feature-file