diff --git a/tests/cypress/integration/actions_tasks_objects/case_33_button_continue_label_editor.js b/tests/cypress/integration/actions_tasks_objects/case_33_button_continue_label_editor.js index 4c38376e..6b34f1ce 100644 --- a/tests/cypress/integration/actions_tasks_objects/case_33_button_continue_label_editor.js +++ b/tests/cypress/integration/actions_tasks_objects/case_33_button_continue_label_editor.js @@ -1,4 +1,4 @@ -// Copyright (C) 2020 Intel Corporation +// Copyright (C) 2020-2021 Intel Corporation // // SPDX-License-Identifier: MIT @@ -30,5 +30,14 @@ context('Button "Continue" in label editor.', () => { expect(labelNames).to.include(additionalLabels[2]); }); }); + + it('Try add label with empty name. Alert should be visible.', () => { + cy.get('.cvat-constructor-viewer-new-item').click(); + cy.get('.cvat-label-constructor-creator').within(() => { + cy.contains('button', 'Continue').click(); + cy.contains('[role="alert"]', 'Please specify a name').should('be.visible'); + cy.contains('button', 'Cancel').click(); + }); + }); }); }); diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 052ba548..c5630e01 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -541,7 +541,7 @@ Cypress.Commands.add('addNewLabel', (newLabelName, additionalAttrs, labelColor) Cypress.Commands.add('addNewLabelViaContinueButton', (additionalLabels) => { cy.collectLabelsName().then((labelsNames) => { if (additionalLabels.some((el) => labelsNames.indexOf(el) === -1)) { - cy.contains('button', 'Add label').click(); + cy.get('.cvat-constructor-viewer-new-item').click(); for (let j = 0; j < additionalLabels.length; j++) { cy.get('[placeholder="Label name"]').type(additionalLabels[j]); if (j !== additionalLabels.length - 1) {