My test clicks a button. Button navigates to a mobile deeplink.
After clicking button the test fails with the following error.
(page load)–waiting for new page to load–
Timed out after waiting 60000ms for your remote page to load.
Your page did not fire its load event within 60000ms.
You can try increasing the pageLoadTimeout value in cypress.config.js to wait longer.
Browsers will not fire the load event until all stylesheets and scripts are done downloading.
When this load event occurs, Cypress will continue running commands.
Also it logs following error to on console when click to the button.
Failed to launch ‘xx://?Page=yyyyy’ because the scheme does not have a registered handler.
I want to prevent the test fail
Also I want to assert that if the console log error has the following message.
Failed to launch ‘xx://?Page=yyyyy’ because the scheme does not have a registered handler.
i tried event listeners to record error logs and prevent the test fails.
but the test always fails after clicking the button.
cy.window().then((win) => {
Cypress.config('pageLoadTimeout', 1)
win.addEventListener("beforeunload", function (event) {
event.preventDefault();
cy.get('@consoleLogs').then((logs) => {
cy.log(logs)
})
return false
});
cy.once("fail", (err) => {
return false
});
});