diff --git a/tests/cypress.json b/tests/cypress.json index eb67a4ae..2977d258 100644 --- a/tests/cypress.json +++ b/tests/cypress.json @@ -12,10 +12,10 @@ }, "testFiles": [ "auth_page.js", - "actions_tasks_objects/**/*", - "actions_users/**/*", - "actions_projects/**/*", - "canvas3d_functionality/*", + "actions_tasks_objects/**/*.js", + "actions_users/**/*.js", + "actions_projects/**/*.js", + "canvas3d_functionality/*.js", "remove_users_tasks_projects.js" ] } diff --git a/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/image_case_65_1.png b/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/image_case_65_1.png new file mode 100644 index 00000000..cc05eb05 Binary files /dev/null and b/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/image_case_65_1.png differ diff --git a/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/image_case_65_2.png b/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/image_case_65_2.png new file mode 100644 index 00000000..308213b5 Binary files /dev/null and b/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/image_case_65_2.png differ diff --git a/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/manifest.jsonl b/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/manifest.jsonl new file mode 100644 index 00000000..08a7c1d6 --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/assets/case_65_manifest/manifest.jsonl @@ -0,0 +1,4 @@ +{"version":"1.0"} +{"type":"images"} +{"name":"image_case_65_1","extension":".png","width":800,"height":800,"checksum":"82d6b0b6e0dfb3c63ac49880c3756b1a"} +{"name":"image_case_65_2","extension":".png","width":800,"height":800,"checksum":"20ab1351cfad5bbbca009ac4c6522ede"} diff --git a/tests/cypress/integration/actions_tasks_objects/case_65_create_task_with_manifest.js b/tests/cypress/integration/actions_tasks_objects/case_65_create_task_with_manifest.js new file mode 100644 index 00000000..6ce831eb --- /dev/null +++ b/tests/cypress/integration/actions_tasks_objects/case_65_create_task_with_manifest.js @@ -0,0 +1,47 @@ +// Copyright (C) 2021 Intel Corporation +// +// SPDX-License-Identifier: MIT + +/// + +context('Create an annotation task with manifest.', () => { + const caseId = '65'; + 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 pathToFiles = `${__dirname}/assets/case_65_manifest`; + let filesToAttache = []; + + before(() => { + cy.visit('auth/login'); + cy.login(); + }); + + describe(`Testing "${labelName}"`, () => { + it('Task created successfully.', () => { + cy.task('listFiles', pathToFiles).then(($files) => { + $files.forEach(($el) => { + // Add the path relative to the fixtures folder to the file names for the plugin "cypress-file-upload" to work correctly + filesToAttache.push(`../../${pathToFiles}/${$el}`); + }); + cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, filesToAttache); + }); + cy.get('.cvat-notification-create-task-success').should('exist'); + cy.get('.cvat-notification-create-task-fail').should('not.exist'); + }); + + it('The task and a job opened successfully.', () => { + cy.openTaskJob(taskName); + }); + + it('Moving through frames works correctly.', () => { + cy.checkFrameNum(0); + cy.get('.cvat-player-filename-wrapper').should('have.text', 'image_case_65_1.png'); + cy.get('.cvat-player-next-button').click(); + cy.get('.cvat-canvas-container').should('exist'); + cy.checkFrameNum(1); + cy.get('.cvat-player-filename-wrapper').should('have.text', 'image_case_65_2.png'); + }); + }); +}); diff --git a/tests/cypress_cron_type.json b/tests/cypress_cron_type.json index 77698831..2afcbf72 100644 --- a/tests/cypress_cron_type.json +++ b/tests/cypress_cron_type.json @@ -11,10 +11,10 @@ }, "testFiles": [ "auth_page.js", - "actions_tasks_objects/*", - "actions_projects/*", - "actions_users/*", - "email_system/*", + "actions_tasks_objects/*.js", + "actions_projects/*.js", + "actions_users/*.js", + "email_system/*.js", "remove_users_tasks_projects.js" ] }