Skip to content

Commit

Permalink
Cypress test. Create a task with manifest file. (#3014)
Browse files Browse the repository at this point in the history
* Update cypress configs

* Add manifest as an asset

* Cypress test. Create a task with manifest file.

* Rework assets

* Update cypress test

* Add check container existing
  • Loading branch information
dvkruchinin authored Mar 29, 2021
1 parent 1f56fd2 commit 70a9071
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

/// <reference types="cypress" />

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');
});
});
});
8 changes: 4 additions & 4 deletions tests/cypress_cron_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}

0 comments on commit 70a9071

Please sign in to comment.