I'm using Protractor with Chai as Promised in order to create a javascript-based testing tool and I'm getting the error
AssertionError: expected 'http://localhost:8888/test/homepage.php' to equal 'http://localhost:8888/test/my_homepage.php'
while I'm checking the url with this step definition:
this.Then(/^The url of the page should be "([^"]*)"$/, function(myUrl, callback){
expect(browser.getCurrentUrl()).to.eventually.equal(myUrl);
callback();
});
I would like to catch this error in order to use a different callback function, how can I do that? I've tried to use a try-catch block but it doesn't seem to work. I can't even understand if AssertionErrors
are generated by Protractor, can you gently give me an explaination about this?
Thank you in advance