-
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.
- Loading branch information
Dmitry Kruchinin
committed
Aug 17, 2020
1 parent
90cc36e
commit 32b5814
Showing
8 changed files
with
372 additions
and
46 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
tests/cypress/integration/issue_1819_first_part_splitted_track_visible.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,72 @@ | ||
/* | ||
* Copyright (C) 2020 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
/// <reference types="cypress" /> | ||
|
||
context('First part of a splitted track is visible', () => { | ||
|
||
const issueId = '1819' | ||
const labelName = `Issue ${issueId}` | ||
const taskName = `New annotation task for ${labelName}` | ||
const attrName = `Attr for ${labelName}` | ||
const textDefaultValue = 'Some default value for type Text' | ||
const images = [`image_${issueId}_1.png`, | ||
`image_${issueId}_2.png`, | ||
`image_${issueId}_3.png`] | ||
const width = 800 | ||
const height = 800 | ||
const posX = 10 | ||
const posY = 10 | ||
const color = 'gray' | ||
const archiveName = `images_issue_${issueId}.zip` | ||
const archivePath = `cypress/fixtures/${archiveName}` | ||
const imagesFolder = `cypress/fixtures/image_issue_${issueId}` | ||
const directoryToArchive = imagesFolder | ||
|
||
before(() => { | ||
cy.visit('auth/login') | ||
cy.login() | ||
for (let img of images) { | ||
cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName) | ||
} | ||
cy.createZipArchive(directoryToArchive, archivePath) | ||
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName) | ||
cy.openTaskJob(taskName) | ||
}) | ||
|
||
describe(`Testing issue "${issueId}"`, () => { | ||
it('Create a track', () => { | ||
cy.createTrack(309, 431, 616, 671) | ||
}) | ||
it('Go next with a step', () => { | ||
cy.get('.cvat-player-forward-button') | ||
.click() | ||
cy.get('.cvat-player-frame-selector').within(() => { | ||
cy.get('input[role="spinbutton"]') | ||
.should('have.value', '2') | ||
}) | ||
}) | ||
it('Split track', () => { | ||
cy.get('body') | ||
.type('{alt}m') | ||
cy.get('#cvat_canvas_shape_1') | ||
.trigger('mousemove', {which: 1}) | ||
.trigger('click', {which: 1}) | ||
}) | ||
it('Go to previous frame', () => { | ||
cy.get('.cvat-player-previous-button') | ||
.click() | ||
cy.get('.cvat-player-frame-selector').within(() => { | ||
cy.get('input[role="spinbutton"]') | ||
.should('have.value', '1') | ||
}) | ||
}) | ||
it('First part of a splitted track is visible', () => { | ||
cy.get('#cvat_canvas_shape_2') | ||
.should('be.visible') | ||
}) | ||
}) | ||
}) |
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,30 @@ | ||
/* | ||
* Copyright (C) 2020 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
exports.createZipArchive = createZipArchive | ||
|
||
const archiver = require('archiver') | ||
const fs = require('fs-extra') | ||
|
||
function createZipArchive(args) { | ||
const directoryToArchive = args.directoryToArchive | ||
const output = fs.createWriteStream(args.arhivePath) | ||
const archive = archiver('zip', { | ||
gzip: true, | ||
zlib: { level: 9 } | ||
}) | ||
|
||
archive.on('error', function(err) { | ||
throw err | ||
}) | ||
|
||
archive.pipe(output) | ||
|
||
archive.directory(`${directoryToArchive}/`, false) | ||
archive.finalize() | ||
|
||
return fs.pathExists(archive) | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/cypress/plugins/createZipArchive/createZipArchiveCommand.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,12 @@ | ||
/* | ||
* Copyright (C) 2020 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
Cypress.Commands.add('createZipArchive', function (directoryToArchive, arhivePath) { | ||
return cy.task('createZipArchive', { | ||
directoryToArchive: directoryToArchive, | ||
arhivePath: arhivePath | ||
}) | ||
}) |
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
Oops, something went wrong.