Iamisti
Iamisti

Reputation: 1710

Re-run protractor timeout or failed tests

I didn't find any reference for the possibility to re-run failed tests (using protractor). Do you know how to do that? It would be great because I have a lot of tests and I don't like to run again all the tests to verify whether the previously failed tests passes or not.

Do anyone have experience with it? It would like this:

Upvotes: 1

Views: 6488

Answers (3)

Ivan
Ivan

Reputation: 1

Cucumber has own property to rerun failed tests, you just need to paste:

cucumberOpts : {
        require : [
            '...'
        ],
        format : 'rerun:path/to/@rerun.txt'
    }

and then to run tests using this file.

Upvotes: 0

pelican
pelican

Reputation: 6224

As of sept 9th 2016, the only way that's available to rerun failed tests in your cucumber/protractor e2e tests is with NickTomlin's protractor-flake.

Protractor-flake is "a wrapper for protractor to automatically re-run failed specs for a specific number of attempts", check out these two links for steps on how to implement it:

  1. https://www.npmjs.com/package/protractor-flake
  2. https://github.com/NickTomlin/protractor-flake/blob/master/docs/cucumber.md

Please pay attention to the Caveat section under that NPM link above:

*Caveats

This has not yet been tested with Protractor + Mocha. It should function similarly. Please update with an issue or PR if this is not the case.

Tests will not re-run properly (all tests will run each time) if you use a custom reporter that does not log stacktraces for failed tests. For example, if you are using jasmine-spec-reporter with Jasmine 2.0, make sure to set displayStacktrace: 'specs' or displayStacktrace: 'all'.*

Upvotes: 2

alecxe
alecxe

Reputation: 473763

As far as I understand, currently it is not possible, but there is an open feature request:

Upvotes: 2

Related Questions