You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/05/08 14:28:52 UTC
[echarts] 02/02: test(visual): optimize case reload
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch enhance-visual-regression-test
in repository https://gitbox.apache.org/repos/asf/echarts.git
commit 2e7feb59ec9283d90f3470b7bc35bc1e2bfd2636
Author: pissang <bm...@gmail.com>
AuthorDate: Sat May 8 22:27:43 2021 +0800
test(visual): optimize case reload
---
test/runTest/runtime/ActionPlayback.js | 3 +++
test/runTest/runtime/main.js | 5 +++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/runTest/runtime/ActionPlayback.js b/test/runTest/runtime/ActionPlayback.js
index a7de86b..8ca6777 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 629d53c..d6f197d 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();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org