|
| 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