From 02a83264e0142b0e001253c8f26c2ba3c5596ed6 Mon Sep 17 00:00:00 2001 From: shadowusr Date: Wed, 31 Jan 2024 16:29:34 +0300 Subject: [PATCH] fix: round xOffset and yOffset when resetting cursor --- src/worker/runner/test-runner/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/worker/runner/test-runner/index.js b/src/worker/runner/test-runner/index.js index 67791e82c..6530c99d6 100644 --- a/src/worker/runner/test-runner/index.js +++ b/src/worker/runner/test-runner/index.js @@ -128,7 +128,8 @@ module.exports = class TestRunner { const { x = 0, y = 0 } = await session.execute(function () { return document.body.getBoundingClientRect(); }); - await body.moveTo({ xOffset: -x, yOffset: -y }); + // x and y must be integer, wdio will throw error otherwise + await body.moveTo({ xOffset: -Math.floor(x), yOffset: -Math.floor(y) }); } };