未验证 提交 98d7c4d5 编写于 作者: D Dmitry Kruchinin 提交者: GitHub

Cypress test. Show attached files when creating task. (#2734)

* Cypress test. Displaying attached files when creating a task.

* Update Cypress plugin "cypress-file-upload".

* Apply comments.
上级 a9673b5a
// Copyright (C) 2021 Intel Corporation
//
// SPDX-License-Identifier: MIT
/// <reference types="cypress" />
context('Displaying attached files when creating a task.', () => {
const issueId = '2661';
const labelName = `Issue ${issueId}`;
const imagesCount = 5;
const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`;
const width = 800;
const height = 800;
const posX = 10;
const posY = 10;
const color = 'gray';
const archiveName = `${imageFileName}.zip`;
const archivePath = `cypress/fixtures/${archiveName}`;
const imagesFolder = `cypress/fixtures/${imageFileName}`;
const directoryToArchive = imagesFolder;
let imageListToAttach = [];
for (let i = 1; i <= imagesCount; i++) {
imageListToAttach.push(`${imageFileName}/${imageFileName}_${i}.png`);
}
before(() => {
cy.visit('auth/login');
cy.login();
cy.imageGenerator(imagesFolder, imageFileName, width, height, color, posX, posY, labelName, imagesCount);
cy.createZipArchive(directoryToArchive, archivePath);
cy.get('#cvat-create-task-button').click();
});
describe(`Testing "${labelName}"`, () => {
it('Attach a files. Attached files is visible.', () => {
cy.get('input[type="file"]').attachFile(archiveName, { subjectType: 'drag-n-drop' });
cy.get('.cvat-file-manager-local-tab').should('contain', archiveName).and('be.visible');
});
it('Attach more then 4 files. Attached files is visible and contain text "<count_files> files selected".', () => {
cy.get('input[type="file"]').attachFile(imageListToAttach, { subjectType: 'drag-n-drop' });
cy.get('.cvat-file-manager-local-tab').should('contain', `${imagesCount} files selected`).and('be.visible');
});
});
});
......@@ -2869,18 +2869,18 @@
}
},
"cypress-file-upload": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/cypress-file-upload/-/cypress-file-upload-4.1.1.tgz",
"integrity": "sha512-tX6UhuJ63rNgjdzxglpX+ZYf/bM6PDhFMtt1qCBljLtAgdearqyfD1AHqyh59rOHCjfM+bf6FA3o9b/mdaX6pw==",
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/cypress-file-upload/-/cypress-file-upload-5.0.2.tgz",
"integrity": "sha512-QRPnQPeEaW+HMVB62/htIsKh7Kd/x2uzoHKEQxh7LCD+4IaG0rAjLZupCIjjUh+JnRymgfir8wOYtFSJCNWlpA==",
"dev": true,
"requires": {
"mime": "^2.4.4"
"mime": "^2.5.0"
},
"dependencies": {
"mime": {
"version": "2.4.6",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==",
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.5.0.tgz",
"integrity": "sha512-ft3WayFSFUVBuJj7BMLKAQcSlItKtfjsKDDsii3rqFDAZ7t11zRe8ASw/GlmivGwVUYtwkQrxiGGpL6gFvB0ag==",
"dev": true
}
}
......
......@@ -6,9 +6,9 @@
"devDependencies": {
"@cypress/code-coverage": "^3.8.1",
"cypress": "^5.0.0",
"cypress-file-upload": "^4.1.1",
"cypress-plugin-tab": "^1.0.5",
"cypress-localstorage-commands": "^1.3.1"
"cypress-file-upload": "^5.0.2",
"cypress-localstorage-commands": "^1.3.1",
"cypress-plugin-tab": "^1.0.5"
},
"dependencies": {
"archiver": "^5.0.0",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册