未验证 提交 8d3e0066 编写于 作者: D Dmitry Kruchinin 提交者: GitHub

Cypress test to check scale and fit image. (#2195)

* Cypress test to check scale and fit image.

* Replace message for context().

* Applying comments.
Co-authored-by: NDmitry Kruchinin <dmitryx.kruchinin@intel.com>
上级 b5b872fa
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*/
/// <reference types="cypress" />
context('Check if the image is scaled and then fitted', () => {
const caseId = '6'
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 imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`
const image = `${imageFileName}.png`
const width = 800
const height = 800
const posX = 10
const posY = 10
const color = 'gray'
before(() => {
cy.visit('auth/login')
cy.login()
cy.imageGenerator('cypress/fixtures', image, width, height, color, posX, posY, labelName)
cy.createAnnotationTask(taskName, labelName, attrName, textDefaultValue, image)
cy.openTaskJob(taskName)
})
describe(`Testing "${labelName}"`, () => {
it('Scale image', () => {
cy.get('#cvat_canvas_background')
.should('have.attr', 'style').and('contain', 'scale(1.065)')
cy.get('.cvat-canvas-container')
.trigger('wheel', {deltaY: 5})
cy.get('#cvat_canvas_background')
.should('have.attr', 'style').and('contain', 'scale(0.8875)')
})
it('Fit image', () => {
cy.get('#cvat_canvas_content')
.dblclick()
cy.get('#cvat_canvas_background')
.should('have.attr', 'style').and('contain', 'scale(1.065)')
})
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册