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 2019/09/08 15:04:44 UTC

[incubator-echarts] branch test-autorun updated: test: add icon for tests recorded actions in ui.

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 85dcb8f  test: add icon for tests recorded actions in ui.
85dcb8f is described below

commit 85dcb8f7f46ffdfd1088677a75454632c1300272
Author: pissang <bm...@gmail.com>
AuthorDate: Sun Sep 8 23:04:14 2019 +0800

    test: add icon for tests recorded actions in ui.
---
 test/runTest/client/client.css   |  5 +++++
 test/runTest/client/client.js    |  1 +
 test/runTest/client/index.html   |  2 +-
 test/runTest/recorder/index.html |  7 +++++--
 test/runTest/server.js           |  9 ++++++++-
 test/runTest/store.js            | 12 ++++++++++++
 6 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/test/runTest/client/client.css b/test/runTest/client/client.css
index 1b2b025..489aab3 100644
--- a/test/runTest/client/client.css
+++ b/test/runTest/client/client.css
@@ -58,6 +58,7 @@
     color: #f3f3f3;
     font-size: 20px;
     margin-left: 5px;
+    cursor: pointer;
 }
 .run-config-item {
     margin: 5px 0;
@@ -91,6 +92,10 @@
     margin-left: 3px;
     cursor: pointer;
 }
+.test-list li a.menu-link i {
+    font-size: 16px;
+    margin-left: 10px;
+}
 
 .test-list li.active {
     background: #e43c59;
diff --git a/test/runTest/client/client.js b/test/runTest/client/client.js
index 6ac28a1..bfd1e04 100644
--- a/test/runTest/client/client.js
+++ b/test/runTest/client/client.js
@@ -196,6 +196,7 @@ socket.on('connect', () => {
             position: 'top-right',
             duration: 8000
         });
+        console.log(`${res.count} test complete, Cost: ${(res.time / 1000).toFixed(1)} s. Threads: ${res.threads}`);
         app.running = false;
     });
 
diff --git a/test/runTest/client/index.html b/test/runTest/client/index.html
index aad6d83..d2d5720 100644
--- a/test/runTest/client/index.html
+++ b/test/runTest/client/index.html
@@ -67,7 +67,7 @@
                             :percentage="test.percentage"
                             :status="test.summary"
                         ></el-progress>
-                        <a :href="'#' + test.name" class="menu-link">{{test.name}}</a>
+                        <a :href="'#' + test.name" class="menu-link">{{test.name}}<i v-if="test.hasActions" class="el-icon-video-camera-solid"></i></a>
                     </li>
                 </ul>
             </el-aside>
diff --git a/test/runTest/recorder/index.html b/test/runTest/recorder/index.html
index ae54398..f077d43 100644
--- a/test/runTest/recorder/index.html
+++ b/test/runTest/recorder/index.html
@@ -58,8 +58,11 @@
         v-show="drawerVisible"
     >
         <ul>
-            <li v-for="testName in tests">
-                <a :href="'#' + testName" :class="{active: testName === currentTestName}">{{testName}}</a>
+            <li v-for="test in tests">
+                <a :href="'#' + test.name" :class="{active: test.name === currentTestName}">
+                    {{test.name}}
+                    <i v-if="test.hasActions" class="el-icon-video-camera-solid"></i>
+                </a>
             </li>
         </ul>
         <i class="el-icon-circle-close" @click="drawerVisible=false"></i>
diff --git a/test/runTest/server.js b/test/runTest/server.js
index 1cf628c..0d18d65 100644
--- a/test/runTest/server.js
+++ b/test/runTest/server.js
@@ -222,7 +222,14 @@ async function start() {
             socket.emit('finish');
         });
 
-        socket.emit('getTests', {tests: getTestsList().map(test => test.name)});
+        socket.emit('getTests', {
+            tests: getTestsList().map(test => {
+                return {
+                    name: test.name,
+                    hasActions: test.hasActions
+                };
+            })
+        });
     });
 
     console.log(`Dashboard: ${origin}/test/runTest/client/index.html`);
diff --git a/test/runTest/store.js b/test/runTest/store.js
index 9851b02..f5adc5e 100644
--- a/test/runTest/store.js
+++ b/test/runTest/store.js
@@ -62,6 +62,18 @@ module.exports.updateTestsList = async function () {
         _tests.push(test);
         _testsMap[fileUrl] = test;
     });
+    let statAsync = util.promisify(fs.stat);
+    // Find if file has actions.
+    await Promise.all(_tests.map(testOpt => {
+        return statAsync(path.join(__dirname, 'actions', testOpt.name + '.json'))
+            .then(() => {
+                testOpt.hasActions = true;
+            })
+            .catch(() => {
+                testOpt.hasActions = false;
+            });
+    }));
+
     return _tests;
 };
 


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