Cypress test to check task parameters frame (#2164)
* Cypress test to check if parameters "startFrame", "stopFrame", "frameStep" works as expected * Apply comments. Co-authored-by: Dmitry Kruchinin <dmitryx.kruchinin@intel.com>main
parent
59b338994d
commit
b5b872fa97
@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
|
context('Check if parameters "startFrame", "stopFrame", "frameStep" works as expected', () => {
|
||||||
|
|
||||||
|
const caseId = '3'
|
||||||
|
const labelName = `Case ${caseId}`
|
||||||
|
const taskName = `New annotation task for ${labelName}`
|
||||||
|
const attrName = `Attr for ${labelName}`
|
||||||
|
const textDefaultValue = 'Some default value for type Text'
|
||||||
|
const imagesCount = 10
|
||||||
|
const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`
|
||||||
|
let images = []
|
||||||
|
for ( let i = 1; i <= imagesCount; i++) {
|
||||||
|
images.push(`${imageFileName}_${i}.png`)
|
||||||
|
}
|
||||||
|
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
|
||||||
|
const advancedConfigurationParams = {
|
||||||
|
multiJobs: false,
|
||||||
|
sssFrame: true,
|
||||||
|
startFrame: 2,
|
||||||
|
stopFrame: 8,
|
||||||
|
frameStep: 2
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
|
||||||
|
describe(`Testing "${labelName}"`, () => {
|
||||||
|
it('Create a task. Open the task.', () => {
|
||||||
|
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName,
|
||||||
|
null, advancedConfigurationParams)
|
||||||
|
cy.openTaskJob(taskName)
|
||||||
|
})
|
||||||
|
it('Parameters "startFrame", "stopFrame", "frameStep" works as expected ', () => {
|
||||||
|
cy.get('.cvat-player-filename-wrapper')
|
||||||
|
.should('contain', `${imageFileName}_${advancedConfigurationParams.startFrame}.png`)
|
||||||
|
cy.get('.cvat-player-frame-selector').within(() => {
|
||||||
|
cy.get('input[role="spinbutton"]')
|
||||||
|
.should('have.value', '0')
|
||||||
|
})
|
||||||
|
cy.get('.cvat-player-next-button')
|
||||||
|
.click()
|
||||||
|
cy.get('.cvat-player-filename-wrapper')
|
||||||
|
.should('contain', `${imageFileName}_${advancedConfigurationParams.startFrame + advancedConfigurationParams.frameStep}.png`)
|
||||||
|
cy.get('.cvat-player-frame-selector').within(() => {
|
||||||
|
cy.get('input[role="spinbutton"]')
|
||||||
|
.should('have.value', '1')
|
||||||
|
})
|
||||||
|
cy.get('.cvat-player-last-button')
|
||||||
|
.click()
|
||||||
|
cy.get('.cvat-player-filename-wrapper')
|
||||||
|
.should('contain', `${imageFileName}_${advancedConfigurationParams.stopFrame}.png`)
|
||||||
|
cy.get('.cvat-player-frame-selector').within(() => {
|
||||||
|
cy.get('input[role="spinbutton"]')
|
||||||
|
.should('have.value', '3')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Reference in New Issue