Skip to content

Commit

Permalink
Fixed unstable e2e restore tests (#5010)
Browse files Browse the repository at this point in the history
  • Loading branch information
klakhov authored Sep 28, 2022
1 parent ddcee5b commit 8b719e4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
(<https://github.com/openvinotoolkit/cvat/pull/4659>)
- Project import/export with skeletons (<https://github.com/opencv/cvat/pull/4867>,
<https://github.com/opencv/cvat/pull/5004>)
- Unstable e2e restore tests (<https://github.com/opencv/cvat/pull/5010>)

### Security
- TDB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 6 additions & 4 deletions tests/cypress/support/commands_projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 8b719e4

Please sign in to comment.