forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cypress test. Cropping polygon in some corner cases. (cvat-ai#3196)
- Loading branch information
1 parent
2dfb3d0
commit 9a018cc
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
tests/cypress/integration/actions_objects2/case_77_cropping_polygon_in_some_corner_cases.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { labelName, taskName } from '../../support/const'; | ||
|
||
context('Cropping polygon in some corner cases.', () => { | ||
const caseId = '77'; | ||
const createPolygonShapeRightSide = { | ||
reDraw: false, | ||
type: 'Shape', | ||
labelName: labelName, | ||
pointsMap: [ | ||
{ x: 500, y: 120 }, | ||
{ x: 900, y: 10 }, | ||
{ x: 850, y: 800 }, | ||
{ x: 500, y: 750 }, | ||
], | ||
complete: true, | ||
numberOfPoints: null, | ||
}; | ||
|
||
const createPolygonShapeLeftSide = { | ||
reDraw: false, | ||
type: 'Shape', | ||
labelName: labelName, | ||
pointsMap: [ | ||
{ x: 500, y: 120 }, | ||
{ x: 30, y: 10 }, | ||
{ x: 50, y: 800 }, | ||
{ x: 500, y: 750 }, | ||
], | ||
complete: true, | ||
numberOfPoints: null, | ||
}; | ||
|
||
before(() => { | ||
cy.openTask(taskName); | ||
cy.openJob(); | ||
}); | ||
|
||
describe(`Testing case "${caseId}"`, () => { | ||
it('Checking the right side of the canvas.', () => { | ||
cy.get('.cvat-canvas-container').trigger('wheel', { deltaY: 5 }).trigger('wheel', { deltaY: 5 }); | ||
cy.createPolygon(createPolygonShapeRightSide); | ||
cy.get('.cvat-canvas-container').trigger('mousemove', 650, 250); // Hover over a point that was free of the shape before the fix | ||
cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated'); | ||
}); | ||
|
||
it('Checking the lift side of the canvas.', () => { | ||
cy.removeAnnotations(); | ||
cy.createPolygon(createPolygonShapeLeftSide); | ||
cy.get('.cvat-canvas-container').trigger('mousemove', 300, 250); // Hover over a point that was free of the shape before the fix | ||
cy.get('#cvat_canvas_shape_1').should('have.class', 'cvat_canvas_shape_activated'); | ||
}); | ||
}); | ||
}); |