From 437a2c78fde2a608f76ed7a01429c389aabc94b9 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Fri, 13 Nov 2020 16:57:47 +0300 Subject: [PATCH 1/8] added test --- ...ror_сannot_read_property_at_saving_job.js | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tests/cypress/integration/actions_tasks_objects/pr_2203_error_сannot_read_property_at_saving_job.js 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..a521efc7 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/pr_2203_error_сannot_read_property_at_saving_job.js @@ -0,0 +1,50 @@ +// 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 issueIds = '2053, 2202'; + const createRectangleShape2Points = { + points: 'By 2 Points', + type: 'Shape', + switchLabel: false, + firstX: 100, + firstY: 100, + secondX: 300, + secondY: 300, + }; + + before(() => { + cy.openTaskJob(taskName); + }); + + describe(`Testing issues "${issueIds}"`, () => { + it('Create an object in first frame', () => { + cy.createRectangle(createRectangleShape2Points); + }); + + it('Go to next frame and create an object in second frame', () => { + cy.get('body').type('f'); + cy.createRectangle(createRectangleShape2Points); + }); + + it('Go to AAM', () => { + cy.changeWorkspace('Attribute annotation', labelName); + }); + + it('Save job and go to previous frame at saving job', () => { + cy.get('button').contains('Save').click({ force: true }); + cy.get('body').type('d'); + }); + + it('Page with the error is missing', () => { + cy.wait(100); + cy.contains('Oops, something went wrong').should('not.exist'); + }); + }); +}); \ No newline at end of file From d930a2f8e2916bc4b13ace6bd556886d19f2fd71 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Fri, 13 Nov 2020 17:38:47 +0300 Subject: [PATCH 2/8] create function saveJob --- tests/cypress/support/commands.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index c455e1d5..ff62523d 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') From 52b517171a5b7cb65877fd3fe463873dfe088b3c Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Fri, 13 Nov 2020 17:39:46 +0300 Subject: [PATCH 3/8] added step after and improvements test --- ...203_error_сannot_read_property_at_saving_job.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 index a521efc7..f0f68d50 100644 --- 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 @@ -8,7 +8,7 @@ import { taskName, labelName } from '../../support/const'; context('Check error сannot read property at saving job', () => { - const issueIds = '2053, 2202'; + const prId = '2203'; const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -23,13 +23,18 @@ context('Check error сannot read property at saving job', () => { cy.openTaskJob(taskName); }); - describe(`Testing issues "${issueIds}"`, () => { + after('Go to task list', () => { + 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('body').type('f'); + cy.get('.cvat-player-next-button').click(); cy.createRectangle(createRectangleShape2Points); }); @@ -38,7 +43,7 @@ context('Check error сannot read property at saving job', () => { }); it('Save job and go to previous frame at saving job', () => { - cy.get('button').contains('Save').click({ force: true }); + cy.saveJob(); cy.get('body').type('d'); }); From 05e2d4b948bfe40dda3fb17102322d644ef0d514 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Fri, 13 Nov 2020 17:40:35 +0300 Subject: [PATCH 4/8] used function saveJob --- .../issue_1568_cuboid_dump_annotation.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 505444fa..ab405092 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(() => { From 075c6670372571a852a9d226e77241e6250f9e12 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Mon, 16 Nov 2020 09:12:30 +0300 Subject: [PATCH 5/8] rename step --- .../pr_2203_error_сannot_read_property_at_saving_job.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index f0f68d50..dce7ad15 100644 --- 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 @@ -23,7 +23,7 @@ context('Check error сannot read property at saving job', () => { cy.openTaskJob(taskName); }); - after('Go to task list', () => { + after('Remove annotations and save job', () => { cy.removeAnnotations(); cy.saveJob(); }); From ace75ca96d844840c17590eb7b3d6bca8bc9d385 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Mon, 16 Nov 2020 10:19:28 +0300 Subject: [PATCH 6/8] added EOF string --- .../pr_2203_error_сannot_read_property_at_saving_job.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index dce7ad15..e2132961 100644 --- 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 @@ -52,4 +52,4 @@ context('Check error сannot read property at saving job', () => { cy.contains('Oops, something went wrong').should('not.exist'); }); }); -}); \ No newline at end of file +}); From 02ea1881a78c4f2ad19f70213d8f0908fbdd00c2 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Wed, 18 Nov 2020 14:55:21 +0300 Subject: [PATCH 7/8] apply comments --- .../pr_2203_error_сannot_read_property_at_saving_job.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 index e2132961..bc6963fd 100644 --- 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 @@ -43,13 +43,14 @@ context('Check error сannot read property at saving job', () => { }); 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.wait(100); - cy.contains('Oops, something went wrong').should('not.exist'); + cy.get('.cvat-global-boundary').should('not.exist'); }); }); }); From 53cbd4c9c5e485677fce225556737c8fc4f36767 Mon Sep 17 00:00:00 2001 From: Dmitriy Oparin Date: Mon, 23 Nov 2020 13:50:37 +0300 Subject: [PATCH 8/8] test adaptation for new develop --- .../pr_2203_error_сannot_read_property_at_saving_job.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index bc6963fd..8b398179 100644 --- 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 @@ -12,7 +12,7 @@ context('Check error сannot read property at saving job', () => { const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - switchLabel: false, + labelName: labelName, firstX: 100, firstY: 100, secondX: 300,