Cucumber 当存在一个通用的“CUMBURE”时,如何组织CUMBURE特征文件;那么“什么?”;?

Cucumber 当存在一个通用的“CUMBURE”时,如何组织CUMBURE特征文件;那么“什么?”;?,cucumber,scenarios,Cucumber,Scenarios,我的功能文件中有以下两种情况: @system-A @updating-dob Scenario: Updating customers dob Given an account from system A When I save the dob Then I should see the dob is updated successfully @system-B @updating-dob Scenario: Updating customers dob Given an a

我的功能文件中有以下两种情况:

@system-A @updating-dob
Scenario: Updating customers dob
  Given an account from system A
  When I save the dob
  Then I should see the dob is updated successfully

@system-B @updating-dob
Scenario: Updating customers dob
  Given an account from system B
  When I save the dob
  Then I should see the dob is updated successfully
正如您所见,我在同一个文件中有两个场景,但只有给定的
不同。有没有一种方法可以使用场景大纲将这两个场景结合起来

顺便说一句,步骤定义为

  Given an account from system A
  Given an account from system B

是10行代码。

是的,您可以使用场景大纲:

@updating-dob
Scenario Outline: Updating customer's dob
  Given an account from system <system>
  When I save the dob
  Then I should see the dob is updated successfully

Examples:
  | system |
  | A |
  | B |
@更新dob
场景概述:更新客户的dob
从系统中给出一个帐户
当我保存dob时
然后我会看到dob已成功更新
示例:
|系统|
|A|
|B|

但是,在测试系统A的示例中不能有@system-A,在测试系统B的示例中不能有@system-B。

这非常有效!谢谢我只是不喜欢我所有的测试都有:
示例:|系统| A | B |
我也没有。不幸的是Cucumber绝对不支持重用示例。