有没有办法多次运行相同的黄瓜特征文件?

问题描述 投票:0回答:1

我有一些文件要上传。为此,我编写了一个方案。我需要多次运行相同的功能文件。如何多次运行功能文件?

cucumber cucumber-java cucumber-junit
1个回答
0
投票

不是使用多个功能文件,而是使用场景大纲,它将根据您提供给它的示例表多次执行同一场景

示例:

Scenario Outline: Create ABC

  Given I open the application

  When I enter username as <username>

  And I enter password as <password>

  Then I enter title as <title>

  And press submit


Examples:

| username | password | title |

| Rob      | xyz1      | title1 |

| Bob      | xyz1      | title2 |

因此,同一示例场景将运行2次,因为示例表有2个数据,您可以添加尽可能多的数据表,黄瓜将执行该次数]

© www.soinside.com 2019 - 2024. All rights reserved.