nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

enhancement request: option to re-run failing tests <n> number of times #284

Closed mam-p closed 9 years ago

mam-p commented 10 years ago

Many GUI test frameworks support an option to re-run failing tests a specified number of times. For example, I'd like to see this command:

nightwatch -s FAILING -a regression --rerun 3

give every failing test TWO more tries to pass.

lacymorrow commented 10 years ago

+1 for this. A huge number of users need this due to browser instability (especially IE).

I'm working on a hacky way of accomplishing this with the current version of nightwatch, I'll post my results if I have success.

beatfactor commented 10 years ago

interesting...

On Wed, Oct 1, 2014 at 2:55 AM, Lacy Morrow notifications@github.com wrote:

+1 for this. A huge number of users need this due to browser instability (especially IE).

I'm working on a hacky way of accomplishing this with the current version of nightwatch, I'll post my results if I have success.

— Reply to this email directly or view it on GitHub https://github.com/beatfactor/nightwatch/issues/284#issuecomment-57405456 .

chan-dra commented 10 years ago

+1 for this. We use nightwatch to run our end2end tests, but it is starting to become a nightmare to see so many false positives, which would go away after a rerun.

maxbeatty commented 10 years ago

I work with Chandra and would love to have automatic retries. If anyone has ideas on how to make it work, we could probably take a stab at it. =

rcherny commented 10 years ago

+1 Yeah ok, this would be very useful. Could also resolve issues such as #252

didemacet commented 9 years ago

+1.

didemacet commented 9 years ago

@lacymorrow do you have any updates? If not, can you tell me how can I do that. I need this because I am totally agree with chan-dra's comment.

yn5 commented 9 years ago

+1

codemonkeybot commented 9 years ago

+1

andymost commented 9 years ago

+1

ghost commented 9 years ago

:+1:

ghost commented 9 years ago

Here's similar example from other JS framework: http://galenframework.com/docs/reference-galen-javascript-api/#retry

sknopf commented 9 years ago

+1

sknopf commented 9 years ago

I have a solution here (https://github.com/beatfactor/nightwatch/pull/436) if anyone wants to give it a try.

If testing in an existing project, just reference this branch in your package.json file:

"nightwatch": "git://github.com/sknopf/nightwatch.git#add_flag_for_n_retries"

To use, add --retries <n> as a command line arg.

sknopf commented 9 years ago

As of 0.7 there is a retries CL option to rerun failed testcases: http://nightwatchjs.org/guide#command-line-options

IndraniBiswas commented 8 years ago

is there going to be retry option that can be specified in nightwatch.json config file?

jenni commented 7 years ago

+1

quantuminformation commented 6 years ago

@IndraniBiswas thats a good idea. Any news?

AlfredoMoretta commented 6 years ago

+1

samtbabu commented 5 years ago

+1

mari8i commented 5 years ago

+1 also for me!

This would save me at the moment, actually :-)

HereticalCrown commented 5 years ago

I don't know if people know this or not but you can add "--retries " at the end of the tests in your package files. This will then re-rerun your failed tests immediately after they fail.

I am currently struggling with this specifically because we are using the workers config in conjunction with these changes to speed up our run time. Unfortunately due to the amount of workers we (4 currently) it gets itself into a bit of a tiz and fails some of the tests. Once the run has finished though and we re-run them manually they pass. Is there a setting or config for the retries that dictates when to re-run the tests?

islacruse commented 3 years ago

Is there going to be retry option that can be specified in nightwatch.json config file?

It would be great!