I have been trying to testing my angular app using protractor and cucumber, but when i use mocha for create a expectation when the expectation it's false the error spec doesn't show in the console.
The relevant HTML for the route http://localhost:9000/#/form29/form29'
...
<h4 class="title">
The title
</h4>
...
And my step file it is:
//form29_steps.js
var chai = require('chai'),
chaiAsPromised = require('chai-as-promised'),
assert;
chai.use(chaiAsPromised);
expect = chai.expect;
module.exports = function () {
this.Given(/^I am in the form 29 page$/, function (done) {
browser.get('http://localhost:9000/#/form29/form29');
done();
});
this.Then(/^should be the title "(.*)"/,function(title, done){
var el = element(by.css('.title'));
el.getText().then(function(text){
//a false expect
expect(title).to.eq('Aaaaa');
done();
});
});
};
when the expect its valid its ok, but when the expect failed there aren't a expect failed error and show the following:
[16:14:08] E/launcher - "process.on('uncaughtException'" error, see launcher
[16:14:08] E/launcher - Process exited with error code 199
When i try the same but not using promised this works well
this.Then(/^should be the title "(.*)"/,function(title, done){
var el = element(by.css('.title'));
expect(title).to.eq('A');
done();
});
I get the error that i wish:
Message:
AssertionError: expected 'Formulario 29' to equal 'A'
at World.<anonymous> (/protractor/test/e2e/features/step_definitions/form29_steps.js:18:20)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
Why happen this?