From b0eef1a15bf5294fcb9d7fbc90f2fcc0bb7ac40b Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 26 May 2023 10:46:13 +0100 Subject: [PATCH 1/2] Fix drawRect method of ImageView helper --- helpers/LSF/ImageView.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/LSF/ImageView.ts b/helpers/LSF/ImageView.ts index 6d407a1..48633bb 100644 --- a/helpers/LSF/ImageView.ts +++ b/helpers/LSF/ImageView.ts @@ -27,9 +27,9 @@ export const ImageView = { cy.log(`Draw rectangle at (${x}, ${y}) of size ${width}x${height}`); this.drawingArea .scrollIntoView() - .trigger('mousedown', x, y, { eventConstructor: 'MouseEvent' }) - .trigger('mousemove', x + width, y + height, { eventConstructor: 'MouseEvent' }) - .trigger('mouseup', { eventConstructor: 'MouseEvent' }); + .trigger('mousedown', x, y, { eventConstructor: 'MouseEvent', button: 1 }) + .trigger('mousemove', x + width, y + height, { eventConstructor: 'MouseEvent', button: 1 }) + .trigger('mouseup', x + width, y + height,{ eventConstructor: 'MouseEvent', button: 1 }); }, /** * Captures a screenshot of an element to compare later From 7ef7e1931dd6ef6fc5d42a21915b6a611e18f479 Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 26 May 2023 12:08:57 +0100 Subject: [PATCH 2/2] revert breaking changes --- helpers/LSF/ImageView.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/LSF/ImageView.ts b/helpers/LSF/ImageView.ts index 48633bb..9f6f899 100644 --- a/helpers/LSF/ImageView.ts +++ b/helpers/LSF/ImageView.ts @@ -27,9 +27,9 @@ export const ImageView = { cy.log(`Draw rectangle at (${x}, ${y}) of size ${width}x${height}`); this.drawingArea .scrollIntoView() - .trigger('mousedown', x, y, { eventConstructor: 'MouseEvent', button: 1 }) - .trigger('mousemove', x + width, y + height, { eventConstructor: 'MouseEvent', button: 1 }) - .trigger('mouseup', x + width, y + height,{ eventConstructor: 'MouseEvent', button: 1 }); + .trigger('mousedown', x, y, { eventConstructor: 'MouseEvent' }) + .trigger('mousemove', x + width, y + height, { eventConstructor: 'MouseEvent' }) + .trigger('mouseup', x + width, y + height,{ eventConstructor: 'MouseEvent' }); }, /** * Captures a screenshot of an element to compare later