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

E2E test of issue #8785: Undefined when reading getUpdated #8843

Merged
merged 19 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from 18 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
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/share/
/static/
/db.sqlite3
/.*env*
/keys
/logs
/profiles
Expand Down Expand Up @@ -49,8 +48,8 @@ yarn-error.log*

# Ignore all the installed packages
node_modules
venv/
.venv/
/*env*/
/.*env*

# Ignore all js dists
cvat-data/dist
Expand Down
8 changes: 2 additions & 6 deletions tests/cypress/e2e/actions_objects2/case_delete_frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@ context('Delete frame from job.', () => {
cy.checkFrameNum(frame + 1);
});

it('Change deleted frame visability.', () => {
cy.openSettings();
cy.get('.cvat-workspace-settings-show-deleted').within(() => {
cy.get('[type="checkbox"]').should('not.be.checked').check();
});
cy.closeSettings();
it('Change deleted frame visibility.', () => {
cy.checkDeletedFrameVisibility();
});

it('Check previous frame available and deleted.', () => {
Expand Down
59 changes: 59 additions & 0 deletions tests/cypress/e2e/issues_prs2/issue_8785_update_job_metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright (C) 2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

/// <reference types="cypress" />

import { taskName } from '../../support/const';

context('The UI remains stable even when the metadata request fails.', () => {
const issueId = '8785';

function clickDeleteFrame() {
cy.get('.cvat-player-delete-frame').click();
cy.get('.cvat-modal-delete-frame').within(() => {
cy.contains('button', 'Delete').click();
});
}
function clickSave() {
cy.get('button').contains('Save').click({ force: true });
cy.get('button').contains('Save').trigger('mouseout');
}

before(() => {
cy.checkDeletedFrameVisibility();
cy.openTaskJob(taskName);
cy.goToNextFrame(1);
});

describe(`Testing issue ${issueId}`, () => {
it('Crash on Save job. Save again.', () => {
const badResponse = { statusCode: 502, body: 'A horrible network error' };

cy.on('uncaught:exception', (err) => {
expect(err.code).to.equal(badResponse.statusCode);
expect(err.message).to.include(`> ${badResponse.body}`);
archibald1418 marked this conversation as resolved.
Show resolved Hide resolved
return false;
});

const routeMatcher = {
url: '/api/jobs/**/data/meta**',
method: 'PATCH',
times: 1, // cancels the intercept without retries
};

cy.intercept(routeMatcher, badResponse).as('patchError');

clickDeleteFrame();
cy.get('.cvat-player-restore-frame').should('be.visible');

clickSave();
cy.wait('@patchError').then((intercept) => {
expect(intercept.response.body).to.equal(badResponse.body);
expect(intercept.response.statusCode).to.equal(badResponse.statusCode);
});

cy.saveJob('PATCH', 200);
});
});
});
8 changes: 8 additions & 0 deletions tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,14 @@ Cypress.Commands.add('hideTooltips', () => {
});
});

Cypress.Commands.add('checkDeletedFrameVisibility', () => {
cy.openSettings();
cy.get('.cvat-workspace-settings-show-deleted').within(() => {
cy.get('[type="checkbox"]').should('not.be.checked').check();
});
cy.closeSettings();
});

Cypress.Commands.overwrite('visit', (orig, url, options) => {
orig(url, options);
cy.closeModalUnsupportedPlatform();
Expand Down
Loading