|
|
|
|
@ -13,6 +13,7 @@ context('Canvas 3D functionality. Dump/upload annotation. "Point Cloud" format',
|
|
|
|
|
};
|
|
|
|
|
const dumpTypePC = 'Sly Point Cloud Format';
|
|
|
|
|
let annotationPCArchiveName = '';
|
|
|
|
|
let annotationPCArchiveCustomeName = '';
|
|
|
|
|
|
|
|
|
|
function confirmUpdate(modalWindowClassName) {
|
|
|
|
|
cy.get(modalWindowClassName).within(() => {
|
|
|
|
|
@ -20,63 +21,54 @@ context('Canvas 3D functionality. Dump/upload annotation. "Point Cloud" format',
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function uploadToTask(toTaskName) {
|
|
|
|
|
cy.contains('.cvat-item-task-name', toTaskName)
|
|
|
|
|
.parents('.cvat-tasks-list-item')
|
|
|
|
|
.find('.cvat-menu-icon')
|
|
|
|
|
.trigger('mouseover');
|
|
|
|
|
cy.contains('Upload annotations').trigger('mouseover');
|
|
|
|
|
cy.readFile('cypress/downloads/' + annotationPCArchiveName, 'binary')
|
|
|
|
|
.then(Cypress.Blob.binaryStringToBlob)
|
|
|
|
|
.then((fileContent) => {
|
|
|
|
|
cy.contains('.cvat-menu-load-submenu-item', dumpTypePC.split(' ')[0])
|
|
|
|
|
.should('be.visible')
|
|
|
|
|
.within(() => {
|
|
|
|
|
cy.get('.cvat-menu-load-submenu-item-button').click().get('input[type=file]').attachFile({
|
|
|
|
|
fileName: annotationPCArchiveName,
|
|
|
|
|
fileContent: fileContent,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
before(() => {
|
|
|
|
|
cy.openTask(taskName);
|
|
|
|
|
cy.openJob();
|
|
|
|
|
cy.wait(1000); // Waiting for the point cloud to display
|
|
|
|
|
cy.create3DCuboid(cuboidCreationParams);
|
|
|
|
|
cy.saveJob('PATCH', 200, 'saveJob');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
describe(`Testing case "${caseId}"`, () => {
|
|
|
|
|
it('Save a job. Dump with "Point Cloud" format.', () => {
|
|
|
|
|
cy.saveJob('PATCH', 200, 'saveJob');
|
|
|
|
|
cy.intercept('GET', '/api/v1/tasks/**/annotations**').as('dumpAnnotations');
|
|
|
|
|
cy.interactMenu('Export task dataset');
|
|
|
|
|
cy.get('.cvat-modal-export-task').find('.cvat-modal-export-select').click();
|
|
|
|
|
cy.get('.ant-select-dropdown')
|
|
|
|
|
.not('.ant-select-dropdown-hidden')
|
|
|
|
|
.contains('.cvat-modal-export-option-item', dumpTypePC)
|
|
|
|
|
.click();
|
|
|
|
|
cy.get('.cvat-modal-export-select').should('contain.text', dumpTypePC);
|
|
|
|
|
cy.get('.cvat-modal-export-task').contains('button', 'OK').click();
|
|
|
|
|
cy.wait('@dumpAnnotations', { timeout: 5000 }).its('response.statusCode').should('equal', 202);
|
|
|
|
|
cy.wait('@dumpAnnotations').its('response.statusCode').should('equal', 201);
|
|
|
|
|
cy.removeAnnotations();
|
|
|
|
|
cy.saveJob('PUT');
|
|
|
|
|
cy.get('#cvat-objects-sidebar-state-item-1').should('not.exist');
|
|
|
|
|
|
|
|
|
|
cy.wait(2000); // Waiting for the full download.
|
|
|
|
|
cy.task('listFiles', 'cypress/downloads').each((fileName) => {
|
|
|
|
|
if (fileName.includes(dumpTypePC.toLowerCase())) {
|
|
|
|
|
it('Export with "Point Cloud" format.', () => {
|
|
|
|
|
const exportAnnotation = {
|
|
|
|
|
as: 'exportAnnotations',
|
|
|
|
|
type: 'annotations',
|
|
|
|
|
format: dumpTypePC,
|
|
|
|
|
};
|
|
|
|
|
cy.exportTask(exportAnnotation);
|
|
|
|
|
const regex = new RegExp(`^task_${taskName.toLowerCase()}-.*-${exportAnnotation.format.toLowerCase()}.*.zip$`);
|
|
|
|
|
cy.task('listFiles', 'cypress/fixtures').each((fileName) => {
|
|
|
|
|
if (fileName.match(regex)) {
|
|
|
|
|
cy.readFile(`cypress/fixtures/${fileName}`).should('exist');
|
|
|
|
|
annotationPCArchiveName = fileName;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('Export with "Point Cloud" format. Renaming the archive', () => {
|
|
|
|
|
const exportAnnotationRenameArchive = {
|
|
|
|
|
as: 'exportAnnotationsRenameArchive',
|
|
|
|
|
type: 'annotations',
|
|
|
|
|
format: dumpTypePC,
|
|
|
|
|
archiveCustomeName: 'task_export_3d_annotation_custome_name_pc_format'
|
|
|
|
|
};
|
|
|
|
|
cy.exportTask(exportAnnotationRenameArchive);
|
|
|
|
|
const regex = new RegExp(`^${exportAnnotationRenameArchive.archiveCustomeName}.zip$`);
|
|
|
|
|
cy.task('listFiles', 'cypress/fixtures').each((fileName) => {
|
|
|
|
|
if (fileName.match(regex)) {
|
|
|
|
|
cy.readFile(`cypress/fixtures/${fileName}`).should('exist');
|
|
|
|
|
annotationPCArchiveCustomeName = fileName;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
cy.removeAnnotations();
|
|
|
|
|
cy.saveJob('PUT');
|
|
|
|
|
cy.get('#cvat-objects-sidebar-state-item-1').should('not.exist');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('Upload "Point Cloud" format annotation to job.', () => {
|
|
|
|
|
cy.interactMenu('Upload annotations');
|
|
|
|
|
|
|
|
|
|
cy.readFile('cypress/downloads/' + annotationPCArchiveName, 'binary')
|
|
|
|
|
cy.readFile('cypress/fixtures/' + annotationPCArchiveName, 'binary')
|
|
|
|
|
.then(Cypress.Blob.binaryStringToBlob)
|
|
|
|
|
.then((fileContent) => {
|
|
|
|
|
cy.contains('.cvat-menu-load-submenu-item', dumpTypePC.split(' ')[0])
|
|
|
|
|
@ -98,11 +90,28 @@ context('Canvas 3D functionality. Dump/upload annotation. "Point Cloud" format',
|
|
|
|
|
cy.get('#cvat-objects-sidebar-state-item-1').should('exist');
|
|
|
|
|
cy.removeAnnotations();
|
|
|
|
|
cy.get('button').contains('Save').click({ force: true });
|
|
|
|
|
cy.get('#cvat-objects-sidebar-state-item-1').should('not.exist');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('Upload annotation to task.', () => {
|
|
|
|
|
it('Upload annotation from the archive with a custom name to task.', () => {
|
|
|
|
|
cy.goToTaskList();
|
|
|
|
|
uploadToTask(taskName);
|
|
|
|
|
cy.contains('.cvat-item-task-name', taskName)
|
|
|
|
|
.parents('.cvat-tasks-list-item')
|
|
|
|
|
.find('.cvat-menu-icon')
|
|
|
|
|
.trigger('mouseover');
|
|
|
|
|
cy.contains('Upload annotations').trigger('mouseover');
|
|
|
|
|
cy.readFile('cypress/fixtures/' + annotationPCArchiveCustomeName, 'binary')
|
|
|
|
|
.then(Cypress.Blob.binaryStringToBlob)
|
|
|
|
|
.then((fileContent) => {
|
|
|
|
|
cy.contains('.cvat-menu-load-submenu-item', dumpTypePC.split(' ')[0])
|
|
|
|
|
.should('be.visible')
|
|
|
|
|
.within(() => {
|
|
|
|
|
cy.get('.cvat-menu-load-submenu-item-button').click().get('input[type=file]').attachFile({
|
|
|
|
|
fileName: annotationPCArchiveCustomeName,
|
|
|
|
|
fileContent: fileContent,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
confirmUpdate('.cvat-modal-content-load-task-annotation');
|
|
|
|
|
cy.contains('Annotations have been loaded').should('be.visible');
|
|
|
|
|
cy.get('[data-icon="close"]').click();
|
|
|
|
|
|