From 50757ad9eb0dbf78d988fba8911d7a6da6db5785 Mon Sep 17 00:00:00 2001 From: Sven Valenberghs Date: Thu, 28 Nov 2024 12:29:32 +0100 Subject: [PATCH] fix cypress intercept misses a call that just happened, moved the intercept higher in the method --- cypress/support/commands/case-commands.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/support/commands/case-commands.js b/cypress/support/commands/case-commands.js index 8227488e26..a35fd2e567 100644 --- a/cypress/support/commands/case-commands.js +++ b/cypress/support/commands/case-commands.js @@ -135,21 +135,21 @@ function addSubcaseViaModal(subcase) { const randomInt = Math.floor(Math.random() * Math.floor(10000)); cy.log('addSubcaseViaModal'); + cy.intercept('GET', '/government-bodies**').as(`getGovernmentBodies${randomInt}`); + cy.intercept('GET', '/mandatees**').as(`getMandatees${randomInt}`); cy.intercept('POST', '/subcases').as(`createNewSubcase${randomInt}`); cy.intercept('POST', '/meetings/*/submit').as(`submitToMeeting${randomInt}`); cy.intercept('POST', '/submission-activities').as(`postSubmissionActivities${randomInt}`); - cy.intercept('GET', '/mandatees**').as(`getMandatees${randomInt}`); - cy.intercept('GET', '/government-bodies**').as(`getGovernmentBodies${randomInt}`); // after creating a case we are already on the page to add a subcase if (!subcase.newCase) { cy.get(cases.subcaseOverviewHeader.openAddSubcase).click(); } - cy.wait(`@getMandatees${randomInt}`, { + cy.wait(`@getGovernmentBodies${randomInt}`, { timeout: 60000, }); - cy.wait(`@getGovernmentBodies${randomInt}`, { + cy.wait(`@getMandatees${randomInt}`, { timeout: 60000, });