-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cypress test. Export project with 3d task. (#3562)
- Loading branch information
1 parent
987b2ef
commit 0272384
Showing
1 changed file
with
104 additions
and
0 deletions.
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
tests/cypress/integration/actions_projects_models/case_104_project_export_3d.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { projectName, labelName } from '../../support/const_project'; | ||
|
||
context('Export project dataset with 3D task.', { browser: '!firefox' }, () => { | ||
const caseID = 104; | ||
const task = { | ||
name3d: `Case ${caseID}`, | ||
label3d: labelName, | ||
attrName3d: 'Kind', | ||
attrValue3d: 'Oak', | ||
archiveName: '../../cypress/integration/canvas3d_functionality/assets/test_canvas3d.zip', | ||
advancedConfigurationParams: false, | ||
forProject: true, | ||
attachToProject: false, | ||
multiAttrParams: false, | ||
}; | ||
let projectID = ''; | ||
|
||
function getProjectID(projectName) { | ||
cy.contains('.cvat-project-name', projectName) | ||
.parents('.cvat-project-details') | ||
.should('have.attr', 'cvat-project-id') | ||
.then(($projectID) => { | ||
projectID = $projectID; | ||
}); | ||
} | ||
|
||
function testCheckFile(file) { | ||
cy.task('listFiles', 'cypress/fixtures').each((fileName) => { | ||
if (fileName.match(file)) { | ||
cy.readFile(`cypress/fixtures/${fileName}`).should('exist'); | ||
} | ||
}); | ||
} | ||
|
||
before(() => { | ||
cy.openProject(projectName); | ||
getProjectID(projectName); | ||
cy.createAnnotationTask( | ||
task.name3d, | ||
task.label3d, | ||
task.attrName3d, | ||
task.attrValue3d, | ||
task.archiveName, | ||
task.multiAttrParams, | ||
task.advancedConfigurationParams, | ||
task.forProject, | ||
task.attachToProject, | ||
projectName, | ||
); | ||
}); | ||
|
||
after(() => { | ||
cy.goToProjectsList(); | ||
cy.deleteProject(projectName, projectID); | ||
}); | ||
|
||
describe(`Testing "Case ${caseID}"`, () => { | ||
it('Export project with 3D task. Annotation.', () => { | ||
cy.goToProjectsList(); | ||
const exportAnnotation3d = { | ||
projectName: projectName, | ||
as: 'exportAnnotations3d', | ||
type: 'annotations', | ||
dumpType: 'Kitti Raw Format', | ||
}; | ||
cy.exportProject(exportAnnotation3d); | ||
const regex = new RegExp(`^project_${projectName.toLowerCase()}-.*-${exportAnnotation3d.dumpType.toLowerCase()}.*.zip$`); | ||
testCheckFile(regex); | ||
}); | ||
|
||
it('Export project with 3D task. Dataset.', () => { | ||
cy.goToProjectsList(); | ||
const exportDataset3d = { | ||
projectName: projectName, | ||
as: 'exportDataset3d', | ||
type: 'dataset', | ||
dumpType: 'Sly Point Cloud Format', | ||
}; | ||
cy.exportProject(exportDataset3d); | ||
const regex = new RegExp(`^project_${projectName.toLowerCase()}-.*-${exportDataset3d.dumpType.toLowerCase()}.*.zip$`); | ||
testCheckFile(regex); | ||
}); | ||
|
||
it('Export project with 3D task. Annotation. Rename a archive.', () => { | ||
cy.goToProjectsList(); | ||
const exportAnnotations3dRenameArchive = { | ||
projectName: projectName, | ||
as: 'exportAnnotations3dRenameArchive', | ||
type: 'annotations', | ||
dumpType: 'Kitti Raw Format', | ||
archiveCustomeName: 'export_project_3d_annotation', | ||
}; | ||
cy.exportProject(exportAnnotations3dRenameArchive); | ||
const regex = new RegExp(`^${exportAnnotations3dRenameArchive.archiveCustomeName}.zip$`); | ||
testCheckFile(regex); | ||
}); | ||
}); | ||
}); |