Update Cypress test "Button "Continue" in label editor". (#3064)

Update cypress command.
main
Dmitry Kruchinin 5 years ago committed by GitHub
parent 6ecf648dec
commit 8e1fe94602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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();
});
});
});
});

@ -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) {

Loading…
Cancel
Save