question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to stop test running at first failure?

See original GitHub issue

I need to stop my tests on the first failure found, I’m also using Protractor. I had created:

    this.After(function (scenario, callback) {
        if (scenario.isFailed()) {
            browser.takeScreenshot().then(function(png) {
                var decodedImage = new Buffer(png, 'base64').toString('binary');
                scenario.attach(decodedImage, 'image/png');
                browser.quit();
                callback();
            });
        } else {
            callback();
        }
    });

But I don’t like at all this approach! the problem is that for the rest of the scenarios I had an error that’s confusing if another team member sees it! can you help? I looked around and didn’t found a thing!

Thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
charlierudolphcommented, Jul 5, 2016

cucumber-js has a --fail-fast CLI option which will stop the test run after the first failure.

0reactions
lock[bot]commented, Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jest — Fail Early (And Stop Testing If One Test Fails)
It can be helpful to stop large test suites as soon as an error occurs. Stopping the test run after the first failed...
Read more >
How to stop running tests on the first failed test (fail fast ...
You may add a parameter to tell RSpec to stop running the test suite after N failed tests, for example: --fail-fast=3 . Note...
Read more >
long running py.test stop at first failure
pytest has the option -x or --exitfirst which stops the execution of the tests instanly on ...
Read more >
stop the execution at first test that fail
If you are not running the tests under a debugger, --gtest_break_on_failure will kill the test program on the first failure. On Wed, Mar...
Read more >
Fail fast: stop running tests on first failure - Feature Requests
In feature branches, enable fail fast - stop running tests on first failure · In master/integration branches - disable fail fast (the default ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found