Run cucumber test suite multiple times

1,650 views
Skip to first unread message

gee...@gmail.com

unread,
Apr 3, 2017, 11:04:48 AM4/3/17
to Cukes
Hi,

Just wondering if any of you have any in put regarding this problem or any potential solutions to it.

I have a cucumber test suite, to test input vs output files.

Context:
Input = XML
Output = PDF/PostScript/Txt/Html etc.

I use different libraries to validate the content of the files.

The problem:
Say I want to run my entire cucumber test suite multiple times for as many input files I have, now the tricky part is - this is not certain and can change.

E.g. I sometimes have 11 input XMLs, sometimes 50 input XMLs, sometimes more/less etc. so essentially my cucumber test suite will need to run 11, 50, or whatever times.

Solution 1:
Write a shell script or something to loop through a directory to see how many XML input files are, then call mvn test X amount of times.

Solution 2:
Create a class that will loop through directory to see how many XML input files are, then generate that many Runner.java class files, and then the maven failsafe plugin will run ALL those runner classes(This sounds quite messy, if I have 100 input files, then essentially I will have 100 runner classes to run my cucumber test suties)

Solution 3:
Have every scenario as a Scenario Outline, but this ONLY works if we know how many different input files we have, which we don't necessarily know. 

Solution 4:
Some how run my cucumber runner class similarly to how the JUnit Parameterized tests works or TestNG DataProvider works, it will run my tests for the amount of times I can specify using the DataProvider etc. I can't and don't see anything similar to this being implemented or exists currently.

Any input is much appreciated.

Regards,
Matt 



Andrew Premdas

unread,
Apr 3, 2017, 11:09:37 AM4/3/17
to cu...@googlegroups.com
Solution 1 is best.

Let Cucumber does what it does, rather than trying to hack it to do things it doesn't want to do.

Definitely do not use Scenario Outlines.

But before you do solution 1 be sure you have a really clear understanding of why you need to run the suite so many times. If you only need to do this occasionally and runtime is not a real issue then thats fine. If this running multiple times delays development in any way, then thats not so good.

All best

Andrew

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
------------------------
Andrew Premdas
Reply all
Reply to author
Forward
0 new messages