protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Protractor unable to run the entire feature scenarios due to 3 consecutive assertions error in one feature scenario

Open ahmedusa opened this issue 10 years ago • 3 comments

Hi, I am using protractor to develop automated tests to test one of the application developed in angularJS.

But the problem is, in a feature scenario If I have more then 3 assertions failures, then protractor just exit from the test with the following error:

1 scenario (1 failed) 16 steps (1 failed, 5 skipped, 10 passed) [launcher] Error: ReferenceError: callback is not defined at Object.exports.config.onComplete (/local/content/ctrp/apps/ctrp/config_ahmed.js:51:9) at /Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/protractor/lib/frameworks/cucumber.js:156:32 at /local/content/ctrp/apps/ctrp/features/support/reporter.js:155:9 at formatter.handleAfterScenarioEvent (/Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/protractor/lib/frameworks/cucumber.js:112:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/protractor/lib/frameworks/cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/protractor/lib/frameworks/cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/protractor/lib/frameworks/cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/protractor/lib/frameworks/cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/protractor/lib/frameworks/cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/protractor/lib/frameworks/cucumber.js:139:13) at Domain.emit (events.js:107:17) at Domain.errorHandler as _errorHandler at process._fatalException (node.js:233:33)

[launcher] Process exited with error code 100

As you can see, out of 16 steps 10 Passed, 1 Failed and 5 skipped and then process exited with error code 100.

Questions is, how can I continue to the next feature scenario instead of exiting from the process so that entire feature scenarios can be run even if I have issue with the first scenario.

Any help or idea would be helpful!

Thanks,

ahmedusa avatar Aug 12 '16 15:08 ahmedusa

Can you show your step definitions files? My guess is that promise is not returned in the step definitions.

On Fri, Aug 12, 2016 at 11:33 AM, ahmedusa [email protected] wrote:

Hi, I am using protractor to develop automated tests to test one of the application developed in angularJS.

But the problem is, in a feature scenario If I have more the then 3 assertions failures, then protractor just exit from the test with the following error:

1 scenario (1 failed) 16 steps (1 failed, 5 skipped, 10 passed) [launcher] Error: ReferenceError: callback is not defined at Object.exports.config.onComplete (/local/content/ctrp/apps/ ctrp/config_ahmed.js:51:9) at /Users/ahmeds6/.nvm/versions/node/v0.12.7/lib/node_modules/ protractor/lib/frameworks/cucumber.js:156:32 at /local/content/ctrp/apps/ctrp/features/support/reporter.js:155:9 at formatter.handleAfterScenarioEvent (/Users/ahmeds6/.nvm/versions/ node/v0.12.7/lib/node_modules/protractor/lib/frameworks/ cucumber.js:112:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/ node/v0.12.7/lib/node_modules/protractor/lib/frameworks/ cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/ node/v0.12.7/lib/node_modules/protractor/lib/frameworks/ cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/ node/v0.12.7/lib/node_modules/protractor/lib/frameworks/ cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/ node/v0.12.7/lib/node_modules/protractor/lib/frameworks/ cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/ node/v0.12.7/lib/node_modules/protractor/lib/frameworks/ cucumber.js:139:13) at /local/content/ctrp/apps/ctrp/features/support/reporter.js:116:9 at formatter.handleStepResultEvent (/Users/ahmeds6/.nvm/versions/ node/v0.12.7/lib/node_modules/protractor/lib/frameworks/ cucumber.js:139:13) at Domain.emit (events.js:107:17) at Domain.errorHandler as _errorHandler at process._fatalException (node.js:233:33)

[launcher] Process exited with error code 100

As you can see, out of 16 steps 10 Passed, 1 Failed and 5 skipped and then process exited with error code 100.

Questions is, how can I continue to the next feature scenario instead of exiting from the process so that entire feature scenarios can be run even if I have issue with the first scenario.

Any help or idea would be helpful!

Thanks,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/angular/protractor/issues/3474, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF6jef_hnH72FTdySHNIce8RM45ZrF6ks5qfJJNgaJpZM4JjMyL .

jlin412 avatar Aug 12 '16 17:08 jlin412

Here are the steps definition:

this.Then(/^the Research Category populates$/, function (callback) {
    expect(associated.researchCategoryVw.getText()).to.eventually.equal(expResearchCat);
    browser.sleep(25).then(callback);
});

this.Then(/^the Official Title populates$/, function (callback) {
    expect(associated.officialTitleVw.getText()).to.eventually.equal(expOfficialTitle);
    browser.sleep(25).then(callback);
});

ahmedusa avatar Aug 12 '16 18:08 ahmedusa

It looks like you're trying to call a function called callback at /local/content/ctrp/apps/ctrp/config_ahmed.js:51:9, but that variable is undefined. I'd suggest proofreading that file.

Regardless, this is a support question, and this issue tracker is for bug reports and/or feature requests. Please ask support questions on Stack Overflow

sjelin avatar Aug 12 '16 22:08 sjelin