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'); + }); + }); +});