From c3dd3499e3e33bec13adda98599452b777e75fe6 Mon Sep 17 00:00:00 2001 From: Aleksey Alekseev <108272065+AlexeyAlexeevXperienceAI@users.noreply.github.com> Date: Wed, 12 Oct 2022 16:39:50 +0400 Subject: [PATCH] Added Cypress testing for feature: Multiple tasks creating from videos (#5028) * add tests for try of creating multitasks with images and video * add tests seccess creating video with Remote source * reduce time of debounce * try fix 107, 118 tests * try fix 107 tests * fix test with attach video * disable test with attach video * fix url to remote videos * Aborted extra changes * Updated files * Refactored case 107 * Fixed almost all tests * Aborted extra changes * removed extra files * Improved tests, added tests for local videos * Fixed corner case * Fix :// * Redesigned a way of getting a file type * Added html type to button * Some refactoring * Removed extra file * sdk tests: fix path for file share images Co-authored-by: Boris Co-authored-by: kirill-sizov --- .../create-task-page/create-task-content.tsx | 20 +- .../create-task-page/multi-task-progress.tsx | 4 +- cvat-ui/src/utils/files.ts | 97 +- .../case_107_connected_file_share.js | 79 +- .../actions_tasks3/case_118_multi_tasks.js | 200 ++++ tests/mounted_file_share/image_case_107_1.png | Bin 11470 -> 0 bytes tests/mounted_file_share/image_case_107_2.png | Bin 11916 -> 0 bytes tests/mounted_file_share/image_case_107_3.png | Bin 12075 -> 0 bytes tests/python/sdk/test_tasks.py | 4 +- tests/yarn.lock | 967 +++++++++--------- 10 files changed, 768 insertions(+), 603 deletions(-) create mode 100644 tests/cypress/integration/actions_tasks3/case_118_multi_tasks.js delete mode 100644 tests/mounted_file_share/image_case_107_1.png delete mode 100644 tests/mounted_file_share/image_case_107_2.png delete mode 100644 tests/mounted_file_share/image_case_107_3.png diff --git a/cvat-ui/src/components/create-task-page/create-task-content.tsx b/cvat-ui/src/components/create-task-page/create-task-content.tsx index f6e0a1d6..286820a2 100644 --- a/cvat-ui/src/components/create-task-page/create-task-content.tsx +++ b/cvat-ui/src/components/create-task-page/create-task-content.tsx @@ -19,12 +19,7 @@ import { getCore, Storage } from 'cvat-core-wrapper'; import ConnectedFileManager from 'containers/file-manager/file-manager'; import LabelsEditor from 'components/labels-editor/labels-editor'; import { Files } from 'components/file-manager/file-manager'; - -import { - getFileContentType, - getContentTypeRemoteFile, - getFileNameFromPath, -} from 'utils/files'; +import { getFileContentType, getContentTypeRemoteFile, getFileNameFromPath } from 'utils/files'; import BasicConfigurationForm, { BaseConfiguration } from './basic-configuration-form'; import ProjectSearchField from './project-search-field'; @@ -268,7 +263,7 @@ class CreateTaskContent extends React.PureComponent => { + private handleUploadRemoteFiles = (urls: string[]): void => { const { many } = this.props; const { files } = this.state; @@ -280,7 +275,7 @@ class CreateTaskContent extends React.PureComponent 1) { let index = 0; while (index < length) { - const isImageFile = await getContentTypeRemoteFile(urls[index]) === 'image'; + const isImageFile = getContentTypeRemoteFile(urls[index]) === 'image'; if (!isImageFile) { uploadFileErrorMessage = UploadFileErrorMessages.one; break; @@ -290,7 +285,7 @@ class CreateTaskContent extends React.PureComponent -