very basic testing implementation

This commit is contained in:
Nicholas Palenchar
2020-01-24 12:18:55 -05:00
parent bc4c59694c
commit 708043dd6b
2 changed files with 9 additions and 9 deletions

View File

@@ -32,15 +32,15 @@ export default function runTestScriptWitVariables(script, variables) {
let errors = null; let errors = null;
new Function("pw", script)(pw); new Function("pw", script)(pw);
// //
const report = pw._report.map(item => { const testReports = pw._testReports.map(item => {
if (item.status) { if (item.result) {
item.styles = styles[status]; item.styles = styles[item.result];
} else { } else {
item.styles = styles.none; item.styles = styles.none;
} }
return item; return item;
}); });
return {report, errors: pw._errors, testResults: pw._testReports}; return {report: pw._report, errors: pw._errors, testResults: testReports};
} }
function test(descriptor, func, _testReports) { function test(descriptor, func, _testReports) {

View File

@@ -283,7 +283,7 @@
> >
</button> </button>
<button <button
:class="'icon' + (showPreRequestScript ? ' info-response' : '')" :class="'icon' + (testsEnabled ? ' info-response' : '')"
id="preRequestScriptButto" id="preRequestScriptButto"
v-tooltip.bottom="{ v-tooltip.bottom="{
content: !testsEnabled content: !testsEnabled
@@ -296,7 +296,7 @@
class="material-icons" class="material-icons"
:class="testsEnabled" :class="testsEnabled"
v-if="!testsEnabled" v-if="!testsEnabled"
>code</i >assignment_turned_in</i
> >
<i class="material-icons" :class="testsEnabled" v-else <i class="material-icons" :class="testsEnabled" v-else
>close</i >close</i
@@ -371,9 +371,9 @@
/> />
<label>Test Reports<span v-if="testReports"></span></label> <label>Test Reports<span v-if="testReports"></span></label>
<div v-if="testReports"> <div v-if="testReports">
<div v-for="testReport in testReports.testReports"> <div v-for="testReport in testReports">
<div v-if="testReport.status"> <div v-if="testReport.result">
<i class="material-icons" :class="testReport.styles.class">{{testReport.styles.icon}}</i> {{testReport.result}} <span :class="testReport.styles.class"><i class="material-icons">{{testReport.styles.icon}}</i> {{testReport.result}}</span>
<ul v-if="testReport.message"> <ul v-if="testReport.message">
<li>{{testReport.message}}</li> <li>{{testReport.message}}</li>
</ul> </ul>