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
Dmitry Kruchinin 5 years ago committed by GitHub
parent 4dc25e20c9
commit a2997960c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,6 +11,7 @@
"testFiles": [
"auth_page.js",
"issue_*.js",
"pr_*.js",
"case_*.js",
"remove_users_tasks.js"
]

@ -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…
Cancel
Save