Skip to content

Commit a299796

Browse files
dvkruchininDmitry Kruchininbsekachev
authored
Cypress test for PR 1370. (#2152)
Co-authored-by: Dmitry Kruchinin <[email protected]> Co-authored-by: Boris Sekachev <[email protected]>
1 parent 4dc25e2 commit a299796

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

tests/cypress.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"testFiles": [
1212
"auth_page.js",
1313
"issue_*.js",
14+
"pr_*.js",
1415
"case_*.js",
1516
"remove_users_tasks.js"
1617
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright (C) 2020 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*/
6+
7+
/// <reference types="cypress" />
8+
9+
context('Check if the UI fails by moving to the next frame while dragging the object', () => {
10+
11+
const prId = '1370'
12+
const labelName = `PR ${prId}`
13+
const taskName = `New annotation task for ${labelName}`
14+
const attrName = `Attr for ${labelName}`
15+
const textDefaultValue = 'Some default value for type Text'
16+
const imagesCount = 3
17+
let images = []
18+
for ( let i = 1; i <= imagesCount; i++) {
19+
images.push(`image_${prId}_${i}.png`)
20+
}
21+
const width = 800
22+
const height = 800
23+
const posX = 10
24+
const posY = 10
25+
const color = 'gray'
26+
const archiveName = `images_issue_${prId}.zip`
27+
const archivePath = `cypress/fixtures/${archiveName}`
28+
const imagesFolder = `cypress/fixtures/image_issue_${prId}`
29+
const directoryToArchive = imagesFolder
30+
31+
before(() => {
32+
cy.visit('auth/login')
33+
cy.login()
34+
for (let img of images) {
35+
cy.imageGenerator(imagesFolder, img, width, height, color, posX, posY, labelName)
36+
}
37+
cy.createZipArchive(directoryToArchive, archivePath)
38+
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, archiveName)
39+
cy.openTaskJob(taskName)
40+
})
41+
42+
describe(`Testing PR "${prId}"`, () => {
43+
it('Create object', () => {
44+
cy.createShape(200, 300, 300, 400)
45+
})
46+
it('Start object dragging and go to next frame (F).', () => {
47+
cy.get('#cvat_canvas_shape_1')
48+
.trigger('mousemove')
49+
.trigger('mouseover')
50+
.trigger('mousedown', {which: 1})
51+
cy.get('body')
52+
.type('f')
53+
})
54+
it('Page with the error is missing', () => {
55+
cy.contains('Oops, something went wrong')
56+
.should('not.exist')
57+
})
58+
})
59+
})

0 commit comments

Comments
 (0)