diff --git a/tests/cypress.json b/tests/cypress.json index ae0fabb2..bea679a4 100644 --- a/tests/cypress.json +++ b/tests/cypress.json @@ -10,9 +10,8 @@ }, "testFiles": [ "auth_page.js", - "issue_*.js", - "pr_*.js", - "case_*.js", + "actions_tasks_objects/*", + "actions_users/*", "remove_users_tasks.js" ] } diff --git a/tests/cypress/integration/case_10_polygon_shape_track_label_points.js b/tests/cypress/integration/actions_tasks_objects/case_10_polygon_shape_track_label_points.js similarity index 87% rename from tests/cypress/integration/case_10_polygon_shape_track_label_points.js rename to tests/cypress/integration/actions_tasks_objects/case_10_polygon_shape_track_label_points.js index 7e071197..e076b44e 100644 --- a/tests/cypress/integration/case_10_polygon_shape_track_label_points.js +++ b/tests/cypress/integration/actions_tasks_objects/case_10_polygon_shape_track_label_points.js @@ -6,21 +6,12 @@ /// +import {taskName, labelName} from '../../support/const' + context('Actions on polygon', () => { const caseId = '10' - const labelName = `Case ${caseId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - const image = `${imageFileName}.png` - const newLabelName = `New ${labelName}` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' + const newLabelName = `New label for case ${caseId}` const createPolygonShape = { reDraw: false, type: 'Shape', @@ -99,10 +90,6 @@ context('Actions on polygon', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTask(taskName) }) @@ -166,7 +153,7 @@ context('Actions on polygon', () => { cy.get('#cvat-objects-sidebar-state-item-6') .should('contain', '6').and('contain', 'POLYGON TRACK').within(() => { cy.get('.ant-select-selection-selected-value') - .should('contain', labelName) + .should('contain', newLabelName) }) }) }) diff --git a/tests/cypress/integration/case_11_polylines_shape_track_label_points.js b/tests/cypress/integration/actions_tasks_objects/case_11_polylines_shape_track_label_points.js similarity index 86% rename from tests/cypress/integration/case_11_polylines_shape_track_label_points.js rename to tests/cypress/integration/actions_tasks_objects/case_11_polylines_shape_track_label_points.js index 914f9e6b..521a970d 100644 --- a/tests/cypress/integration/case_11_polylines_shape_track_label_points.js +++ b/tests/cypress/integration/actions_tasks_objects/case_11_polylines_shape_track_label_points.js @@ -7,21 +7,12 @@ /// +import {taskName, labelName} from '../../support/const' + context('Actions on polylines', () => { const caseId = '11' - const labelName = `Case ${caseId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - const image = `${imageFileName}.png` - const newLabelName = `New ${labelName}` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' + const newLabelName = `New label for case ${caseId}` const createPolylinesShape = { type: 'Shape', switchLabel: false, @@ -94,10 +85,6 @@ context('Actions on polylines', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTask(taskName) }) @@ -161,7 +148,7 @@ context('Actions on polylines', () => { cy.get('#cvat-objects-sidebar-state-item-6') .should('contain', '6').and('contain', 'POLYLINE TRACK').within(() => { cy.get('.ant-select-selection-selected-value') - .should('contain', labelName) + .should('contain', newLabelName) }) }) }) diff --git a/tests/cypress/integration/case_12_points_shape_track_label.js b/tests/cypress/integration/actions_tasks_objects/case_12_points_shape_track_label.js similarity index 86% rename from tests/cypress/integration/case_12_points_shape_track_label.js rename to tests/cypress/integration/actions_tasks_objects/case_12_points_shape_track_label.js index ae7eeb6c..0297980b 100644 --- a/tests/cypress/integration/case_12_points_shape_track_label.js +++ b/tests/cypress/integration/actions_tasks_objects/case_12_points_shape_track_label.js @@ -6,21 +6,12 @@ /// +import {taskName, labelName} from '../../support/const' + context('Actions on points', () => { const caseId = '12' - const labelName = `Case ${caseId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - const image = `${imageFileName}.png` - const newLabelName = `New ${labelName}` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' + const newLabelName = `New label for case ${caseId}` const createPointsShape = { type: 'Shape', switchLabel: false, @@ -93,10 +84,6 @@ context('Actions on points', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTask(taskName) }) @@ -160,7 +147,7 @@ context('Actions on points', () => { cy.get('#cvat-objects-sidebar-state-item-6') .should('contain', '6').and('contain', 'POINTS TRACK').within(() => { cy.get('.ant-select-selection-selected-value') - .should('contain', labelName) + .should('contain', newLabelName) }) }) }) diff --git a/tests/cypress/integration/case_3_task_start_stop_step_frame.js b/tests/cypress/integration/actions_tasks_objects/case_3_task_start_stop_step_frame.js similarity index 90% rename from tests/cypress/integration/case_3_task_start_stop_step_frame.js rename to tests/cypress/integration/actions_tasks_objects/case_3_task_start_stop_step_frame.js index 9203afe1..bc21d27e 100644 --- a/tests/cypress/integration/case_3_task_start_stop_step_frame.js +++ b/tests/cypress/integration/actions_tasks_objects/case_3_task_start_stop_step_frame.js @@ -15,10 +15,6 @@ context('Check if parameters "startFrame", "stopFrame", "frameStep" works as exp const textDefaultValue = 'Some default value for type Text' const imagesCount = 10 const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - let images = [] - for ( let i = 1; i <= imagesCount; i++) { - images.push(`${imageFileName}_${i}.png`) - } const width = 800 const height = 800 const posX = 10 @@ -39,12 +35,17 @@ context('Check if parameters "startFrame", "stopFrame", "frameStep" works as exp before(() => { cy.visit('auth/login') cy.login() - for (let img of images) { - cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) - } + cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount) cy.createZipArchive(directoryToArchive, archivePath) }) + after(() => { + cy.goToTaskList() + cy.getTaskID(taskName).then($taskID => { + cy.deleteTask(taskName, $taskID) + }) + }) + describe(`Testing "${labelName}"`, () => { it('Create a task. Open the task.', () => { cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName, diff --git a/tests/cypress/integration/case_5_image_rotate.js b/tests/cypress/integration/actions_tasks_objects/case_5_image_rotate.js similarity index 76% rename from tests/cypress/integration/case_5_image_rotate.js rename to tests/cypress/integration/actions_tasks_objects/case_5_image_rotate.js index accbcb65..788a2198 100644 --- a/tests/cypress/integration/case_5_image_rotate.js +++ b/tests/cypress/integration/actions_tasks_objects/case_5_image_rotate.js @@ -6,20 +6,11 @@ /// +import {taskName} from '../../support/const' + context('Check if the image is rotated', () => { const caseId = '5' - const labelName = `Case ${caseId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - const image = `${imageFileName}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' function imageRotate(direction='anticlockwise') { cy.get('.cvat-rotate-canvas-control') .trigger('mouseover') @@ -33,14 +24,10 @@ context('Check if the image is rotated', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) - describe(`Testing "${labelName}"`, () => { + describe(`Testing case "${caseId}"`, () => { it('Rotate image clockwise 90deg', () => { imageRotate('clockwise') cy.get('#cvat_canvas_background') diff --git a/tests/cypress/integration/case_6_image_scale_fit.js b/tests/cypress/integration/actions_tasks_objects/case_6_image_scale_fit.js similarity index 61% rename from tests/cypress/integration/case_6_image_scale_fit.js rename to tests/cypress/integration/actions_tasks_objects/case_6_image_scale_fit.js index ec872936..9dc7429b 100644 --- a/tests/cypress/integration/case_6_image_scale_fit.js +++ b/tests/cypress/integration/actions_tasks_objects/case_6_image_scale_fit.js @@ -6,32 +6,19 @@ /// +import {taskName} from '../../support/const' + context('Check if the image is scaled and then fitted', () => { const caseId = '6' - const labelName = `Case ${caseId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - const image = `${imageFileName}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' let scaleBefore = 0 let scaleAfter = 0 before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) - describe(`Testing "${labelName}"`, () => { + describe(`Testing case "${caseId}"`, () => { it('Scale image', () => { cy.get('#cvat_canvas_background') .should('have.attr', 'style') diff --git a/tests/cypress/integration/case_7_image_scale_roi.js b/tests/cypress/integration/actions_tasks_objects/case_7_image_scale_roi.js similarity index 61% rename from tests/cypress/integration/case_7_image_scale_roi.js rename to tests/cypress/integration/actions_tasks_objects/case_7_image_scale_roi.js index 9bc2fc29..979e72c4 100644 --- a/tests/cypress/integration/case_7_image_scale_roi.js +++ b/tests/cypress/integration/actions_tasks_objects/case_7_image_scale_roi.js @@ -6,32 +6,19 @@ /// +import {taskName} from '../../support/const' + context('Check if image was scaled to ROI', () => { const caseId = '7' - const labelName = `Case ${caseId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - const image = `${imageFileName}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' let scaleBefore = 0 let scaleAfter = 0 before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) - describe(`Testing "${labelName}"`, () => { + describe(`Testing case "${caseId}"`, () => { it('Create ROI', () => { cy.get('#cvat_canvas_background') .should('have.attr', 'style') diff --git a/tests/cypress/integration/case_8_rectangle_shape_track_label.js b/tests/cypress/integration/actions_tasks_objects/case_8_rectangle_shape_track_label.js similarity index 89% rename from tests/cypress/integration/case_8_rectangle_shape_track_label.js rename to tests/cypress/integration/actions_tasks_objects/case_8_rectangle_shape_track_label.js index 63dedc74..505d3aeb 100644 --- a/tests/cypress/integration/case_8_rectangle_shape_track_label.js +++ b/tests/cypress/integration/actions_tasks_objects/case_8_rectangle_shape_track_label.js @@ -6,21 +6,12 @@ /// +import {taskName, labelName} from '../../support/const' + context('Actions on rectangle', () => { const caseId = '8' - const labelName = `Case ${caseId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - const image = `${imageFileName}.png` - const newLabelName = `New ${labelName}` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' + const newLabelName = `New label for case ${caseId}` const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -91,10 +82,6 @@ context('Actions on rectangle', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTask(taskName) }) diff --git a/tests/cypress/integration/case_9_cuboid_shape_track_label.js b/tests/cypress/integration/actions_tasks_objects/case_9_cuboid_shape_track_label.js similarity index 88% rename from tests/cypress/integration/case_9_cuboid_shape_track_label.js rename to tests/cypress/integration/actions_tasks_objects/case_9_cuboid_shape_track_label.js index 3d594c98..d4f2e096 100644 --- a/tests/cypress/integration/case_9_cuboid_shape_track_label.js +++ b/tests/cypress/integration/actions_tasks_objects/case_9_cuboid_shape_track_label.js @@ -6,21 +6,12 @@ /// +import {taskName, labelName} from '../../support/const' + context('Actions on Cuboid', () => { const caseId = '9' - const labelName = `Case ${caseId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` - const image = `${imageFileName}.png` - const newLabelName = `New ${labelName}` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' + const newLabelName = `New label for case ${caseId}` const createCuboidShape2Points = { points: 'From rectangle', type: 'Shape', @@ -91,10 +82,6 @@ context('Actions on Cuboid', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTask(taskName) }) diff --git a/tests/cypress/integration/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js b/tests/cypress/integration/actions_tasks_objects/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js similarity index 75% rename from tests/cypress/integration/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js rename to tests/cypress/integration/actions_tasks_objects/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js index cf91293e..4736b1e1 100644 --- a/tests/cypress/integration/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1216_Check_if_UI_not_fails_with_shape_dragging_over_sidebar.js @@ -6,19 +6,11 @@ /// +import {taskName} from '../../support/const' + context('Check if UI not fails with shape dragging over sidebar', () => { const issueId = '1216' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -39,10 +31,6 @@ context('Check if UI not fails with shape dragging over sidebar', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1368_points_track_invisible_next_frame.js b/tests/cypress/integration/actions_tasks_objects/issue_1368_points_track_invisible_next_frame.js similarity index 55% rename from tests/cypress/integration/issue_1368_points_track_invisible_next_frame.js rename to tests/cypress/integration/actions_tasks_objects/issue_1368_points_track_invisible_next_frame.js index 549713db..ff7e271c 100644 --- a/tests/cypress/integration/issue_1368_points_track_invisible_next_frame.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1368_points_track_invisible_next_frame.js @@ -6,25 +6,11 @@ /// +import { taskName } from '../../support/const' + context('Points track it is still invisible on next frames', () => { const issueId = '1368' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const images = [`image_${issueId}_1.png`, - `image_${issueId}_2.png`, - `image_${issueId}_3.png`] - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'white' - const archiveName = `images_issue_${issueId}.zip` - const archivePath = `cypress/fixtures/${archiveName}` - const imagesFolder = `cypress/fixtures/image_issue_${issueId}` - const directoryToArchive = imagesFolder const createPointsTrack = { type: 'Track', switchLabel: false, @@ -36,13 +22,6 @@ context('Points track it is still invisible on next frames', () => { } before(() => { - cy.visit('auth/login') - cy.login() - for (let img of images) { - cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) - } - cy.createZipArchive(directoryToArchive, archivePath) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1391_delete_point.js b/tests/cypress/integration/actions_tasks_objects/issue_1391_delete_point.js similarity index 81% rename from tests/cypress/integration/issue_1391_delete_point.js rename to tests/cypress/integration/actions_tasks_objects/issue_1391_delete_point.js index 78d496f0..b34d4712 100644 --- a/tests/cypress/integration/issue_1391_delete_point.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1391_delete_point.js @@ -6,19 +6,11 @@ /// +import { taskName } from '../../support/const' + context('When delete a point, the required point is deleted.', () => { const issueId = '1391' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'white' let pointsСoordinatesBeforeDeletePoint = [] let pointsСoordinatesAfterDeletePoint = [] const createPolylinesShape = { @@ -34,10 +26,6 @@ context('When delete a point, the required point is deleted.', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1425_highlighted_attribute_correspond_chosen_attribute.js b/tests/cypress/integration/actions_tasks_objects/issue_1425_highlighted_attribute_correspond_chosen_attribute.js similarity index 67% rename from tests/cypress/integration/issue_1425_highlighted_attribute_correspond_chosen_attribute.js rename to tests/cypress/integration/actions_tasks_objects/issue_1425_highlighted_attribute_correspond_chosen_attribute.js index 3edad91f..3ebfa939 100644 --- a/tests/cypress/integration/issue_1425_highlighted_attribute_correspond_chosen_attribute.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1425_highlighted_attribute_correspond_chosen_attribute.js @@ -6,24 +6,11 @@ /// +import { taskName } from '../../support/const' + context('The highlighted attribute in AAM should correspond to the chosen attribute', () => { const issueId = '1425' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' - const multiAttrParams = { - additionalAttrName: `Attr 2`, - additionalValue: `Attr value 2`, - typeAttribute: 'Text' - } let textValue = '' const createRectangleShape2Points = { points: 'By 2 Points', @@ -36,15 +23,11 @@ context('The highlighted attribute in AAM should correspond to the chosen attrib } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) + cy.openTaskJob(taskName) }) describe(`Testing issue "${issueId}"`, () => { - it('Create a task with multiple attributes, create a object', () => { - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image, multiAttrParams) - cy.openTaskJob(taskName) + it('Create a object', () => { cy.createRectangle(createRectangleShape2Points) }) it('Go to AAM', () => { diff --git a/tests/cypress/integration/issue_1429_check_new_label.js b/tests/cypress/integration/actions_tasks_objects/issue_1429_check_new_label.js similarity index 69% rename from tests/cypress/integration/issue_1429_check_new_label.js rename to tests/cypress/integration/actions_tasks_objects/issue_1429_check_new_label.js index 65a7937b..54a97dd2 100644 --- a/tests/cypress/integration/issue_1429_check_new_label.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1429_check_new_label.js @@ -6,20 +6,13 @@ /// +import { taskName } from '../../support/const' + context('Check if the new label reflects in the options', () => { const issueId = '1429' const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` const newLabelName = `New ${labelName}` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -31,16 +24,10 @@ context('Check if the new label reflects in the options', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) + cy.openTaskJob(taskName) }) describe(`Testing issue "${issueId}"`, () => { - it('Open a task. Open a job', () => { - cy.openTaskJob(taskName) - }) it('Return to task page using browser button "previous page"', () => { cy.go('back') cy.url().should('include', '/tasks').and('not.contain', '/jobs') diff --git a/tests/cypress/integration/issue_1433_hide_functionality.js b/tests/cypress/integration/actions_tasks_objects/issue_1433_hide_functionality.js similarity index 54% rename from tests/cypress/integration/issue_1433_hide_functionality.js rename to tests/cypress/integration/actions_tasks_objects/issue_1433_hide_functionality.js index f65970b2..b1b5e1fa 100644 --- a/tests/cypress/integration/issue_1433_hide_functionality.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1433_hide_functionality.js @@ -6,19 +6,11 @@ /// +import { taskName } from '../../support/const' + context('Check hide functionality (H)', () => { const issueId = '1433' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -30,16 +22,12 @@ context('Check hide functionality (H)', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) - cy.createRectangle(createRectangleShape2Points) }) describe(`Testing issue "${issueId}"`, () => { it('Object is hidden', () => { + cy.createRectangle(createRectangleShape2Points) cy.get('#cvat_canvas_shape_1') .trigger('mousemove') .trigger('mouseover') diff --git a/tests/cypress/integration/issue_1438_cancel_multiple_paste_ui_not_lock.js b/tests/cypress/integration/actions_tasks_objects/issue_1438_cancel_multiple_paste_ui_not_lock.js similarity index 62% rename from tests/cypress/integration/issue_1438_cancel_multiple_paste_ui_not_lock.js rename to tests/cypress/integration/actions_tasks_objects/issue_1438_cancel_multiple_paste_ui_not_lock.js index 0b3e7337..bad4c0c6 100644 --- a/tests/cypress/integration/issue_1438_cancel_multiple_paste_ui_not_lock.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1438_cancel_multiple_paste_ui_not_lock.js @@ -6,19 +6,11 @@ /// +import { taskName } from '../../support/const' + context('Cancel "multiple paste". UI is not locked.', () => { const issueId = '1438' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -30,16 +22,12 @@ context('Cancel "multiple paste". UI is not locked.', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) - cy.createRectangle(createRectangleShape2Points) }) describe(`Testing issue "${issueId}"`, () => { it('Copy, paste opject. Cancel pasting.', () => { + cy.createRectangle(createRectangleShape2Points) cy.get('#cvat_canvas_shape_1') .trigger('mousemove') .trigger('mouseover') diff --git a/tests/cypress/integration/issue_1439_blocked_object_info.js b/tests/cypress/integration/actions_tasks_objects/issue_1439_blocked_object_info.js similarity index 74% rename from tests/cypress/integration/issue_1439_blocked_object_info.js rename to tests/cypress/integration/actions_tasks_objects/issue_1439_blocked_object_info.js index 3aa9623a..ca036110 100644 --- a/tests/cypress/integration/issue_1439_blocked_object_info.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1439_blocked_object_info.js @@ -6,19 +6,11 @@ /// +import { taskName, labelName } from '../../support/const' + context('Information about a blocked object disappears if hover the cursor over another object', () => { const issueId = '1439' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -39,17 +31,13 @@ context('Information about a blocked object disappears if hover the cursor over } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) describe(`Testing issue "${issueId}"`, () => { it('Create multiple objects', () => { cy.createRectangle(createRectangleShape2Points) - cy.createRectangle(createRectangleShape2PointsSecond) + cy.createRectangle(createRectangleShape2PointsSecond) }) it('Lock all objects', () => { cy.get('.cvat-objects-sidebar-states-header') diff --git a/tests/cypress/integration/issue_1444_filter_property_shape.js b/tests/cypress/integration/actions_tasks_objects/issue_1444_filter_property_shape.js similarity index 73% rename from tests/cypress/integration/issue_1444_filter_property_shape.js rename to tests/cypress/integration/actions_tasks_objects/issue_1444_filter_property_shape.js index 447e06f2..d2f5a07e 100644 --- a/tests/cypress/integration/issue_1444_filter_property_shape.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1444_filter_property_shape.js @@ -6,19 +6,11 @@ /// +import { taskName } from '../../support/const' + context('Filter property "shape" work correctly', () => { const issueId = '1444' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'white' const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -42,10 +34,6 @@ context('Filter property "shape" work correctly', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1498_message_ui_raw_labels_wrong.js b/tests/cypress/integration/actions_tasks_objects/issue_1498_message_ui_raw_labels_wrong.js similarity index 96% rename from tests/cypress/integration/issue_1498_message_ui_raw_labels_wrong.js rename to tests/cypress/integration/actions_tasks_objects/issue_1498_message_ui_raw_labels_wrong.js index ca6a50bb..68a6e1ec 100644 --- a/tests/cypress/integration/issue_1498_message_ui_raw_labels_wrong.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1498_message_ui_raw_labels_wrong.js @@ -6,12 +6,11 @@ /// +import { taskName, labelName, attrName, textDefaultValue } from '../../support/const' + context('Message in UI when raw labels are wrong.', () => { const issueId = '1498' - const labelName = `Issue ${issueId}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' let taskRaw = [ { name: labelName, @@ -32,10 +31,7 @@ context('Message in UI when raw labels are wrong.', () => { ] before(() => { - cy.visit('auth/login') - cy.login() - cy.get('#cvat-create-task-button').click() - cy.url().should('include', '/tasks/create') + cy.openTask(taskName) cy.get('[role="tab"]').contains('Raw').click() }) diff --git a/tests/cypress/integration/issue_1540_add_remove_tag.js b/tests/cypress/integration/actions_tasks_objects/issue_1540_add_remove_tag.js similarity index 64% rename from tests/cypress/integration/issue_1540_add_remove_tag.js rename to tests/cypress/integration/actions_tasks_objects/issue_1540_add_remove_tag.js index 683985b6..8137e199 100644 --- a/tests/cypress/integration/issue_1540_add_remove_tag.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1540_add_remove_tag.js @@ -6,25 +6,13 @@ /// +import { taskName } from '../../support/const' + context('Check if the UI not to crash after remove a tag', () => { const issueId = '1540' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1568_cuboid_dump_annotation.js b/tests/cypress/integration/actions_tasks_objects/issue_1568_cuboid_dump_annotation.js similarity index 66% rename from tests/cypress/integration/issue_1568_cuboid_dump_annotation.js rename to tests/cypress/integration/actions_tasks_objects/issue_1568_cuboid_dump_annotation.js index 2a7ea283..97a4ff68 100644 --- a/tests/cypress/integration/issue_1568_cuboid_dump_annotation.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1568_cuboid_dump_annotation.js @@ -6,19 +6,11 @@ /// +import { taskName } from '../../support/const' + context('Dump annotation if cuboid created', () => { const issueId = '1568' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' const createCuboidShape2Points = { points: 'From rectangle', type: 'Shape', @@ -29,14 +21,20 @@ context('Dump annotation if cuboid created', () => { secondY: 450 } + function save() { + cy.get('button').contains('Save') + .click({force: true}) + } + before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) + after('Go to task list', () => { + cy.removeAnnotations() + save() + }) + describe(`Testing issue "${issueId}"`, () => { it('Create a cuboid', () => { cy.createCuboid(createCuboidShape2Points) @@ -45,9 +43,7 @@ context('Dump annotation if cuboid created', () => { }) it('Dump an annotation', () => { cy.get('.cvat-annotation-header-left-group').within(() => { - cy.get('[title="Save current changes [Ctrl+S]"]') - cy.get('button').contains('Save') - .click({force: true}) + save() cy.get('button').contains('Menu') .trigger('mouseover',{force: true}) }) diff --git a/tests/cypress/integration/issue_1750_err_aam_switch_frames.js b/tests/cypress/integration/actions_tasks_objects/issue_1750_err_aam_switch_frames.js similarity index 71% rename from tests/cypress/integration/issue_1750_err_aam_switch_frames.js rename to tests/cypress/integration/actions_tasks_objects/issue_1750_err_aam_switch_frames.js index c0b714e4..c325d463 100644 --- a/tests/cypress/integration/issue_1750_err_aam_switch_frames.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1750_err_aam_switch_frames.js @@ -6,25 +6,11 @@ /// +import { taskName, labelName } from '../../support/const' + context('An error occurs in AAM when switching to 2 frames, if the frames have objects created in shape mode', () => { const issueId = '1750' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const images = [`image_${issueId}_1.png`, - `image_${issueId}_2.png`, - `image_${issueId}_3.png`] - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' - const archiveName = `images_issue_${issueId}.zip` - const archivePath = `cypress/fixtures/${archiveName}` - const imagesFolder = `cypress/fixtures/image_issue_${issueId}` - const directoryToArchive = imagesFolder const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -45,13 +31,6 @@ context('An error occurs in AAM when switching to 2 frames, if the frames have o } before(() => { - cy.visit('auth/login') - cy.login() - for (let img of images) { - cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) - } - cy.createZipArchive(directoryToArchive, archivePath) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1785_propagation_latest_frame.js b/tests/cypress/integration/actions_tasks_objects/issue_1785_propagation_latest_frame.js similarity index 53% rename from tests/cypress/integration/issue_1785_propagation_latest_frame.js rename to tests/cypress/integration/actions_tasks_objects/issue_1785_propagation_latest_frame.js index ff5b06ab..741c126c 100644 --- a/tests/cypress/integration/issue_1785_propagation_latest_frame.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1785_propagation_latest_frame.js @@ -6,25 +6,11 @@ /// +import { taskName, advancedConfigurationParams } from '../../support/const' + context('Check propagation work from the latest frame', () => { const issueId = '1785' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const images = [`image_${issueId}_1.png`, - `image_${issueId}_2.png`, - `image_${issueId}_3.png`] - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' - const archiveName = `images_issue_${issueId}.zip` - const archivePath = `cypress/fixtures/${archiveName}` - const imagesFolder = `cypress/fixtures/image_issue_${issueId}` - const directoryToArchive = imagesFolder const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -36,13 +22,6 @@ context('Check propagation work from the latest frame', () => { } before(() => { - cy.visit('auth/login') - cy.login() - for (let img of images) { - cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) - } - cy.createZipArchive(directoryToArchive, archivePath) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) cy.openTaskJob(taskName) }) @@ -52,7 +31,7 @@ context('Check propagation work from the latest frame', () => { .click() cy.get('.cvat-player-frame-selector').within(() => { cy.get('input[role="spinbutton"]') - .should('have.value', '2') + .should('have.value', advancedConfigurationParams.segmentSize - 1) }) }) it('Create a rectangle shape', () => { diff --git a/tests/cypress/integration/issue_1819_first_part_splitted_track_visible.js b/tests/cypress/integration/actions_tasks_objects/issue_1819_first_part_splitted_track_visible.js similarity index 58% rename from tests/cypress/integration/issue_1819_first_part_splitted_track_visible.js rename to tests/cypress/integration/actions_tasks_objects/issue_1819_first_part_splitted_track_visible.js index 73b0400f..8f5f83bf 100644 --- a/tests/cypress/integration/issue_1819_first_part_splitted_track_visible.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1819_first_part_splitted_track_visible.js @@ -6,25 +6,11 @@ /// +import { taskName, advancedConfigurationParams } from '../../support/const' + context('First part of a splitted track is visible', () => { const issueId = '1819' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const images = [`image_${issueId}_1.png`, - `image_${issueId}_2.png`, - `image_${issueId}_3.png`] - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' - const archiveName = `images_issue_${issueId}.zip` - const archivePath = `cypress/fixtures/${archiveName}` - const imagesFolder = `cypress/fixtures/image_issue_${issueId}` - const directoryToArchive = imagesFolder const createRectangleTrack2Points = { points: 'By 2 Points', type: 'Track', @@ -36,13 +22,6 @@ context('First part of a splitted track is visible', () => { } before(() => { - cy.visit('auth/login') - cy.login() - for (let img of images) { - cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) - } - cy.createZipArchive(directoryToArchive, archivePath) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) cy.openTaskJob(taskName) }) @@ -55,7 +34,7 @@ context('First part of a splitted track is visible', () => { .click() cy.get('.cvat-player-frame-selector').within(() => { cy.get('input[role="spinbutton"]') - .should('have.value', '2') + .should('have.value', advancedConfigurationParams.segmentSize - 1) }) }) it('Split track', () => { @@ -70,7 +49,7 @@ context('First part of a splitted track is visible', () => { .click() cy.get('.cvat-player-frame-selector').within(() => { cy.get('input[role="spinbutton"]') - .should('have.value', '1') + .should('have.value', advancedConfigurationParams.segmentSize - 2) }) }) it('First part of a splitted track is visible', () => { diff --git a/tests/cypress/integration/issue_1825_tooltip_hidden_mouseout.js b/tests/cypress/integration/actions_tasks_objects/issue_1825_tooltip_hidden_mouseout.js similarity index 64% rename from tests/cypress/integration/issue_1825_tooltip_hidden_mouseout.js rename to tests/cypress/integration/actions_tasks_objects/issue_1825_tooltip_hidden_mouseout.js index b8f81ca0..4d14d65e 100644 --- a/tests/cypress/integration/issue_1825_tooltip_hidden_mouseout.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1825_tooltip_hidden_mouseout.js @@ -6,25 +6,13 @@ /// +import { taskName } from '../../support/const' + context('Tooltip does not interfere with interaction with elements.', () => { const issueId = '1825' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1841_hidden_points_cuboids_grouping.js b/tests/cypress/integration/actions_tasks_objects/issue_1841_hidden_points_cuboids_grouping.js similarity index 80% rename from tests/cypress/integration/issue_1841_hidden_points_cuboids_grouping.js rename to tests/cypress/integration/actions_tasks_objects/issue_1841_hidden_points_cuboids_grouping.js index e2ae6950..b2471d2e 100644 --- a/tests/cypress/integration/issue_1841_hidden_points_cuboids_grouping.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1841_hidden_points_cuboids_grouping.js @@ -6,19 +6,11 @@ /// +import { taskName } from '../../support/const' + context('Hidden objects mustn\'t consider when we want to group visible objects only and use an grouping area for it.', () => { const issueId = '1841' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'white' let bgcolor = '' const createFirstPointsShape = { type: 'Shape', @@ -49,10 +41,6 @@ context('Hidden objects mustn\'t consider when we want to group visible objects } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1870_cursor_not_jump_to_end.js b/tests/cypress/integration/actions_tasks_objects/issue_1870_cursor_not_jump_to_end.js similarity index 50% rename from tests/cypress/integration/issue_1870_cursor_not_jump_to_end.js rename to tests/cypress/integration/actions_tasks_objects/issue_1870_cursor_not_jump_to_end.js index 58759b79..6ec69bdd 100644 --- a/tests/cypress/integration/issue_1870_cursor_not_jump_to_end.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1870_cursor_not_jump_to_end.js @@ -6,20 +6,11 @@ /// +import { taskName, textDefaultValue, attrName } from '../../support/const' + context('Checks that the cursor doesn\'t automatically jump to the end of a word when the attribute value changes', () => { const issueId = '1870' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'text' - const image = `image_${issueId}.png` - const newLabelAttrValue = 'teeext' - const width = 800 - const height = 800 - const posX=10 - const posY=10 - const color='gray' const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -31,22 +22,21 @@ context('Checks that the cursor doesn\'t automatically jump to the end of a word } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) - cy.createRectangle(createRectangleShape2Points) }) describe(`Testing issue "${issueId}"`, () => { it('Enter 2 characters in the middle of the word attribute value and check the result', () => { + cy.createRectangle(createRectangleShape2Points) cy.get('#cvat-objects-sidebar-state-item-1') .find('.ant-collapse-item') .click() - .find('.cvat-object-item-text-attribute') - .type('{leftarrow}{leftarrow}ee') - .should('have.value', newLabelAttrValue) + cy.get('.cvat-object-item-attribute-wrapper') + .contains(attrName).parents('.cvat-object-item-attribute-wrapper').within(() => { + cy.get('.cvat-object-item-text-attribute') + .type('{leftarrow}{leftarrow}ee') + .should('have.value', textDefaultValue.replace('Text', 'Teeext')) + }) }) }) }) diff --git a/tests/cypress/integration/issue_1882_polygon_interpolation.js b/tests/cypress/integration/actions_tasks_objects/issue_1882_polygon_interpolation.js similarity index 77% rename from tests/cypress/integration/issue_1882_polygon_interpolation.js rename to tests/cypress/integration/actions_tasks_objects/issue_1882_polygon_interpolation.js index f55bbb51..3425cd87 100644 --- a/tests/cypress/integration/issue_1882_polygon_interpolation.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1882_polygon_interpolation.js @@ -6,19 +6,11 @@ /// +import { taskName } from '../../support/const' + context('The points of the previous polygon mustn\'t appear while polygon\'s interpolation.', () => { const issueId = '1882' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'white' const createPolygonTrack = { reDraw: false, type: 'Track', @@ -45,10 +37,6 @@ context('The points of the previous polygon mustn\'t appear while polygon\'s int } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/issue_1886_point_coordinates_not_duplicated.js b/tests/cypress/integration/actions_tasks_objects/issue_1886_point_coordinates_not_duplicated.js similarity index 65% rename from tests/cypress/integration/issue_1886_point_coordinates_not_duplicated.js rename to tests/cypress/integration/actions_tasks_objects/issue_1886_point_coordinates_not_duplicated.js index caa3af0b..7e493046 100644 --- a/tests/cypress/integration/issue_1886_point_coordinates_not_duplicated.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1886_point_coordinates_not_duplicated.js @@ -6,27 +6,11 @@ /// +import { taskName, advancedConfigurationParams } from '../../support/const' + context('Point coordinates are not duplicated while polygon\'s interpolation.', () => { const issueId = '1886' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imagesCount = 4 - let images = [] - for ( let i = 1; i <= imagesCount; i++) { - images.push(`image_${issueId}_${i}.png`) - } - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'white' - const archiveName = `images_issue_${issueId}.zip` - const archivePath = `cypress/fixtures/${archiveName}` - const imagesFolder = `cypress/fixtures/image_issue_${issueId}` - const directoryToArchive = imagesFolder let pointsСoordinates = [] const createPolygonTrack = { reDraw: false, @@ -42,13 +26,6 @@ context('Point coordinates are not duplicated while polygon\'s interpolation.', } before(() => { - cy.visit('auth/login') - cy.login() - for (let img of images) { - cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) - } - cy.createZipArchive(directoryToArchive, archivePath) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) cy.openTaskJob(taskName) }) @@ -62,7 +39,7 @@ context('Point coordinates are not duplicated while polygon\'s interpolation.', cy.get('.cvat-player-forward-button').click() cy.get('.cvat-player-frame-selector').within(() => { cy.get('input[role="spinbutton"]') - .should('have.value', '3') + .should('have.value', advancedConfigurationParams.segmentSize - 1) }) }) it('Set a keyframe for the polygon', () => { @@ -74,7 +51,7 @@ context('Point coordinates are not duplicated while polygon\'s interpolation.', cy.get('.cvat-player-previous-button').click() cy.get('.cvat-player-frame-selector').within(() => { cy.get('input[role="spinbutton"]') - .should('have.value', '2') + .should('have.value', advancedConfigurationParams.segmentSize - 2) }) cy.get('#cvat_canvas_shape_1').should('have.prop', 'animatedPoints') .then(($pointsСoordinates) => { diff --git a/tests/cypress/integration/issue_1919_check_text_attr.js b/tests/cypress/integration/actions_tasks_objects/issue_1919_check_text_attr.js similarity index 55% rename from tests/cypress/integration/issue_1919_check_text_attr.js rename to tests/cypress/integration/actions_tasks_objects/issue_1919_check_text_attr.js index 8504b23d..fd590548 100644 --- a/tests/cypress/integration/issue_1919_check_text_attr.js +++ b/tests/cypress/integration/actions_tasks_objects/issue_1919_check_text_attr.js @@ -6,20 +6,12 @@ /// +import { taskName, textDefaultValue, attrName } from '../../support/const' + context('Check label attribute changes', () => { const issueId = '1919' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const image = `image_${issueId}.png` const newLabelAttrValue = 'New attribute value' - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -31,16 +23,12 @@ context('Check label attribute changes', () => { } before(() => { - cy.visit('auth/login') - cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) cy.openTaskJob(taskName) - cy.createRectangle(createRectangleShape2Points) }) describe(`Testing issue "${issueId}"`, () => { it('Open object menu', () => { + cy.createRectangle(createRectangleShape2Points) cy.get('#cvat_canvas_shape_1').trigger('mousemove').rightclick() }) it('Open object menu details', () => { @@ -50,15 +38,19 @@ context('Check label attribute changes', () => { }) it('Clear field of text attribute and write new value', () => { cy.get('.cvat-canvas-context-menu') - .find('.cvat-object-item-text-attribute') - .should('have.value', textDefaultValue) - .clear() - .type(newLabelAttrValue) + .contains(attrName).parents('.cvat-object-item-attribute-wrapper').within(() => { + cy.get('.cvat-object-item-text-attribute') + .should('have.value', textDefaultValue) + .clear() + .type(newLabelAttrValue) + }) }) it('Check what value of right panel is changed too', () => { cy.get('#cvat-objects-sidebar-state-item-1') - .find('.cvat-object-item-text-attribute') - .should('have.value', newLabelAttrValue) + .contains(attrName).parents('.cvat-object-item-attribute-wrapper').within(() => { + cy.get('.cvat-object-item-text-attribute') + .should('have.value', newLabelAttrValue) + }) }) }) }) diff --git a/tests/cypress/integration/actions_tasks_objects/issue_1944_loading_screen_switch_job.js b/tests/cypress/integration/actions_tasks_objects/issue_1944_loading_screen_switch_job.js new file mode 100644 index 00000000..1cabe59a --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/issue_1944_loading_screen_switch_job.js @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + */ + +/// + +import { taskName, advancedConfigurationParams } from '../../support/const' + +context('Being able to return to the job list for a task and start a new job without an infinite loading screen.', () => { + + const issueId = '1944' + + before(() => { + cy.openTaskJob(taskName) + }) + + describe(`Testing issue "${issueId}"`, () => { + it('The first job opened', () => { + cy.get('input[role="spinbutton"]') + .should('have.value', '0') + }) + it('Return to tasks page', () => { + cy.get('[value="tasks"]').click() + cy.url().should('include', '/tasks').and('not.contain', '/jobs') + }) + it('Open the task. Open second job', () => { + cy.openTaskJob(taskName, 1) + cy.get('.cvat-annotation-header') + .should('exist') + cy.get('input[role="spinbutton"]') + .should('have.value', advancedConfigurationParams.segmentSize) + }) + }) +}) diff --git a/tests/cypress/integration/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js b/tests/cypress/integration/actions_tasks_objects/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js similarity index 52% rename from tests/cypress/integration/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js rename to tests/cypress/integration/actions_tasks_objects/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js index 1c34eba5..17d181fc 100644 --- a/tests/cypress/integration/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js +++ b/tests/cypress/integration/actions_tasks_objects/pr_1370_check_UI_fail_with_object_dragging_and_go_next_frame.js @@ -6,27 +6,11 @@ /// +import { taskName } from '../../support/const' + context('Check if the UI fails by moving to the next frame while dragging the object', () => { const prId = '1370' - const labelName = `PR ${prId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imagesCount = 3 - let images = [] - for ( let i = 1; i <= imagesCount; i++) { - images.push(`image_${prId}_${i}.png`) - } - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' - const archiveName = `images_issue_${prId}.zip` - const archivePath = `cypress/fixtures/${archiveName}` - const imagesFolder = `cypress/fixtures/image_issue_${prId}` - const directoryToArchive = imagesFolder const createRectangleShape2Points = { points: 'By 2 Points', type: 'Shape', @@ -38,13 +22,6 @@ context('Check if the UI fails by moving to the next frame while dragging the ob } before(() => { - cy.visit('auth/login') - cy.login() - for (let img of images) { - cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) - } - cy.createZipArchive(directoryToArchive, archivePath) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) cy.openTaskJob(taskName) }) diff --git a/tests/cypress/integration/case_1_create_delete_task.js b/tests/cypress/integration/actions_users/case_1_create_delete_task.js similarity index 70% rename from tests/cypress/integration/case_1_create_delete_task.js rename to tests/cypress/integration/actions_users/case_1_create_delete_task.js index e89448fe..2d3505f3 100644 --- a/tests/cypress/integration/case_1_create_delete_task.js +++ b/tests/cypress/integration/actions_users/case_1_create_delete_task.js @@ -13,23 +13,29 @@ context('Create and delete a annotation task', () => { const taskName = `New annotation task for ${labelName}` const attrName = `Attr for ${labelName}` const textDefaultValue = 'Some default value for type Text' - const image = `image_${labelName.replace(' ', '_').toLowerCase()}.png` + 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 let taskID = '' before(() => { cy.visit('auth/login') cy.login() - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) + cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount) + cy.createZipArchive(directoryToArchive, archivePath) }) describe(`Testing "${labelName}"`, () => { it('Create a task', () => { - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) + cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) }) it('Delete the created task', () => { cy.getTaskID(taskName).then($taskID => { diff --git a/tests/cypress/integration/case_2_register_user_change_pass.js b/tests/cypress/integration/actions_users/case_2_register_user_change_pass.js similarity index 100% rename from tests/cypress/integration/case_2_register_user_change_pass.js rename to tests/cypress/integration/actions_users/case_2_register_user_change_pass.js diff --git a/tests/cypress/integration/case_4_assign_taks_job_users.js b/tests/cypress/integration/actions_users/case_4_assign_taks_job_users.js similarity index 78% rename from tests/cypress/integration/case_4_assign_taks_job_users.js rename to tests/cypress/integration/actions_users/case_4_assign_taks_job_users.js index fd10407b..29331cbe 100644 --- a/tests/cypress/integration/case_4_assign_taks_job_users.js +++ b/tests/cypress/integration/actions_users/case_4_assign_taks_job_users.js @@ -12,12 +12,17 @@ context('Multiple users. Assign task, job.', () => { const taskName = `New annotation task for ${labelName}` const attrName = `Attr for ${labelName}` const textDefaultValue = 'Some default value for type Text' - const image = `image_${labelName.replace(' ', '_').toLowerCase()}.png` + 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 const secondUserName = 'Seconduser' const thirdUserName = 'Thirduser' @@ -34,15 +39,12 @@ context('Multiple users. Assign task, job.', () => { password: 'Fv5Df3#f55g' } - function closeModal() { - cy.get('.ant-modal-body').within(() => { - cy.get('.ant-modal-confirm-title') - .should('contain', 'Unsupported platform detected') - cy.get('.ant-modal-confirm-btns') - .contains('OK') - .click() + after(() => { + cy.login() + cy.getTaskID(taskName).then($taskID => { + cy.deleteTask(taskName, $taskID) }) - } + }) describe(`Testing case "${caseId}"`, () => { // First user is "admin". @@ -55,11 +57,8 @@ context('Multiple users. Assign task, job.', () => { cy.url().should('include', '/auth/login') }) it('Register third user and logout.', () => { - cy.visit('auth/register') + cy.get('a[href="/auth/register"]').click() cy.url().should('include', '/auth/register') - if (Cypress.browser.name === 'firefox') { - closeModal() - } cy.userRegistration(thirdUser.firstName, thirdUser.lastName, thirdUserName, thirdUser.emailAddr, thirdUser.password) cy.url().should('include', '/tasks') cy.logout(thirdUserName) @@ -68,14 +67,15 @@ context('Multiple users. Assign task, job.', () => { it('First user login and create a task', () => { cy.login() cy.url().should('include', '/tasks') - cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName) - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image) + cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount) + cy.createZipArchive(directoryToArchive, archivePath) + cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) }) it('Assign the task to the second user and logout', () => { cy.openTask(taskName) cy.get('.cvat-task-details').within(() => { cy.get('.cvat-user-selector') - .click() + .click({force: true}) }) cy.contains(secondUserName) .click() @@ -84,6 +84,7 @@ context('Multiple users. Assign task, job.', () => { it('Second user login. The task can be opened. Logout', () => { cy.login(secondUserName, secondUser.password) cy.url().should('include', '/tasks') + cy.get('[value="tasks"]').click() cy.contains('strong', taskName) .should('exist') cy.openTask(taskName) @@ -92,6 +93,7 @@ context('Multiple users. Assign task, job.', () => { it('Third user login. The task not exist. Logout', () => { cy.login(thirdUserName, thirdUser.password) cy.url().should('include', '/tasks') + cy.get('[value="tasks"]').click() cy.contains('strong', taskName) .should('not.exist') cy.logout(thirdUserName) @@ -99,10 +101,11 @@ context('Multiple users. Assign task, job.', () => { it('First user login and assign the job to the third user. Logout', () => { cy.login() cy.url().should('include', '/tasks') + cy.get('[value="tasks"]').click() cy.openTask(taskName) cy.get('.cvat-task-job-list').within(() => { cy.get('.cvat-user-selector') - .click() + .click({force: true}) }) cy.contains(thirdUserName) .click() @@ -111,9 +114,11 @@ context('Multiple users. Assign task, job.', () => { it('Third user login. The task can be opened.', () => { cy.login(thirdUserName, thirdUser.password) cy.url().should('include', '/tasks') + cy.get('[value="tasks"]').click() cy.contains('strong', taskName) .should('exist') cy.openTask(taskName) + cy.logout(thirdUserName) }) }) }) diff --git a/tests/cypress/integration/issue_1599_ch_user_registration.js b/tests/cypress/integration/actions_users/issue_1599_ch_user_registration.js similarity index 100% rename from tests/cypress/integration/issue_1599_ch_user_registration.js rename to tests/cypress/integration/actions_users/issue_1599_ch_user_registration.js diff --git a/tests/cypress/integration/issue_1599_pl_user_registration.js b/tests/cypress/integration/actions_users/issue_1599_pl_user_registration.js similarity index 100% rename from tests/cypress/integration/issue_1599_pl_user_registration.js rename to tests/cypress/integration/actions_users/issue_1599_pl_user_registration.js diff --git a/tests/cypress/integration/issue_1810_login_logout.js b/tests/cypress/integration/actions_users/issue_1810_login_logout.js similarity index 100% rename from tests/cypress/integration/issue_1810_login_logout.js rename to tests/cypress/integration/actions_users/issue_1810_login_logout.js diff --git a/tests/cypress/integration/issue_1944_loading_screen_switch_job.js b/tests/cypress/integration/issue_1944_loading_screen_switch_job.js deleted file mode 100644 index 4921fdfb..00000000 --- a/tests/cypress/integration/issue_1944_loading_screen_switch_job.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2020 Intel Corporation - * - * SPDX-License-Identifier: MIT - */ - -/// - -context('Being able to return to the job list for a task and start a new job without an infinite loading screen.', () => { - - const issueId = '1944' - const labelName = `Issue ${issueId}` - const taskName = `New annotation task for ${labelName}` - const attrName = `Attr for ${labelName}` - const textDefaultValue = 'Some default value for type Text' - const imagesCount = 4 - let images = [] - for ( let i = 1; i <= imagesCount; i++) { - images.push(`image_${issueId}_${i}.png`) - } - const width = 800 - const height = 800 - const posX = 10 - const posY = 10 - const color = 'gray' - const archiveName = `images_issue_${issueId}.zip` - const archivePath = `cypress/fixtures/${archiveName}` - const imagesFolder = `cypress/fixtures/image_issue_${issueId}` - const directoryToArchive = imagesFolder - const advancedConfigurationParams = { - multiJobs: true, - segmentSize: 1 - } - - before(() => { - cy.visit('auth/login') - cy.login() - for (let img of images) { - cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) - } - cy.createZipArchive(directoryToArchive, archivePath) - }) - - describe(`Testing issue "${issueId}"`, () => { - it('Create a multijob task', () => { - cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName, - null, advancedConfigurationParams) - }) - it('Open the task. Open first job', () => { - cy.openTaskJob(taskName) - cy.get('input[role="spinbutton"]') - .should('have.value', '0') - }) - it('Return to tasks page', () => { - cy.get('[value="tasks"]').click() - cy.url().should('include', '/tasks').and('not.contain', '/jobs') - }) - it('Open the task. Open second job', () => { - cy.openTaskJob(taskName, 1) - cy.get('.cvat-annotation-header') - .should('exist') - cy.get('input[role="spinbutton"]') - .should('have.value', '1') - }) - }) -}) diff --git a/tests/cypress/plugins/imageGenerator/addPlugin.js b/tests/cypress/plugins/imageGenerator/addPlugin.js index 30d3f48d..7fe46dd4 100644 --- a/tests/cypress/plugins/imageGenerator/addPlugin.js +++ b/tests/cypress/plugins/imageGenerator/addPlugin.js @@ -19,15 +19,18 @@ function imageGenerator(args) { const posY = args.posY const message = args.message const file = path.join(directory, fileName) + const count = args.count return new Promise((resolve, reject) => { - const image = new jimp(width, height, color, function (err, image) { - if (err) reject(err) - jimp.loadFont(jimp.FONT_SANS_64_BLACK, function (err, font) { + for (let i=1; i<=count; i++) { + const image = new jimp(width, height, color, function (err, image) { if (err) reject(err) - image.print(font, Number(posX), Number(posY), message) - .write(file) + jimp.loadFont(jimp.FONT_SANS_64_BLACK, function (err, font) { + if (err) reject(err) + image.print(font, Number(posX), Number(posY), `${message}. Num ${i}`) + .write(`${file}_${i}.png`) + }) }) - }) + } setTimeout(() => resolve(null), '1000') }) } diff --git a/tests/cypress/plugins/imageGenerator/imageGeneratorCommand.js b/tests/cypress/plugins/imageGenerator/imageGeneratorCommand.js index b51b6e23..e42c746f 100644 --- a/tests/cypress/plugins/imageGenerator/imageGeneratorCommand.js +++ b/tests/cypress/plugins/imageGenerator/imageGeneratorCommand.js @@ -11,7 +11,8 @@ Cypress.Commands.add('imageGenerator', (directory, color, posX, posY, - message) => { + message, + count) => { return cy.task('imageGenerator', { directory: directory, fileName: fileName, @@ -20,6 +21,7 @@ Cypress.Commands.add('imageGenerator', (directory, color: color, posX: posX, posY: posY, - message: message + message: message, + count: count }) }) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index b96b40d6..f506ab9e 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -43,7 +43,7 @@ Cypress.Commands.add('createAnnotationTask', (taksName='New annotation task', multiAttrParams, advancedConfigurationParams ) => { - cy.get('#cvat-create-task-button').click() + cy.get('#cvat-create-task-button').click({force: true}) cy.url().should('include', '/tasks/create') cy.get('[id="name"]').type(taksName) cy.get('.cvat-constructor-viewer-new-item').click() @@ -71,15 +71,19 @@ Cypress.Commands.add('openTask', (taskName) => { cy.contains('strong', taskName) .parents('.cvat-tasks-list-item') .contains('a', 'Open') - .click() + .click({force: true}) }) Cypress.Commands.add('openJob', (jobNumber=0) => { + let tdText = '' cy.get('.ant-table-tbody') - .find('tr') - .eq(jobNumber) - .contains('a', 'Job #') - .click() + .contains(/^0-/).parent().find('td').eq(0).invoke('text') + .then(($tdText) => { + tdText = Number($tdText.match(/\d+/g)) + jobNumber + cy.get('.ant-table-tbody') + .contains('a', `Job #${tdText}`) + .click() + }) cy.url().should('include', '/jobs') }) @@ -326,3 +330,21 @@ Cypress.Commands.add('advancedConfiguration', (advancedConfigurationParams) => { cy.get('#frameStep').type(advancedConfigurationParams.frameStep) } }) + +Cypress.Commands.add('removeAnnotations', () => { + cy.get('.cvat-annotation-header-button').eq(0) + .click() + cy.get('.cvat-annotation-menu').within(() => { + cy.contains('Remove annotations') + .click() + }) + cy.get('.ant-modal-content').within(() => { + cy.get('.ant-btn-danger') + .click() + }) +}) + +Cypress.Commands.add('goToTaskList', () => { + cy.get('a[value="tasks"]') + .click() +}) diff --git a/tests/cypress/support/const.js b/tests/cypress/support/const.js new file mode 100644 index 00000000..57ad83af --- /dev/null +++ b/tests/cypress/support/const.js @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + */ + +/// + +export const labelName = `Main task` +export const taskName = `New annotation task for ${labelName}` +export const attrName = `Attr for ${labelName}` +export const textDefaultValue = 'Some default value for type Text' +export const imagesCount = 50 +export const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}` +export const width = 800 +export const height = 800 +export const posX = 10 +export const posY = 10 +export const color = 'gray' +export const archiveName = `${imageFileName}.zip` +export const archivePath = `cypress/fixtures/${archiveName}` +export const imagesFolder = `cypress/fixtures/${imageFileName}` +export const directoryToArchive = imagesFolder +export const advancedConfigurationParams = { + multiJobs: true, + segmentSize: 10, + sssFrame: true, + startFrame: 2, + stopFrame: imagesCount, + frameStep: 2 +} +export const multiAttrParams = { + additionalAttrName: `Attr 2`, + additionalValue: `Attr value 2`, + typeAttribute: 'Text' +} + +it('Prepare to testing', () => { + cy.visit('/') + cy.login() + cy.get('.cvat-tasks-page').should('exist') + let listItems = [] + cy.document().then((doc) => { + const collection = Array.from(doc.querySelectorAll('.cvat-item-task-name')) + for (let i = 0; i < collection.length; i++) { + listItems.push(collection[i].innerText) + } + if (listItems.indexOf(taskName) === -1) { + cy.task('log', 'A task doesn\'t exist. Creating.') + cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount) + cy.createZipArchive(directoryToArchive, archivePath) + cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName, + multiAttrParams, advancedConfigurationParams) + } else { + cy.task('log', 'The task exist. Skipping creation.') + } + }) +})