From b21c6e59bec3cbc4cf6ecb09a9fb695aa12e208a Mon Sep 17 00:00:00 2001 From: dvkruchinin Date: Fri, 17 Dec 2021 14:37:13 +0300 Subject: [PATCH] Upate case 1. Added check label color. --- ... case_1_create_delete_task_label_color.js} | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) rename tests/cypress/integration/actions_tasks3/{case_1_create_delete_task.js => case_1_create_delete_task_label_color.js} (56%) diff --git a/tests/cypress/integration/actions_tasks3/case_1_create_delete_task.js b/tests/cypress/integration/actions_tasks3/case_1_create_delete_task_label_color.js similarity index 56% rename from tests/cypress/integration/actions_tasks3/case_1_create_delete_task.js rename to tests/cypress/integration/actions_tasks3/case_1_create_delete_task_label_color.js index 03583af1ebdc..cc66a43ed41c 100644 --- a/tests/cypress/integration/actions_tasks3/case_1_create_delete_task.js +++ b/tests/cypress/integration/actions_tasks3/case_1_create_delete_task_label_color.js @@ -4,14 +4,14 @@ /// -context('Create and delete a annotation task', () => { +context('Create and delete a annotation task. Color collision.', () => { const caseId = '1'; - const labelName = `Case ${caseId}`; - const taskName = `New annotation task for ${labelName}`; - const attrName = `Attr for ${labelName}`; + const labelName = 'adaf'; + const taskName = `New annotation task for Case ${caseId}`; + const attrName = `Attr for Case ${caseId}`; const textDefaultValue = 'Some default value for type Text'; const imagesCount = 1; - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`; + const imageFileName = 'image_case_1'; const width = 800; const height = 800; const posX = 10; @@ -21,6 +21,7 @@ context('Create and delete a annotation task', () => { const archivePath = `cypress/fixtures/${archiveName}`; const imagesFolder = `cypress/fixtures/${imageFileName}`; const directoryToArchive = imagesFolder; + const newLabelName = 'adia'; before(() => { cy.visit('auth/login'); @@ -29,15 +30,27 @@ context('Create and delete a annotation task', () => { cy.createZipArchive(directoryToArchive, archivePath); }); - describe(`Testing "${labelName}"`, () => { - it('Create a task', () => { + describe(`Testing "Case ${caseId}"`, () => { + it('Create a task.', () => { 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); }); - it('Deleted task not exist', () => { + + it('Deleted task not exist.', () => { cy.contains('strong', taskName) .parents('.cvat-tasks-list-item') .should('have.attr', 'style')