Cucumber: How do I use multiple script scripts with one example?

Scenario Outline:
   blah blah

Scenarios:
 | col | col |
 | dat | dat |

Scenario Outline
  blah blah
  <use first scenarios table>

      

is this a way to do it? I would not like to copy the table ... = \

0


source to share


1 answer


The data you use shouldn't be script dependent, so it doesn't really matter if you copy / paste data from one script to another. I know this is not DRY - so if you are copying data more than a couple of times, consider Factory instead (see # 2).

That being said, there are several things you can ask / questions:



  • If blah blah

    implemented as a step definition then it is assumed that you will reuse it as needed, which is partly for it
  • Col / dat table can be changed to Factory (via FactoryGirl). It is quite common to use FactoryGirl as part of your testing, along with Cucumber.
0


source







All Articles