Cypress test for issue 1444. (#2099)

Co-authored-by: Dmitry Kruchinin <dmitryx.kruchinin@intel.com>
main
Dmitry Kruchinin 6 years ago committed by GitHub
parent 4cede5c959
commit 15acb953e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,57 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*/
/// <reference types="cypress" />
context('Filter property "shape" work correctly', () => {
const issueId = '1444'
const labelName = `Issue ${issueId}`
const taskName = `New annotation task for ${labelName}`
const attrName = `Attr for ${labelName}`
const textDefaultValue = 'Some default value for type Text'
const image = `image_${issueId}.png`
const width = 800
const height = 800
const posX = 10
const posY = 10
const color = 'white'
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 issue "${issueId}"`, () => {
it('Create a shape', () => {
cy.createShape(309, 431, 616, 671)
cy.get('#cvat-objects-sidebar-state-item-1')
.should('contain', '1').and('contain', 'RECTANGLE SHAPE')
})
it('Create a polygon', () => {
cy.createPolygon('Shape', [
{x: 300, y: 100},
{x: 400, y: 400},
{x: 400, y: 250},
])
cy.get('#cvat-objects-sidebar-state-item-2')
.should('contain', '2').and('contain', 'POLYGON SHAPE')
})
it('Input filter "shape == "polygon""', () => {
cy.get('.cvat-annotations-filters-input')
.type('shape == "polygon"{Enter}')
})
it('Only polygon is visible', () => {
cy.get('#cvat_canvas_shape_2')
.should('exist')
cy.get('#cvat_canvas_shape_1')
.should('not.exist')
})
})
})

@ -136,10 +136,13 @@ Cypress.Commands.add('createPolygon', ( mode,
reDraw=false) => {
if (!reDraw) {
cy.get('.cvat-draw-polygon-control').click()
cy.get('.cvat-draw-shape-popover-content')
.find('button')
.contains(mode)
.click({force: true})
cy.contains('Draw new polygon')
.parents('.cvat-draw-shape-popover-content')
.within(() => {
cy.get('button')
.contains(mode)
.click({force: true})
})
}
pointsMap.forEach(element => {
cy.get('.cvat-canvas-container')

Loading…
Cancel
Save