-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cypress test. Call HOC component each render. (#2788)
- Loading branch information
1 parent
44a504e
commit 2eeeacd
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
tests/cypress/integration/actions_tasks_objects/issue_2753_call_HOC_component_each_render.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,77 @@ | ||
// Copyright (C) 2021 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
/// <reference types="cypress" /> | ||
|
||
import { taskName, labelName } from '../../support/const'; | ||
|
||
context('Call HOC component each render.', () => { | ||
const issueId = '2753'; | ||
const numberOfPointsPolygon = 4; | ||
const numberOfPointsPolyline = 5; | ||
const numberOfPointsPoint = 6; | ||
|
||
const createPolygonShapePoints = { | ||
reDraw: false, | ||
type: 'Shape', | ||
labelName: labelName, | ||
pointsMap: [ | ||
{ x: 200, y: 200 }, | ||
{ x: 250, y: 200 }, | ||
{ x: 250, y: 250 }, | ||
{ x: 200, y: 300 }, | ||
], | ||
numberOfPoints: numberOfPointsPolygon, | ||
}; | ||
const createPolylinesTrackPoints = { | ||
type: 'Track', | ||
labelName: labelName, | ||
pointsMap: [ | ||
{ x: 300, y: 200 }, | ||
{ x: 350, y: 200 }, | ||
{ x: 350, y: 250 }, | ||
{ x: 300, y: 350 }, | ||
{ x: 270, y: 330 }, | ||
], | ||
numberOfPoints: numberOfPointsPolyline, | ||
}; | ||
const createPointsShapePoints = { | ||
type: 'Shape', | ||
labelName: labelName, | ||
pointsMap: [ | ||
{ x: 400, y: 200 }, | ||
{ x: 450, y: 200 }, | ||
{ x: 450, y: 250 }, | ||
{ x: 450, y: 230 }, | ||
{ x: 430, y: 230 }, | ||
{ x: 400, y: 230 }, | ||
], | ||
numberOfPoints: numberOfPointsPoint, | ||
}; | ||
|
||
function checkNumberOfPointsValue(objectType, numberOfPoints) { | ||
cy.get(`.cvat-draw-${objectType}-control`).trigger('mouseover'); | ||
cy.get(`.cvat-draw-${objectType}-popover-visible`).within(() => { | ||
cy.get('.cvat-draw-shape-popover-points-selector') | ||
.find('input') | ||
.should('have.attr', 'value', numberOfPoints); | ||
}); | ||
cy.get(`.cvat-draw-${objectType}-control`).trigger('mouseout'); | ||
} | ||
|
||
before(() => { | ||
cy.openTaskJob(taskName); | ||
}); | ||
|
||
describe(`Testing issue "${issueId}"`, () => { | ||
it('Draw polygon, polyline, points. After drawing "Number of points" popover value should the same.', () => { | ||
cy.createPolygon(createPolygonShapePoints); | ||
cy.createPolyline(createPolylinesTrackPoints); | ||
cy.createPoint(createPointsShapePoints); | ||
checkNumberOfPointsValue('polygon', numberOfPointsPolygon); | ||
checkNumberOfPointsValue('polyline', numberOfPointsPolyline); | ||
checkNumberOfPointsValue('points', numberOfPointsPoint); | ||
}); | ||
}); | ||
}); |