-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cypress test. Creating a label with existing label name. (#2705)
- Loading branch information
1 parent
c1a11b1
commit 165cf0f
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...ypress/integration/actions_tasks_objects/case_43_create_label_with_existing_label_name.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { taskName } from '../../support/const'; | ||
|
||
context('Creating a label with existing label name.', () => { | ||
const caseId = '43'; | ||
let firstLabelName = ''; | ||
|
||
before(() => { | ||
cy.openTask(taskName); | ||
}); | ||
|
||
describe(`Testing case "${caseId}"`, () => { | ||
it('Try to create a label with existing name. Should not be successful.', () => { | ||
// Get the name of the first existing label. | ||
cy.get('.cvat-constructor-viewer-item') | ||
.first() | ||
.then((firstLabel) => { | ||
firstLabelName = firstLabel.text(); | ||
// Try to create a label with existing label name | ||
cy.get('.cvat-constructor-viewer-new-item').click(); | ||
cy.get('[placeholder="Label name"]').type(firstLabelName); | ||
cy.contains('[type="submit"]', 'Done').click(); | ||
}); | ||
cy.get('.cvat-notification-notice-update-task-failed') | ||
.should('exist') | ||
.and('contain.text', 'label names must be unique'); | ||
}); | ||
}); | ||
}); |