From 528fcb97b86c9502948c3ee1e13f60e3a0ef7c3c Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 7 May 2024 20:28:49 +0200 Subject: [PATCH] first attempt to catch malformed JSON error --- cypress/cypress/e2e/steps/login.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cypress/cypress/e2e/steps/login.ts b/cypress/cypress/e2e/steps/login.ts index ef76b78247..93d609b611 100644 --- a/cypress/cypress/e2e/steps/login.ts +++ b/cypress/cypress/e2e/steps/login.ts @@ -24,6 +24,13 @@ When('I submit the credentials {string} {string}', (username: string, password: 'http://localhost:9000/if/flow/dreammallearth-authentication-flow/', { args: { username, password } }, ({ username, password }) => { + cy.on('uncaught:exception', (e) => { + if (e.message.includes('JSON')) { + // we expected this error, so let's ignore it + // and let the test continue + return false + } + }) // loginPage.submitUsername(username) cy.get('input[name="uidField"]').type(username) cy.get('button[type="submit"]').click()