Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed unstable e2e restore tests #5010

Merged
merged 2 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428)
(<https://github.com/openvinotoolkit/cvat/pull/4659>)
- Project import 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