diff --git a/test/runTest/runtime/ActionPlayback.js b/test/runTest/runtime/ActionPlayback.js index a7de86b2cb0d1ebf93b4afb0ad28bc20f40da66d..8ca67774c326c02ac8ed76c5c0b74a4d8e6a264e 100644 --- a/test/runTest/runtime/ActionPlayback.js +++ b/test/runTest/runtime/ActionPlayback.js @@ -153,6 +153,9 @@ export class ActionPlayback { timeline.pause(); await __VST_MOUSE_MOVE__(op.x, op.y); await __VST_MOUSE_UP__(); + if (window.__VST_RELOAD_TRIGGERED__) { + return; + } timeline.resume(); break; case 'mousemove': diff --git a/test/runTest/runtime/main.js b/test/runTest/runtime/main.js index 629d53c2f3e448fbac75e4ee48ab3f9a3ae5fe2b..d6f197d73238dd1e41e021d4c2e85723131344ae 100644 --- a/test/runTest/runtime/main.js +++ b/test/runTest/runtime/main.js @@ -55,7 +55,7 @@ window.__VST_START__ = function () { window.__VST_RUN_CONTEXT__.currentActionIndex, window.__VST_RUN_CONTEXT__.currentActionContext ) - }, 500); + }, 1000); } else { // Screenshot after 1000ms (200ms if 5x speed), wait the animation to be finished @@ -88,8 +88,9 @@ window.__VST_RUN_ACTIONS__ = async function (actions, restoredActionIndex, resto // We need to save the running info and keep running after reload. // window.location seems can't be redefined anymore. So we can only provide helper functions. window.__VST_RELOAD__ = function () { + // Mark reload triggered and let ActionPlayback stop. + window.__VST_RELOAD_TRIGGERED__ = true; saveRunningContext(actions, currentActionIndex, actionPlayback); - timeline.pause(); // Pause timeline to avoid send more messages. timeline.nativeSetTimeout(() => { // CDPSession pay be disconnected if reload immediately. nativeLocation.reload();