Cucumber examples reuse in different features/scenarios

I've been using cucumber for awhile and I've stumbled upon a problem:

Actual question:

Is there a solution to import the examples from a single file/db using cucumber specifically as examples? Or alternatively is there a way to define a variable while already in-step to be an example? Or alternatively again, is there an option to send the examples as variables when I launch the feature file/scenario?

The Problem:

I have a couple of scenarios where I would like to use exactly the same examples, over and over again.

It sounds rather easy, but the examples table is very large (more specifically it contains all the countries in the world and their appropriate continents). Thus repeating it would be very troublesome, especially if the table needs changing (I will need to change all the instances of the table separately)

Complication:

I have a rerun function that knows when a specific example failed and reruns it after the test is done.

Restrictions:

I do not want to edit my rerun file

Related:

I've noticed that there is already an open discussion about importing it from csv here: Importing CSV as test data in Cucumber?

However that discussion is invalid to me because I have the rerun function that only knows to work only with examples, and the solution suggested there ruins that.

Thank you!

链接地址: http://www.djcxy.com/p/82612.html

上一篇: 在黄瓜功能文件中只执行@Given一次

下一篇: 黄瓜示例在不同的功能/场景中重用