Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to continue test scenario execution after step failure in a previous scenario?

Whenever there is a step failure while running on a remote server, I would like to capture the failed step and then continue running the remaining scenarios. The captured step would then be included in a file for reporting purposes. Is this a possibility? All replies I've seen elsewhere just say you should fix the test before moving on. I agree, but I only want the tests to stop when running locally, not remotely.

➜ customer git:(pat104) ✗ cucumber.js -f progress (pat104⚡) ...F-----Failed scenario: View and select first contact from contact history ...F-Failed scenario: View and select a contact from multiple contacts in history ..................................................F---Failed scenario: Navigating to profile with url and enrollmentId ...................................................F-Failed scenario: Successful MDN Search with 1 result returned. Tech Selects and continues .............FFailed scenario: Successful MDN with multiple results

like image 954
Jessica Wood Avatar asked Dec 02 '25 11:12

Jessica Wood


1 Answers

Turns out, one of the step-definitions was using .waitForExist incorrectly. The test was written:

this.browser
        .waitForExist('#someElement', 1000, callback)

Callback isn't a parameter for .waitForExist, rewrote to:

.waitForExist('#someElement',1000).then(function (exists) {
            assert.equal(exists, true, callback);
        })
like image 129
Jessica Wood Avatar answered Dec 06 '25 00:12

Jessica Wood



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!