假设,我在 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 中做到这一点?