Merge pull request #2449 from dvkruchinin/dkru/cypress-test-issue-2418

Cypress test. Issue 2418
main
Boris Sekachev 5 years ago committed by GitHub
commit 6a347576f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,60 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
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',
labelName: labelName,
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');
});
});
});
Loading…
Cancel
Save