Cypress test. Create task with files from remote sources. (#2718)
* Cypress test. Create a task with files from remote sources. * Add css class for notification. * Minor fix. * Add css class * Apply comments.main
parent
d236705441
commit
a9673b5a65
@ -0,0 +1,47 @@
|
||||
// Copyright (C) 2021 Intel Corporation
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Create a task with files from remote sources.', () => {
|
||||
const caseId = '46';
|
||||
const labelName = `Case ${caseId}`;
|
||||
const taskName = `New annotation task for ${labelName}`;
|
||||
const wrongUrl =
|
||||
'https://raw.githubusercontent.com/openvinotoolkit/cvat/v1.2.0/cvat/apps/documentation/static/documentation/images/cvatt.jpg';
|
||||
const correctUrl = wrongUrl.replace('cvatt.jpg', 'cvat.jpg');
|
||||
|
||||
before(() => {
|
||||
cy.visit('auth/login');
|
||||
cy.login();
|
||||
cy.get('#cvat-create-task-button').click();
|
||||
});
|
||||
|
||||
after(() => {
|
||||
cy.goToTaskList();
|
||||
cy.getTaskID(taskName).then(($taskID) => {
|
||||
cy.deleteTask(taskName, $taskID);
|
||||
});
|
||||
});
|
||||
|
||||
describe(`Testing "${labelName}"`, () => {
|
||||
it('Try to create a task with wrong remote file. The task is not created.', () => {
|
||||
cy.get('[id="name"]').type(taskName);
|
||||
cy.addNewLabel(labelName);
|
||||
cy.contains('Remote sources').click();
|
||||
cy.get('.cvat-file-selector-remote').type(wrongUrl);
|
||||
cy.get('.cvat-create-task-submit-section').click();
|
||||
cy.get('.cvat-notification-notice-create-task-failed').should('exist');
|
||||
cy.closeNotification('.cvat-notification-notice-create-task-failed');
|
||||
});
|
||||
|
||||
it('Set correct URL to remote file. The task is created.', () => {
|
||||
cy.get('.cvat-file-selector-remote').clear().type(correctUrl);
|
||||
cy.get('.cvat-create-task-submit-section').click();
|
||||
cy.get('.cvat-notification-create-task-success').should('exist');
|
||||
cy.goToTaskList();
|
||||
cy.contains('.cvat-item-task-name', taskName).should('exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue