Update app/index.js, app/test.html, testloader.js

This commit is contained in:
Namhyeon Go 2023-10-30 17:14:31 +09:00
parent 0f4dfcef20
commit ceb7de458e
3 changed files with 9 additions and 4 deletions

View File

@ -2,6 +2,7 @@
// The entrypoint on WelsonJS GUI envionment
var FILE = require("lib/file");
var SHELL = require("lib/shell");
var OldBrowser = require("lib/oldbrowser");
var Router = require("lib/router").Router;
@ -43,6 +44,10 @@ Router.add('/', function(render) {
// test
Router.add('/test', function(render) {
window.test_start = function(test_id) {
SHELL.show(["cscript", "app.js", "testloader", test_id]);
};
var data = JSON.parse(FILE.readFile("data/test-oss-20231030.json", FILE.CdoCharset.CdoUTF_8));
render("app\\test.html", {
"data": data

View File

@ -10,7 +10,7 @@
<div class="col width-fit mobile-width-fit"><span class="icon icon-bookmark color-blue"></span></div>
<div class="col width-fill mobile-width-fill" style="position: relative">
<span class="float-right" style="position: absolute; top: 0; right: 0;">
<button class="button" type="button">시험</button>
<button class="button" type="button" onclick="javascript:test_start('{{:id}}')">시험</button>
</span>
<div class="col width-fill mobile-width-fill">
<a class="fatty" href="#">{{:tags[0]}}</a>

View File

@ -158,6 +158,7 @@ function main(args) {
});
var description = test.description;
console.log("Test ID: " + test_id);
console.log("Will be test: " + description);
try {
@ -166,10 +167,9 @@ function main(args) {
console.error("ERROR: " + e.message)
}
console.log("Test ended");
console.log("Will be close this window after 90 seconds");
sleep(90 * 1000);
}
console.log(args.join(", "));
}
exports.main = main;