From 20c6567501d479b4682e9c09ea74648285e81e1d Mon Sep 17 00:00:00 2001 From: Kruchinin Date: Mon, 16 Nov 2020 12:46:24 +0300 Subject: [PATCH 1/3] Cypress test. Issue 2418. Check hide/unhide functionality from label tab for object and tag with a same label. --- .../issue_2418_object_tag_same_labels.js | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js diff --git a/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js b/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js new file mode 100644 index 00000000..8c3d38f4 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js @@ -0,0 +1,54 @@ +// Copyright (C) 2020 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +import { taskName, labelName } from '../../support/const'; + +context('Check hide/unhide functionality from label tab for object and tag with a same label.', () => { + const issueId = '2418'; + const createRectangleShape2Points = { + points: 'By 2 Points', + type: 'Shape', + switchLabel: false, + firstX: 260, + firstY: 200, + secondX: 360, + secondY: 250 + }; + + + + before(() => { + cy.openTaskJob(taskName); + }); + + describe(`Testing issue "${issueId}"`, () => { + it('Crearte an object. Create a tag.', () => { + cy.createRectangle(createRectangleShape2Points); + cy.createTag(labelName); + }); + it('Go to "Labels" tab.', () => { + cy.get('.cvat-objects-sidebar').within(() => { + cy.contains('Labels').click(); + }); + }); + it('Hide object by label name.', () => { + cy.get('.cvat-objects-sidebar-labels-list').within(() => { + cy.contains(labelName).parents('.cvat-objects-sidebar-label-item').within(() => { + cy.get('.cvat-label-item-button-hidden').click().should('have.class', 'cvat-label-item-button-hidden-enabled'); + }); + }); + cy.get('#cvat_canvas_shape_1').should('be.hidden'); + }); + it('Unhide object by label name.', () => { + cy.get('.cvat-objects-sidebar-labels-list').within(() => { + cy.contains(labelName).parents('.cvat-objects-sidebar-label-item').within(() => { + cy.get('.cvat-label-item-button-hidden').click().should('not.have.class', 'cvat-label-item-button-hidden-enabled'); + }); + }); + cy.get('#cvat_canvas_shape_1').should('be.visible'); + }); + }); +}); From edeab4dc8ec1e41c2d3b58a8ba5570fac95de41c Mon Sep 17 00:00:00 2001 From: Kruchinin Date: Tue, 17 Nov 2020 10:23:31 +0300 Subject: [PATCH 2/3] Minor fix. --- .../actions_tasks_objects/issue_2418_object_tag_same_labels.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js b/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js index 8c3d38f4..8dfc564e 100644 --- a/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js @@ -18,8 +18,6 @@ context('Check hide/unhide functionality from label tab for object and tag with secondY: 250 }; - - before(() => { cy.openTaskJob(taskName); }); From cb9a4b924c1dade7cfd6e4b0c72df28ed6c86574 Mon Sep 17 00:00:00 2001 From: Kruchinin Date: Thu, 19 Nov 2020 13:47:25 +0300 Subject: [PATCH 3/3] Test adaptation for new functional object creation. --- .../issue_2418_object_tag_same_labels.js | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js b/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js index 8dfc564e..90ba6082 100644 --- a/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_2418_object_tag_same_labels.js @@ -11,11 +11,11 @@ context('Check hide/unhide functionality from label tab for object and tag with const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', - switchLabel: false, + labelName: labelName, firstX: 260, firstY: 200, secondX: 360, - secondY: 250 + secondY: 250, }; before(() => { @@ -34,17 +34,25 @@ context('Check hide/unhide functionality from label tab for object and tag with }); it('Hide object by label name.', () => { cy.get('.cvat-objects-sidebar-labels-list').within(() => { - cy.contains(labelName).parents('.cvat-objects-sidebar-label-item').within(() => { - cy.get('.cvat-label-item-button-hidden').click().should('have.class', 'cvat-label-item-button-hidden-enabled'); - }); + cy.contains(labelName) + .parents('.cvat-objects-sidebar-label-item') + .within(() => { + cy.get('.cvat-label-item-button-hidden') + .click() + .should('have.class', 'cvat-label-item-button-hidden-enabled'); + }); }); cy.get('#cvat_canvas_shape_1').should('be.hidden'); }); it('Unhide object by label name.', () => { cy.get('.cvat-objects-sidebar-labels-list').within(() => { - cy.contains(labelName).parents('.cvat-objects-sidebar-label-item').within(() => { - cy.get('.cvat-label-item-button-hidden').click().should('not.have.class', 'cvat-label-item-button-hidden-enabled'); - }); + cy.contains(labelName) + .parents('.cvat-objects-sidebar-label-item') + .within(() => { + cy.get('.cvat-label-item-button-hidden') + .click() + .should('not.have.class', 'cvat-label-item-button-hidden-enabled'); + }); }); cy.get('#cvat_canvas_shape_1').should('be.visible'); });