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

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


The following commit(s) were added to refs/heads/test-autorun by this push:
     new 1d9a29d  test: optimize ui
1d9a29d is described below

commit 1d9a29d6fc2a86ac4c4f490ae14897c1dd0b2910
Author: pissang <bm2736...@gmail.com>
AuthorDate: Tue Sep 10 01:14:31 2019 +0800

    test: optimize ui
---
 test/lib/testHelper.js                     | 18 ++++++++++++++++--
 test/runTest/actions/connect-manually.json |  2 +-
 test/runTest/client/client.css             |  4 ++++
 test/runTest/client/index.html             | 17 +++++++++++++----
 test/runTest/server.js                     |  1 +
 test/runTest/store.js                      |  4 ++--
 6 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/test/lib/testHelper.js b/test/lib/testHelper.js
index 7139b70..4e02abe 100644
--- a/test/lib/testHelper.js
+++ b/test/lib/testHelper.js
@@ -251,10 +251,24 @@
 
 
     testHelper.resizable = function (chart) {
+        let dom = chart.getDom();
+        let width = dom.clientWidth;
+        let height = dom.clientHeight;
+        function resize() {
+            let newWidth = dom.clientWidth;
+            let newHeight = dom.clientHeight;
+            if (width !== newWidth || height !== newHeight) {
+                chart.resize();
+                width = newWidth;
+                height = newHeight;
+            }
+        }
         if (window.attachEvent) {
+            // Use builtin resize in IE
             window.attachEvent('onresize', chart.resize);
-        } else if (window.addEventListener) {
-            window.addEventListener('resize', chart.resize, false);
+        }
+        else if (window.addEventListener) {
+            window.addEventListener('resize', resize, false);
         }
     };
 
diff --git a/test/runTest/actions/connect-manually.json 
b/test/runTest/actions/connect-manually.json
index a153071..c247c30 100644
--- a/test/runTest/actions/connect-manually.json
+++ b/test/runTest/actions/connect-manually.json
@@ -1 +1 @@
-[{"name":"Action 
1","ops":[{"type":"screenshot","time":678},{"type":"mousemove","time":1014,"x":172,"y":191},{"type":"mousemove","time":1215,"x":274,"y":193},{"type":"mousemove","time":1470,"x":274,"y":193},{"type":"screenshot","time":2279},{"type":"mousemove","time":2381,"x":276,"y":192},{"type":"mousemove","time":2582,"x":318,"y":190},{"type":"mousemove","time":2782,"x":324,"y":190},{"type":"screenshot","time":3418},{"type":"mousemove","time":3488,"x":343,"y":190},{"type":"mousemove","
 [...]
\ No newline at end of file
+[{"name":"Action 
1","ops":[{"type":"mousemove","time":684,"x":176,"y":189},{"type":"mousemove","time":897,"x":193,"y":190},{"type":"screenshot","time":1559},{"type":"mousemove","time":2386,"x":194,"y":190},{"type":"mousemove","time":2587,"x":260,"y":195},{"type":"mousemove","time":2793,"x":318,"y":198},{"type":"mousemove","time":3008,"x":459,"y":198},{"type":"mousemove","time":3217,"x":460,"y":198},{"type":"mousemove","time":4472,"x":465,"y":198},{"type":"mousemove","time":4672,"x":590,"
 [...]
\ No newline at end of file
diff --git a/test/runTest/client/client.css b/test/runTest/client/client.css
index 489aab3..46898b7 100644
--- a/test/runTest/client/client.css
+++ b/test/runTest/client/client.css
@@ -112,6 +112,10 @@
     font-size: 12px!important;
 }
 
+.test-result .el-progress__text {
+    font-size: 14px!important;
+}
+
 .test-result h3 {
     font-size: 40px;
     font-weight: 200;
diff --git a/test/runTest/client/index.html b/test/runTest/client/index.html
index abc67de..4e3f020 100644
--- a/test/runTest/client/index.html
+++ b/test/runTest/client/index.html
@@ -86,6 +86,15 @@
             <el-main>
                 <div v-if="currentTest" class="test-result">
                     <div class="title">
+                        <el-progress
+                            v-if="currentTest.status === 'finished'"
+                            type="circle"
+                            :width="30"
+                            :stroke-width="4"
+                            :percentage="currentTest.percentage"
+                            :status="currentTest.summary"
+                            style="margin-top: 5px;"
+                        ></el-progress>
                         <h3>{{currentTest.name}}</h3>
                         <el-button-group style="margin-left: 10px">
                             <el-button title="Run Selected" 
@click="runTest(currentTest.name)" :loading="running" circle type="primary" 
icon="el-icon-caret-right"></el-button>
@@ -98,7 +107,7 @@
                     <div class="test-screenshots" v-for="(result, idx) in 
currentTest.results">
                         <!-- Not display title if it's same with previous -->
                         <h4 v-if="result.desc !== (currentTest.results[idx - 
1] && currentTest.results[idx - 1].desc)">
-                            {{result.desc || result.name}}
+                            <i class="el-icon-s-operation"></i>{{result.desc 
|| result.name}}
                         </h4>
                         <el-row :gutter="40" class="screenshots">
                             <el-col :span="8">
@@ -106,7 +115,7 @@
                                     <div slot="header" class="clearfix">
                                         <span>Expected</span>
                                     </div>
-                                    <el-image :src="result.expected" 
:preview-src-list="[result.expected]"></el-image>
+                                    <el-image :src="result.expected + '?' + 
Date.now()"></el-image>
                                 </el-card>
                             </el-col>
 
@@ -115,7 +124,7 @@
                                     <div slot="header" class="clearfix">
                                         <span>Actual</span>
                                     </div>
-                                    <el-image :src="result.actual" 
:preview-src-list="[result.actual]"></el-image>
+                                    <el-image :src="result.actual + '?' + 
Date.now()"></el-image>
                                 </el-card>
                             </el-col>
 
@@ -124,7 +133,7 @@
                                     <div slot="header" class="clearfix">
                                         
<span>Diff({{result.diffRatio.toFixed(4)}})</span>
                                     </div>
-                                    <el-image :src="result.diff" 
:preview-src-list="[result.diff]"></el-image>
+                                    <el-image :src="result.diff + '?' + 
Date.now()" :preview-src-list="[result.diff]"></el-image>
                                 </el-card>
                             </el-col>
                         </el-row>
diff --git a/test/runTest/server.js b/test/runTest/server.js
index 120762d..17949d5 100644
--- a/test/runTest/server.js
+++ b/test/runTest/server.js
@@ -245,6 +245,7 @@ async function start() {
     });
 
     console.log(`Dashboard: ${origin}/test/runTest/client/index.html`);
+    console.log(`Interaction Recorder: 
${origin}/test/runTest/recorder/index.html`);
     // open(`${origin}/test/runTest/client/index.html`);
 
 }
diff --git a/test/runTest/store.js b/test/runTest/store.js
index 9457904..5ab4aac 100644
--- a/test/runTest/store.js
+++ b/test/runTest/store.js
@@ -2,7 +2,7 @@ const path = require('path');
 const fse = require('fs-extra');
 const fs = require('fs');
 const glob = require('glob');
-const {getTestName} = require('./util');
+const {testNameFromFile} = require('./util');
 const util = require('util');
 const blacklist = require('./blacklist');
 
@@ -53,7 +53,7 @@ module.exports.updateTestsList = async function () {
 
         let test = {
             fileUrl,
-            name: getTestName(fileUrl),
+            name: testNameFromFile(fileUrl),
             // Default status should be unkown
             // status: 'pending',
             results: []


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

Reply via email to