Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Valiulin committed Feb 11, 2025
1 parent db85cf6 commit 966c631
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
"run",
"--headless",
"--browser",
"chrome",
"chrome"
],
"outputCapture": "std",
"console": "internalConsole"
Expand Down
13 changes: 2 additions & 11 deletions tests/cypress/e2e/actions_tasks2/case_101_opencv_basic_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ context('OpenCV. Intelligent scissors. Histogram Equalization. TrackerMIL.', ()
const imagesCount = 5;
const imageFileName = `image_${labelName.replace(' ', '_').toLowerCase()}`;
const scaleFrom400 = 12.5;
const width = 400 * scaleFrom400; // =5000
const width = 400 * scaleFrom400;
const height = 400 * scaleFrom400;
const delta = 3; // ??? probably requires bigger delta or something else
const delta = 3;
const maxTextWidth = undefined;
const textHeightPx = 77 * scaleFrom400;
const posX = 10 * scaleFrom400;
Expand All @@ -78,9 +78,6 @@ context('OpenCV. Intelligent scissors. Histogram Equalization. TrackerMIL.', ()
cy.visit('/auth/login');
cy.login();
for (let i = 0; i < imagesCount; i++) {
// cy.task('log', `x:${posX + i * 5}, y:${posY + i * 5}`);
// cy.imageGenerator(imagesFolder, imageFileName + i, width, height, color, posX + i * 5,
// posY + i * 5, labelName, 1, extension);
cy.makeCustomImage(imagesFolder, `${imageFileName}_${i}`,
width, height,
fontSize, color, textColor,
Expand Down Expand Up @@ -236,12 +233,6 @@ context('OpenCV. Intelligent scissors. Histogram Equalization. TrackerMIL.', ()
// In the beginning of this test we created images with text
// On each frame text is moved by 5px on x and y axis,
// so we expect shape to be close to real text positions
// cy.get('#cvat_canvas_shape_4').invoke('attr', 'x').then((xVal) => {
// expect(parseFloat(xVal)).to.be.closeTo(x + i * 5 * scaleFrom400, delta);
// });
// cy.get('#cvat_canvas_shape_4').invoke('attr', 'y').then((yVal) => {
// expect(parseFloat(yVal)).to.be.closeTo(y + i * 5 * scaleFrom400, delta);
// });
cy.get('#cvat_canvas_shape_4').then(($shape) => {
cy.task('log', `x:${+$shape.attr('x')}, y:${+$shape.attr('x')}`);
expect(+$shape.attr('x')).to.be.closeTo(x + i * 5 * scaleFrom400, delta);
Expand Down
3 changes: 1 addition & 2 deletions tests/cypress/plugins/imageGenerator/addPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
//
// SPDX-License-Identifier: MIT

// eslint-disable-next-line no-use-before-define
/* eslint no-use-before-define: 0 */
exports.imageGenerator = imageGenerator;
// eslint-disable-next-line no-use-before-define
exports.bufferToImage = bufferToImage;

const path = require('path');
Expand Down
5 changes: 2 additions & 3 deletions tests/cypress/support/commands_canvas3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ Cypress.Commands.add('create3DCuboid', (cuboidCreationParams) => {

Cypress.Commands.add('customScreenshot', (element, screenshotName) => {
cy.get(`${element} canvas`).then(([$el]) => ($el.getBoundingClientRect())).then((rect) => {
// const iframe = window.parent.document
// .querySelector('iframe.aut-iframe');
const iframe = Cypress.$('iframe.aut-iframe');
const iframe = window.parent.document
.querySelector('iframe.aut-iframe');
const parentRect = iframe.getBoundingClientRect();

const scale = parentRect.width / iframe.clientWidth;
Expand Down

0 comments on commit 966c631

Please sign in to comment.