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

setting / command-line-argument for abort-on-failure #312

Open robertkowalski opened 9 years ago

robertkowalski commented 9 years ago

It would be really awesome if there would be a global setting where I could run a testsuite with something like --abort-on-failure="true" which would override the setting which you can codify into your tests.

This comes handy in a team of developers where some want the testsuite to fail fast and some want to run all tests and see a complete result. Another example would be dev-environment vs CI server where you want to try out one of those settings without having to touch all your tests.

What do you think?

ryanoasis commented 9 years ago

I would like to have this as well. +1

avaly commented 9 years ago

Agreed this would be a good feature to have.

possibilities commented 9 years ago

+1 I might try to implement this. I run tests on travis ci, retrying up to 3 times... it would be great it the retries didn't have to wait for potentially many other tests.

bbottema commented 9 years ago

We have currently have 5 10-15 minute builds and it's a real pain to have to wait for the builds to run their course even though it failed after 1 minute. This feature would really help us.

polandtyler commented 8 years ago

Would love this. +1

sandeepthukral commented 8 years ago

In my project this is a snippet of the nightwatch config

"test_settings" : {
    "default" : {
      "launch_url"     : "${LAUNCH_URL}",
      "selenium_port"  : 4445,
      "selenium_host"  : "localhost",
      "silent"         : true,

Now, I use a shell script to run nightwatch. This script sets an environment variable LAUNCH_URL and then this value is used in the config.

See if this kind of a setup can work for you

senocular commented 8 years ago

We use nightwatch.conf.js (http://nightwatchjs.org/guide#settings-file) and parse command line arguments into the resulting config file. See the example on the linked page, below the sample config and imagine it grabbing values from process.argv and adding them to settings.

sandeepthukral commented 8 years ago

@senocular Could you please throw some light on the code that parses the command line parameters and creates the nightwatch.conf.json ?

senocular commented 8 years ago

@sandeepthukral it doesn't create a nightwatch.conf.json. nightwatch.conf.js is a JavaScript alternative to nightwatch.json (see the link I posted). It will be executed in place of anightwatch.json being loaded if found. The JSON it returns is then used in place of nightwatch.json. Using both, you can have the js load the json, then parse process.argv to pull data from the command line arguments to alter the json. The docs example is doing exactly this except its not grabbing values from argv.

dmaii commented 7 years ago

has anybody managed to find a workaround for this? this is really useful for larger test suites

animista01 commented 6 years ago

+1 we need this.

unlikelyzero commented 5 years ago

We'd love this