Skip to content

Commit 1e8aef7

Browse files
committed
cypress: fix crop test to be more obvious in Writer
Signed-off-by: Szymon Kłos <[email protected]> Change-Id: I8b178b50819c1df8c0ea362a1307c28b69a10083
1 parent 69bdd0c commit 1e8aef7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cypress_test/integration_tests/desktop/writer/image_operation_spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,25 @@ describe(['tagdesktop'], 'Image Operation Tests', function() {
2828
cy.cGet('#test-div-shape-handle-3').should('exist');
2929
desktopHelper.getNbIcon('Crop', 'Picture').click();
3030

31+
const moveX = 20;
32+
3133
cy.cGet('#test-div-shape-handle-3').then(($handle) => {
3234
const rect = $handle[0].getBoundingClientRect();
3335
const startX = rect.left + rect.width / 2;
3436
const startY = rect.top + rect.height / 2;
35-
const moveX = 20;
3637

3738
cy.cGet('body').realMouseDown({ x: startX, y: startY });
3839

3940
cy.cGet('body').realMouseMove(startX + moveX, startY);
4041

4142
// for some reason even after moving the crop marker 20 px, on realMouseUp crop marker moves a lot more than expected
4243
// but it seems to related to how realMouseUp is implemented
44+
cy.cGet('body').realMouseUp({ x: startX + moveX, y: startY });
4345
cy.cGet('body').realMouseUp();
4446
});
4547

4648
cy.wait(1000);
47-
helper.assertImageSize(37, 63);
49+
helper.assertImageSize(248 - moveX, 63);
4850
});
4951

5052
it('Resize image when keep ratio option enabled and disabled', function() {

0 commit comments

Comments
 (0)