From 2ff506858697b87903352c444886ac1dad01dc91 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Wed, 27 Mar 2024 17:33:38 +0300 Subject: [PATCH] Render error body. --- cypress/support/commands.ts | 5 +++++ .../support/pages/mp/agent-dashboard/agent-dashboard-page.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index dadc6e23..95829126 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -44,8 +44,13 @@ Cypress.Commands.add('loadDynamicFixturesByPayload', (dynamicFixturesFilePath) = }, body: operationRequestPayload, timeout: 60000, + failOnStatusCode: false, }) .then((response) => { + if (response.status === 500) { + throw new Error(response.body); + } + if (Array.isArray(response.body.data)) { return response.body.data.reduce( (acc: Record, item: Record) => { diff --git a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts index 3954c822..294d8867 100644 --- a/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts +++ b/cypress/support/pages/mp/agent-dashboard/agent-dashboard-page.ts @@ -15,7 +15,10 @@ export class AgentDashboardPage extends MpPage { const findParams = { query: params.query, expectedCount: 1 }; this.find(findParams).then(($merchantUserRow) => { - cy.wrap($merchantUserRow).find(this.repository.getAssistUserButtonSelector()).should('exist').click(); + cy.wrap($merchantUserRow) + .find(this.repository.getAssistUserButtonSelector()) + .should('exist') + .click({ force: true }); this.repository.getModalConfirmButton().click(); }); };