Is there a way to print a custom error message when a Jasmine expect() fails?
As an example, for end to end testing I have an array of web pages and I u
Yes, we can print a custom error message when an expect() failed in Jasmine.
Code Snippet:
it('print a custom error message when an expect failed', function() {
var elemenToBeDisplayed=element(by.css("userName"));
/*custom error message will be displayed if expected condition
failed*/
expect(elemenToBeDisplayed.isPresent).toBe(true,'Write your custom
error message here');
});