未验证 提交 9a018cc4 编写于 作者: D Dmitry Kruchinin 提交者: GitHub

Cypress test. Cropping polygon in some corner cases. (#3196)

上级 2dfb3d07
// 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');
});
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册