-
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.
- Loading branch information
Showing
17 changed files
with
262 additions
and
20 deletions.
There are no files selected for viewing
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
69 changes: 69 additions & 0 deletions
69
...ress/integration/actions_tasks_objects/case_40_create_task_without_necessary_arguments.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,69 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
context('Try to create a task without necessary arguments.', () => { | ||
const caseId = '40'; | ||
const labelName = `Case ${caseId}`; | ||
const taskName = `New annotation task for ${labelName}`; | ||
const imagesCount = 1; | ||
const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`; | ||
const width = 800; | ||
const height = 800; | ||
const posX = 10; | ||
const posY = 10; | ||
const color = 'gray'; | ||
const archiveName = `${imageFileName}.zip`; | ||
const archivePath = `cypress/fixtures/${archiveName}`; | ||
const imagesFolder = `cypress/fixtures/${imageFileName}`; | ||
const directoryToArchive = imagesFolder; | ||
|
||
before(() => { | ||
cy.visit('auth/login'); | ||
cy.login(); | ||
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount); | ||
cy.createZipArchive(directoryToArchive, archivePath); | ||
cy.get('#cvat-create-task-button').click(); | ||
}); | ||
|
||
after(() => { | ||
cy.goToTaskList(); | ||
cy.getTaskID(taskName).then(($taskID) => { | ||
cy.deleteTask(taskName, $taskID); | ||
}); | ||
}); | ||
|
||
describe(`Testing "${labelName}"`, () => { | ||
it('Try to create a task without any fields. A task is not created.', () => { | ||
cy.get('.cvat-create-task-submit-section').click(); | ||
cy.get('.cvat-notification-create-task-fail').should('exist'); | ||
cy.closeNotification('.cvat-notification-create-task-fail'); | ||
}); | ||
|
||
it('Input a task name. A task is not created.', () => { | ||
cy.get('[id="name"]').type(taskName); | ||
cy.get('.cvat-create-task-submit-section').click(); | ||
cy.get('.cvat-notification-create-task-fail').should('exist'); | ||
cy.closeNotification('.cvat-notification-create-task-fail'); | ||
}); | ||
|
||
it('Input task labels. A task is not created.', () => { | ||
cy.addNewLabel(labelName); | ||
cy.get('.cvat-create-task-submit-section').click(); | ||
cy.get('.cvat-notification-create-task-fail').should('exist'); | ||
cy.closeNotification('.cvat-notification-create-task-fail'); | ||
}); | ||
|
||
it('Add some files. A task created.', () => { | ||
cy.get('input[type="file"]').attachFile(archiveName, { subjectType: 'drag-n-drop' }); | ||
cy.get('.cvat-create-task-submit-section').click(); | ||
cy.get('.cvat-notification-create-task-fail').should('not.exist'); | ||
cy.get('.cvat-notification-create-task-success').should('exist'); | ||
// Check that the interface is prepared for creating the next task. | ||
cy.get('[id="name"]').should('have.value', ''); | ||
cy.get('.cvat-constructor-viewer-item').should('not.exist'); | ||
}); | ||
}); | ||
}); |
48 changes: 48 additions & 0 deletions
48
...ress/integration/actions_tasks_objects/case_42_change_label_name_via_label_constructor.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,48 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
context('Changing a label name via label constructor.', () => { | ||
const caseId = '42'; | ||
const firstLabelName = `First case ${caseId}`; | ||
const secondLabelName = `Second case ${caseId}`; | ||
|
||
before(() => { | ||
cy.visit('auth/login'); | ||
cy.login(); | ||
cy.get('#cvat-create-task-button').click(); | ||
}); | ||
|
||
describe(`Testing case "${caseId}"`, () => { | ||
it('Set empty label name. Press "Done" button. Alert exist.', () => { | ||
cy.get('.cvat-constructor-viewer-new-item').click(); // Open label constructor | ||
cy.contains('[type="submit"]', 'Done').click(); | ||
cy.contains('[role="alert"]', 'Please specify a name').should('exist').and('be.visible'); | ||
}); | ||
|
||
it('Change label name to any other correct value. Press "Done" button. The label created.', () => { | ||
cy.get('[placeholder="Label name"]').type(firstLabelName); | ||
cy.contains('[type="submit"]', 'Done').click({ force: true }); | ||
cy.get('.cvat-constructor-viewer-item').should('exist').and('have.text', firstLabelName); | ||
}); | ||
|
||
it('Change label name to any other correct value. Press "Cancel". Label name is not changed.', () => { | ||
cy.get('.cvat-constructor-viewer-item').find('[aria-label="edit"]').click(); | ||
cy.get('[placeholder="Label name"]').clear().type(secondLabelName); | ||
cy.contains('[type="button"]', 'Cancel').click(); | ||
cy.get('.cvat-constructor-viewer-item').should('exist').and('have.text', firstLabelName); | ||
}); | ||
|
||
it('Change label name to any other correct value. Press "Done". Label name changed.', () => { | ||
cy.get('.cvat-constructor-viewer-item').find('[aria-label="edit"]').click(); | ||
cy.get('[placeholder="Label name"]').clear().type(secondLabelName); | ||
cy.contains('[type="submit"]', 'Done').click(); | ||
cy.get('.cvat-constructor-viewer-item') | ||
.should('exist') | ||
.and('have.length', 1) | ||
.and('have.text', secondLabelName); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.