diff --git a/CHANGELOG.md b/CHANGELOG.md index 26e9014a0586..31263c491ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428) () - Project import with skeletons (, ) +- Unstable e2e restore tests () ### Security - TDB diff --git a/tests/cypress/integration/actions_tasks2/case_97_export_import_task.js b/tests/cypress/integration/actions_tasks2/case_97_export_import_task.js index 4b841b290aea..dc5ff8ba4c42 100644 --- a/tests/cypress/integration/actions_tasks2/case_97_export_import_task.js +++ b/tests/cypress/integration/actions_tasks2/case_97_export_import_task.js @@ -113,8 +113,12 @@ context('Export, import an annotation task.', { browser: '!firefox' }, () => { cy.wait('@importTask').its('response.statusCode').should('equal', 201); cy.wait('@importTask').its('response.statusCode').should('equal', 204); cy.wait('@importTask').its('response.statusCode').should('equal', 202); - cy.wait('@importTask', { timeout: 5000 }).its('response.statusCode').should('equal', 202); - cy.wait('@importTask').its('response.statusCode').should('equal', 201); + cy.wait('@importTask').then((interception) => { + cy.wrap(interception).its('response.statusCode').should('be.oneOf', [201, 202]); + if (interception.response.statusCode === 202) { + cy.wait('@importTask').its('response.statusCode').should('equal', 201); + } + }); cy.contains('The task has been restored succesfully. Click here to open').should('exist').and('be.visible'); cy.closeNotification('.ant-notification-notice-info'); cy.openTask(taskName); diff --git a/tests/cypress/support/commands_projects.js b/tests/cypress/support/commands_projects.js index a835c88aac10..b40b7fbccfbe 100644 --- a/tests/cypress/support/commands_projects.js +++ b/tests/cypress/support/commands_projects.js @@ -213,13 +213,15 @@ Cypress.Commands.add('restoreProject', (archiveWithBackup, sourceStorage = null) cy.wait('@restoreProject').its('response.statusCode').should('equal', 201); cy.wait('@restoreProject').its('response.statusCode').should('equal', 204); cy.wait('@restoreProject').its('response.statusCode').should('equal', 202); - cy.wait('@restoreProject', { timeout: 5000 }).its('response.statusCode').should('equal', 202); - cy.wait('@restoreProject').its('response.statusCode').should('equal', 201); } else { cy.wait('@restoreProject').its('response.statusCode').should('equal', 202); - cy.wait('@restoreProject', { timeout: 3000 }).its('response.statusCode').should('equal', 202); - cy.wait('@restoreProject').its('response.statusCode').should('equal', 201); } + cy.wait('@restoreProject').then((interception) => { + cy.wrap(interception).its('response.statusCode').should('be.oneOf', [201, 202]); + if (interception.response.statusCode === 202) { + cy.wait('@restoreProject').its('response.statusCode').should('equal', 201); + } + }); cy.contains('The project has been restored succesfully. Click here to open') .should('exist')