Skip to content

Commit 01dfdd6

Browse files
enjeckbackportbot[bot]
authored andcommitted
fix(test): Handle unsupported browser screen
Signed-off-by: Enjeck C. <patrathewhiz@gmail.com> [skip ci]
1 parent bbb9e13 commit 01dfdd6

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎cypress/support/e2e.js‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,19 @@ import './commands.js'
2222
Cypress.on('uncaught:exception', (err) => {
2323
return !err.message.includes('ResizeObserver loop limit exceeded') &&
2424
!err.message.includes('ResizeObserver loop completed with undelivered notifications') &&
25-
!err.message.includes("Cannot read properties of undefined (reading 'from')")
25+
!err.message.includes("Cannot read properties of undefined (reading 'from')") &&
26+
!err.message.includes("Cannot read properties of undefined (reading 'createEditor')")
27+
})
28+
29+
// Handle unsupported browser dialog that appears on page load
30+
Cypress.Commands.overwrite('visit', (originalVisit, url, options) => {
31+
return originalVisit(url, options).then(() => {
32+
// Wait a moment for the dialog to appear if needed
33+
cy.get('body', { timeout: 1000 }).then(($body) => {
34+
const button = $body.find('button:contains("Continue with this unsupported browser")')
35+
if (button.length > 0) {
36+
cy.contains('button', 'Continue with this unsupported browser').click()
37+
}
38+
})
39+
})
2640
})

0 commit comments

Comments
 (0)