Cypress test for PR 1370. (#2152)
Co-authored-by: Dmitry Kruchinin <dmitryx.kruchinin@intel.com> Co-authored-by: Boris Sekachev <boris.sekachev@yandex.ru>main
parent
4dc25e20c9
commit
a2997960c3
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Check if the UI fails by moving to the next frame while dragging the object', () => {
|
||||
|
||||
const prId = '1370'
|
||||
const labelName = `PR ${prId}`
|
||||
const taskName = `New annotation task for ${labelName}`
|
||||
const attrName = `Attr for ${labelName}`
|
||||
const textDefaultValue = 'Some default value for type Text'
|
||||
const imagesCount = 3
|
||||
let images = []
|
||||
for ( let i = 1; i <= imagesCount; i++) {
|
||||
images.push(`image_${prId}_${i}.png`)
|
||||
}
|
||||
const width = 800
|
||||
const height = 800
|
||||
const posX = 10
|
||||
const posY = 10
|
||||
const color = 'gray'
|
||||
const archiveName = `images_issue_${prId}.zip`
|
||||
const archivePath = `cypress/fixtures/${archiveName}`
|
||||
const imagesFolder = `cypress/fixtures/image_issue_${prId}`
|
||||
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 PR "${prId}"`, () => {
|
||||
it('Create object', () => {
|
||||
cy.createShape(200, 300, 300, 400)
|
||||
})
|
||||
it('Start object dragging and go to next frame (F).', () => {
|
||||
cy.get('#cvat_canvas_shape_1')
|
||||
.trigger('mousemove')
|
||||
.trigger('mouseover')
|
||||
.trigger('mousedown', {which: 1})
|
||||
cy.get('body')
|
||||
.type('f')
|
||||
})
|
||||
it('Page with the error is missing', () => {
|
||||
cy.contains('Oops, something went wrong')
|
||||
.should('not.exist')
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
Reference in New Issue