-
Notifications
You must be signed in to change notification settings - Fork 122
Conversation
Rerun functionality added
cucumber-junit-re-runner.vm template
ExtendedRuntimeOptions.java to run custom cucumber runner.
two properties are added to use template junit rerun <useJUnitReRun>true</useJUnitReRun> <retryCount>2</retryCount>
Two properties are added <useJUnitReRun>true</useJUnitReRun> <retryCount>2</retryCount>
@parameter(property = "retryCount",defaultValue= "0", required = true)
@temyers I agree with generic approach of Cucumber, if no tags provide then all tags runner should be generated. I have restricted this approach because of following reason. Suppose a Scenario or Scenario Outline is tagged with multiple tags If project has bunch of features with bunch of Scenarios and Scenario Outlines and each tagged with multiple tags and if we don't provide tags then duplicate runners will be generated and this is meaning less to keep running as well as re-running also. So i think it will be good if we restrict users from adding blank tags. This branch has compulsion of tags, user must pass tags either in pom file or override it while running from command line. |
@temyers Bingo ..! while thinking about support for generic approach i got solution, i was very near to skip those duplication, if i use Gherkin to parse all tags and select only one from multiple, i would be able to do what is recommended, Yes i did it, Thanks Gherkin it is very easy to control any requirement with the help of it. Now if no tags are specified, this branch will be able to generate all runner per tag present in project. Now this branch has almost everything what we were expecting. |
@stevejensen22 please try now by getting latest update , let me know if you face any issue. |
My new runners look like this:
These runners will still result in duplicated scenarios. I thought the fix would append a line number similar to what you do with |
@stev could you provide feature file. I think you have tagged Scenarios with same @automated tag. Tags must be unique per Scenario per Scenario Outlines. |
So I need to generate a unique tag for every scenario? All my scenarios share an I was thinking your change would find all the scenarios that fit my ie I thought the runner would look something like this:
|
Yes put first tag unique like @12345 @automated. |
Here's a snippet from my feature file:
|
So how do I use the |
I tried hard for single tag on each Scenario but duplication raise . To achieve tag wise tag must unique. Outline won't allow as u mentioned. If you provide line no followed by :line no , tags option can't be there. |
So I need to remove the |
@stevejensen22 Update code again. I have removed compulsion of unique tag. Now you can put "@automated" tag to every scenario you want. Update pom for one config element "filterScenarioAndOutlineByLines", now it will allow to generate both scenario and scenario outline by line no. eg. suppose you have two scenarios at line no 16 and 25 then runner will look like
Let me know if you find any issue. |
Just tried this today and it is almost PERFECT!!! The only thing I've seen is that So that config generates a runner class for any feature that has I think that just needs to be tweaked. Thank you so much!! This is awesome!
ie:
If I pass "@high_priority" into the |
Also found that using
|
Welcome @stevejensen22 ... I need to test more about AND OR cases , Scenario Outline with multiple examples i didn't added it yet. Wait for that else you are welcome to add those changes to my repository by forking it. |
@sugatmankar : Following your response to my comment at #30 I use the same ReportBuilder locally and can confirm the exception is valid. Not sure if this is "cucumber-reporting" dependency version issue. I checked on 2.2(which I use) as well as 2.8 latest. Exception : Parallel01IT.java:[251,43] constructor ReportBuilder in class net.masterthought.cucumber.ReportBuilder cannot be applied to given types; It works if I change retryCount to 0, but obviously no ReRun functionality. |
@SasidharParnandi please use java version above 1.7 also check for compiler setting in your IDE. If you are using IntelliJ idea ignore error in pom file. Retry count you can specify only 0 to 5. |
I use Intellij idea and ignored POM errors. I use Java 1.8. Anyway, for now I have figured out an easy way to handle reruns. In my jenkins job, I have added a post build action to concatenate all the *.rerun files into a single rerun.txt after the maven test. I already have my ReRunFailed runner which I use today for running the failed tests. |
Re-implemented in #68 |
@temyers: Thank you so much for putting these changes into an official release (#68)! I'm so excited to get your implementation working with my configuration. I had previously used @sugatmankar's implementation by compiling the code locally and had everything working except However, with the latest changes made in 2.0.0... I can't use If I use Here's an example error:
This may be a limitation related to the gherkin parser. Is there any way we can ignore this requirement ( Here's my config:
|
I think the problem is actually with the runner class that's created. The class needs to be generated based on the Ex:
|
@stevejensen22 |
@stevejensen22 @temyers |
No description provided.