diff --git a/tests/cypress/integration/actions_tasks_objects/issue_1568_cuboid_dump_annotation.js b/tests/cypress/integration/actions_tasks_objects/issue_1568_cuboid_dump_annotation.js index 1ea21d36..033920b2 100644 --- a/tests/cypress/integration/actions_tasks_objects/issue_1568_cuboid_dump_annotation.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1568_cuboid_dump_annotation.js @@ -18,17 +18,13 @@ context('Dump annotation if cuboid created', () => { secondY: 450, }; - function save() { - cy.get('button').contains('Save').click({ force: true }); - } - before(() => { cy.openTaskJob(taskName); }); after('Go to task list', () => { cy.removeAnnotations(); - save(); + cy.saveJob(); }); describe(`Testing issue "${issueId}"`, () => { @@ -38,7 +34,7 @@ context('Dump annotation if cuboid created', () => { }); it('Dump an annotation', () => { cy.get('.cvat-annotation-header-left-group').within(() => { - save(); + cy.saveJob(); cy.get('button').contains('Menu').trigger('mouseover', { force: true }); }); cy.get('.cvat-annotation-menu').within(() => { diff --git a/tests/cypress/integration/actions_tasks_objects/pr_2203_error_сannot_read_property_at_saving_job.js b/tests/cypress/integration/actions_tasks_objects/pr_2203_error_сannot_read_property_at_saving_job.js new file mode 100644 index 00000000..8b398179 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/pr_2203_error_сannot_read_property_at_saving_job.js @@ -0,0 +1,56 @@ +// Copyright (C) 2020 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName, labelName } from '../../support/const'; + +context('Check error сannot read property at saving job', () => { + + const prId = '2203'; + const createRectangleShape2Points = { + points: 'By 2 Points', + type: 'Shape', + labelName: labelName, + firstX: 100, + firstY: 100, + secondX: 300, + secondY: 300, + }; + + before(() => { + cy.openTaskJob(taskName); + }); + + after('Remove annotations and save job', () => { + cy.removeAnnotations(); + cy.saveJob(); + }); + + describe(`Testing pr "${prId}"`, () => { + it('Create an object in first frame', () => { + cy.createRectangle(createRectangleShape2Points); + }); + + it('Go to next frame and create an object in second frame', () => { + cy.get('.cvat-player-next-button').click(); + cy.createRectangle(createRectangleShape2Points); + }); + + it('Go to AAM', () => { + cy.changeWorkspace('Attribute annotation', labelName); + }); + + it('Save job and go to previous frame at saving job', () => { + cy.server().route('PATCH', '/api/v1/jobs/**').as('saveJob'); + cy.saveJob(); + cy.get('body').type('d'); + cy.wait('@saveJob').its('status').should('equal', 200); + }); + + it('Page with the error is missing', () => { + cy.get('.cvat-global-boundary').should('not.exist'); + }); + }); +}); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 695007b3..4a98be69 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -74,6 +74,12 @@ Cypress.Commands.add('openTask', (taskName) => { cy.contains('strong', taskName).parents('.cvat-tasks-list-item').contains('a', 'Open').click({ force: true }); }); +Cypress.Commands.add('saveJob', () => { + cy.get('button') + .contains('Save') + .click({ force: true }); +}); + Cypress.Commands.add('openJob', (jobNumber = 0) => { let tdText = ''; cy.get('.ant-table-tbody')