-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added .xml, .json file types, added test
- Loading branch information
Showing
18 changed files
with
128 additions
and
42 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
67 changes: 67 additions & 0 deletions
67
...s/cypress/integration/issues_prs2/issue_5274_upload_annotations_different_file_formats.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,67 @@ | ||
// Copyright (C) 2022 CVAT.ai Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { taskName, labelName } from '../../support/const'; | ||
|
||
context('Upload annotations in different file formats', () => { | ||
const issueId = '5274'; | ||
const createRectangleTrack2Points = { | ||
points: 'By 2 Points', | ||
type: 'Track', | ||
labelName, | ||
firstX: 250, | ||
firstY: 350, | ||
secondX: 350, | ||
secondY: 450, | ||
}; | ||
|
||
const archives = [ | ||
{ | ||
type: 'annotations', | ||
format: 'CVAT for images', | ||
archiveCustomName: 'issue5274-cvat-for-images', | ||
annotationsPath: 'annotations.xml', | ||
}, | ||
{ | ||
type: 'annotations', | ||
format: 'COCO', | ||
archiveCustomName: 'issue5274-coco', | ||
annotationsPath: 'annotations/instances_default.json', | ||
}, | ||
]; | ||
|
||
before(() => { | ||
cy.openTaskJob(taskName); | ||
cy.createRectangle(createRectangleTrack2Points); | ||
cy.saveJob('PATCH', 200, 'saveJobDump'); | ||
for (const archive of archives) { | ||
cy.exportJob(archive); | ||
cy.waitForDownload(); | ||
cy.unpackZipArchive(`cypress/fixtures/${archive.archiveCustomName}.zip`, archive.archiveCustomName); | ||
} | ||
}); | ||
|
||
describe(`Testing issue "${issueId}"`, () => { | ||
it('Dump annotations. Upload different file formats.', () => { | ||
cy.removeAnnotations(); | ||
cy.intercept('GET', '/api/jobs/**/annotations?**').as('uploadAnnotationsGet'); | ||
for (const archive of archives) { | ||
cy.interactMenu('Upload annotations'); | ||
cy.uploadAnnotations( | ||
archive.format.split(' ')[0], | ||
`${archive.archiveCustomName}/${archive.annotationsPath}`, | ||
'.cvat-modal-content-load-job-annotation', | ||
); | ||
|
||
cy.get('.cvat-notification-notice-upload-annotations-fail').should('not.exist'); | ||
cy.get('#cvat_canvas_shape_1').should('exist'); | ||
cy.get('#cvat-objects-sidebar-state-item-1').should('exist'); | ||
|
||
cy.removeAnnotations(); | ||
} | ||
}); | ||
}); | ||
}); |
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
4 changes: 3 additions & 1 deletion
4
tests/cypress/plugins/unpackZipArchive/unpackZipArchiveCommand.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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
// Copyright (C) 2021-2022 Intel Corporation | ||
// Copyright (C) 2022 CVAT.ai Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
Cypress.Commands.add('unpackZipArchive', (arhivePath) => cy.task('unpackZipArchive', { | ||
Cypress.Commands.add('unpackZipArchive', (arhivePath, extractPath) => cy.task('unpackZipArchive', { | ||
arhivePath, | ||
extractPath, | ||
})); |
Oops, something went wrong.