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
Dmitry Kruchinin 5 years ago committed by GitHub
parent d236705441
commit a9673b5a65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -204,6 +204,7 @@ export default class FileManager extends React.PureComponent<Props, State> {
return (
<Tabs.TabPane key='remote' tab='Remote sources'>
<Input.TextArea
className='cvat-file-selector-remote'
placeholder='Enter one URL per line'
rows={6}
value={[...files.remote].join('\n')}

@ -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…
Cancel
Save