NickTomlin / protractor-flake

Rerun potentially flakey protractor tests before failing.
MIT License
80 stars 51 forks source link

Failing Cucumber Scenarios causing entire feature files to re-run #112

Open Phonesis opened 5 years ago

Phonesis commented 5 years ago

This is probably not so much a bug as a feature request perhaps but is it a known limitation that when you try to re-run failing Cucumber Scenarios with flakes it will instead run the entire feature file the failing scenarios(s) reside in?

It would be fantastic if flakes was able to just re-run the failed Scenarios as opposed to the entire feature file. Is this possible?

NickTomlin commented 5 years ago

This would be great but I think there are a few pieces:

1) I think it would require some changes in the core (which would be beneficial to all) that would allow a parser to provide different params/options for the next protractor run:

    // WARNING: PSEUDOCODE
    function cucumberParser (output) {
      const matchingScenarios = /Scenario Failed: (.*)/.match(output)

      return {
        // we may need to include both the files _and_ the scenario names
        // I don't know about how cucumber is actually configured
        failedSpecs: [],
        protractorOptions: ['--cucumber.scenarios', matchingScenarios.join(',')]
      }
    }
    // WARNING: PSEUDOCODE

2) I'm not sure how the cucumber configuration would need to look for protractor (since I don't use cucumber myself)

I'm still in year one of a new job and about to welcome a second child into my life so I don't have much bandwidth at the moment. So I would appreciate a PR on either front 😄

Phonesis commented 5 years ago

Thanks Nick, sadly I would have no idea where to start with this being more a C# and Java guy. Be amazing if someone was able to pick this up though

abubakarafzal commented 5 years ago

i am facing the same issue. @Phonesis did you resolve this problem?

Phonesis commented 5 years ago

i am facing the same issue. @Phonesis did you resolve this problem?

No sadly not.