Fixed unstable e2e restore tests (#5010)

main
Kirill Lakhov 3 years ago committed by GitHub
parent ddcee5b3a9
commit 8b719e4959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,6 +28,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
(<https://github.com/openvinotoolkit/cvat/pull/4659>) (<https://github.com/openvinotoolkit/cvat/pull/4659>)
- Project import/export with skeletons (<https://github.com/opencv/cvat/pull/4867>, - Project import/export with skeletons (<https://github.com/opencv/cvat/pull/4867>,
<https://github.com/opencv/cvat/pull/5004>) <https://github.com/opencv/cvat/pull/5004>)
- Unstable e2e restore tests (<https://github.com/opencv/cvat/pull/5010>)
### Security ### Security
- TDB - TDB

@ -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', 201);
cy.wait('@importTask').its('response.statusCode').should('equal', 204); cy.wait('@importTask').its('response.statusCode').should('equal', 204);
cy.wait('@importTask').its('response.statusCode').should('equal', 202); cy.wait('@importTask').its('response.statusCode').should('equal', 202);
cy.wait('@importTask', { timeout: 5000 }).its('response.statusCode').should('equal', 202); cy.wait('@importTask').then((interception) => {
cy.wait('@importTask').its('response.statusCode').should('equal', 201); 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.contains('The task has been restored succesfully. Click here to open').should('exist').and('be.visible');
cy.closeNotification('.ant-notification-notice-info'); cy.closeNotification('.ant-notification-notice-info');
cy.openTask(taskName); cy.openTask(taskName);

@ -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', 201);
cy.wait('@restoreProject').its('response.statusCode').should('equal', 204); cy.wait('@restoreProject').its('response.statusCode').should('equal', 204);
cy.wait('@restoreProject').its('response.statusCode').should('equal', 202); 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 { } else {
cy.wait('@restoreProject').its('response.statusCode').should('equal', 202); 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') cy.contains('The project has been restored succesfully. Click here to open')
.should('exist') .should('exist')

Loading…
Cancel
Save