I'm attempting to validate the header (Text) of a given web page when making a successful submission.
My command:
async confirmSuccessfulSubmission() {
return $("#contact_reply h1").getText().then((value) => {
//incorrect text should be:Thank You for your Message!
expect(value.to.equal("Thank You for your Message!2"));
});
}
Exception:
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
The correct heading is: Thank You for your Message! therefore if the heading is: Thank You for your Message!2 the test should fail (Chai assertion).
Any ideas?
Thanks for your help