|
|
|
@ -4,14 +4,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
|
|
|
|
|
|
|
|
context('Create and delete a annotation task', () => {
|
|
|
|
context('Create and delete a annotation task. Color collision.', () => {
|
|
|
|
const caseId = '1';
|
|
|
|
const caseId = '1';
|
|
|
|
const labelName = `Case ${caseId}`;
|
|
|
|
const labelName = 'adaf';
|
|
|
|
const taskName = `New annotation task for ${labelName}`;
|
|
|
|
const taskName = `New annotation task for Case ${caseId}`;
|
|
|
|
const attrName = `Attr for ${labelName}`;
|
|
|
|
const attrName = `Attr for Case ${caseId}`;
|
|
|
|
const textDefaultValue = 'Some default value for type Text';
|
|
|
|
const textDefaultValue = 'Some default value for type Text';
|
|
|
|
const imagesCount = 1;
|
|
|
|
const imagesCount = 1;
|
|
|
|
const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`;
|
|
|
|
const imageFileName = 'image_case_1';
|
|
|
|
const width = 800;
|
|
|
|
const width = 800;
|
|
|
|
const height = 800;
|
|
|
|
const height = 800;
|
|
|
|
const posX = 10;
|
|
|
|
const posX = 10;
|
|
|
|
@ -21,6 +21,7 @@ context('Create and delete a annotation task', () => {
|
|
|
|
const archivePath = `cypress/fixtures/${archiveName}`;
|
|
|
|
const archivePath = `cypress/fixtures/${archiveName}`;
|
|
|
|
const imagesFolder = `cypress/fixtures/${imageFileName}`;
|
|
|
|
const imagesFolder = `cypress/fixtures/${imageFileName}`;
|
|
|
|
const directoryToArchive = imagesFolder;
|
|
|
|
const directoryToArchive = imagesFolder;
|
|
|
|
|
|
|
|
const newLabelName = 'adia';
|
|
|
|
|
|
|
|
|
|
|
|
before(() => {
|
|
|
|
before(() => {
|
|
|
|
cy.visit('auth/login');
|
|
|
|
cy.visit('auth/login');
|
|
|
|
@ -29,15 +30,27 @@ context('Create and delete a annotation task', () => {
|
|
|
|
cy.createZipArchive(directoryToArchive, archivePath);
|
|
|
|
cy.createZipArchive(directoryToArchive, archivePath);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
describe(`Testing "${labelName}"`, () => {
|
|
|
|
describe(`Testing "Case ${caseId}"`, () => {
|
|
|
|
it('Create a task', () => {
|
|
|
|
it('Create a task.', () => {
|
|
|
|
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName);
|
|
|
|
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it('Delete the created task', () => {
|
|
|
|
it('Add a label. Check labels color.', () => {
|
|
|
|
|
|
|
|
cy.openTask(taskName);
|
|
|
|
|
|
|
|
cy.addNewLabel(newLabelName);
|
|
|
|
|
|
|
|
cy.get('.cvat-constructor-viewer-item').first().then((firstLabel) => {
|
|
|
|
|
|
|
|
cy.get('.cvat-constructor-viewer-item').last().then((secondLabel) => {
|
|
|
|
|
|
|
|
expect(firstLabel.attr('style')).not.equal(secondLabel.attr('style'));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('Delete the created task.', () => {
|
|
|
|
|
|
|
|
cy.goToTaskList();
|
|
|
|
cy.deleteTask(taskName);
|
|
|
|
cy.deleteTask(taskName);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
it('Deleted task not exist', () => {
|
|
|
|
|
|
|
|
|
|
|
|
it('Deleted task not exist.', () => {
|
|
|
|
cy.contains('strong', taskName)
|
|
|
|
cy.contains('strong', taskName)
|
|
|
|
.parents('.cvat-tasks-list-item')
|
|
|
|
.parents('.cvat-tasks-list-item')
|
|
|
|
.should('have.attr', 'style')
|
|
|
|
.should('have.attr', 'style')
|