提交 85dcb8f7 编写于 作者: P pissang

test: add icon for tests recorded actions in ui.

上级 54ed04ff
......@@ -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;
......
......@@ -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;
});
......
......@@ -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>
......
......@@ -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>
......
......@@ -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`);
......
......@@ -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;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册