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 2020/02/20 13:56:16 UTC

[incubator-echarts] branch visual-test-improve-replay created (now b1657f3)

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a change to branch visual-test-improve-replay
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


      at b1657f3  test: reduce screenshots when mousewheel in replay

This branch includes the following new commits:

     new b1657f3  test: reduce screenshots when mousewheel in replay

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[incubator-echarts] 01/01: test: reduce screenshots when mousewheel in replay

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch visual-test-improve-replay
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit b1657f3fc3f09586ffc4db75e71d983524d93b54
Author: pissang <bm...@gmail.com>
AuthorDate: Thu Feb 20 21:55:40 2020 +0800

    test: reduce screenshots when mousewheel in replay
---
 test/runTest/Timeline.js | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/test/runTest/Timeline.js b/test/runTest/Timeline.js
index f115125..787a93b 100644
--- a/test/runTest/Timeline.js
+++ b/test/runTest/Timeline.js
@@ -31,12 +31,15 @@ module.exports = class Timeline {
         this._currentOpIndex = 0;
 
         this._client;
+
+        this._isLastOpMousewheel = false;
     }
 
     _reset() {
         this._currentOpIndex = 0;
         this._current = Date.now();
         this._elapsedTime = 0;
+        this._isLastOpMousewheel = false;
     }
 
 
@@ -102,6 +105,7 @@ module.exports = class Timeline {
         }
 
         let page = this._page;
+        let takenScreenshot = false;
         switch (op.type) {
             case 'mousedown':
                 await page.mouse.move(op.x, op.y);
@@ -130,7 +134,7 @@ module.exports = class Timeline {
 
                     element.dispatchEvent(event);
                 }, op.x, op.y, op.deltaX || 0, op.deltaY);
-
+                this._isLastOpMousewheel = true;
                 // console.log('mousewheel', op.x, op.y, op.deltaX, op.deltaY);
                 // await this._client.send('Input.dispatchMouseEvent', {
                 //     type: 'mouseWheel',
@@ -139,9 +143,10 @@ module.exports = class Timeline {
                 //     deltaX: op.deltaX,
                 //     deltaY: op.deltaY
                 // });
-                // break;
+                break;
             case 'screenshot':
                 await takeScreenshot();
+                takenScreenshot = true;
                 break;
             case 'valuechange':
                 if (op.target === 'select') {
@@ -159,7 +164,16 @@ module.exports = class Timeline {
             // TODO Configuration time
             await waitTime(delay / playbackSpeed);
             await takeScreenshot();
+            takenScreenshot = true;
             this._currentOpIndex++;
         }
+
+        if (this._isLastOpMousewheel && op.type !== 'mousewheel') {
+            // Only take screenshot after mousewheel finished
+            if (!takenScreenshot) {
+                takeScreenshot();
+            }
+            this._isLastOpMousewheel = false;
+        }
     }
 };
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org