bt-runner 1.0.21 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generator.js +104 -20
- package/dist/index.js +45 -67
- package/dist/index_debug.js +13 -14
- package/dist/nightwatch.js +1 -7
- package/dist/server.js +10 -11
- package/package.json +8 -8
- package/tmp/browsertests-7fkStF/index1.html +0 -34
- package/tmp/browsertests-7fkStF/mocha1.test.js +0 -58
- package/tmp/browsertests-7fkStF/nightwatch.json +0 -1
- package/tmp/browsertests-YHaqFo/index1.html +0 -34
- package/tmp/browsertests-YHaqFo/mocha1.test.js +0 -58
- package/tmp/browsertests-YHaqFo/nightwatch.json +0 -1
- package/tmp/browsertests-hYX45f/index1.html +0 -34
- package/tmp/browsertests-hYX45f/mocha1.test.js +0 -58
- package/tmp/browsertests-hYX45f/nightwatch.json +0 -1
- package/tmp/browsertests-l6v6DC/index1.html +0 -34
- package/tmp/browsertests-l6v6DC/mocha1.test.js +0 -58
- package/tmp/browsertests-l6v6DC/nightwatch.json +0 -1
- package/tmp/browsertests-qy89ux/index1.html +0 -34
- package/tmp/browsertests-qy89ux/mocha1.test.js +0 -58
- package/tmp/browsertests-qy89ux/nightwatch.json +0 -1
package/dist/generator.js
CHANGED
@@ -18,16 +18,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
18
|
__setModuleDefault(result, mod);
|
19
19
|
return result;
|
20
20
|
};
|
21
|
-
exports
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
22
22
|
exports.generate = void 0;
|
23
|
-
|
24
|
-
|
25
|
-
function generate(runners, additionalScripts, debug, port) {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
for (var _i = 0, runners_1 = runners; _i < runners_1.length; _i++) {
|
30
|
-
var runner = runners_1[_i];
|
23
|
+
const fs = __importStar(require("fs"));
|
24
|
+
const path = __importStar(require("path"));
|
25
|
+
function generate(runners, additionalScripts, debug = false, port) {
|
26
|
+
const outputPath = fs.mkdtempSync(path.join(__dirname, "..", "tmp", "browsertests-"));
|
27
|
+
let it = 1;
|
28
|
+
for (const runner of runners) {
|
31
29
|
writeHtml(outputPath, it, runner.dependencies, additionalScripts, debug);
|
32
30
|
if (!debug) {
|
33
31
|
if (!runner.globals) {
|
@@ -44,17 +42,103 @@ function generate(runners, additionalScripts, debug, port) {
|
|
44
42
|
}
|
45
43
|
exports.generate = generate;
|
46
44
|
function writeHtml(outputPath, iteration, dependencies, additionalScripts, debug) {
|
47
|
-
|
45
|
+
const html = `<!DOCTYPE html>
|
46
|
+
<html>
|
47
|
+
<head>
|
48
|
+
<title>Mocha Tests</title>
|
49
|
+
</head>
|
50
|
+
|
51
|
+
<body>
|
52
|
+
<div id="mocha"></div>
|
53
|
+
|
54
|
+
${debug
|
48
55
|
? ""
|
49
|
-
:
|
50
|
-
|
56
|
+
: `
|
57
|
+
<script>
|
58
|
+
window.logs = []
|
59
|
+
const oldLog = console.log
|
60
|
+
console.log = function () {
|
61
|
+
oldLog.apply(console, arguments)
|
62
|
+
window.logs.push(Array.from(arguments))
|
63
|
+
}
|
64
|
+
</script>
|
65
|
+
`}
|
66
|
+
|
67
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
68
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
69
|
+
<script>
|
70
|
+
mocha.setup("bdd")
|
71
|
+
mocha.reporter("spec")
|
72
|
+
</script>
|
73
|
+
<script>
|
74
|
+
${additionalScripts ? additionalScripts.join("\n") : ""}
|
75
|
+
</script>
|
76
|
+
|
77
|
+
${dependencies.map((dependency) => ` <script src="/test/${dependency}"></script>`).join("\n")}
|
78
|
+
|
79
|
+
<div id="main">Test</div>
|
80
|
+
</body>
|
81
|
+
</html>`;
|
82
|
+
fs.writeFileSync(path.join(outputPath, `index${iteration}.html`), html);
|
51
83
|
}
|
52
84
|
function writeTestFile(outputPath, iteration, globals) {
|
53
|
-
|
54
|
-
.map(
|
85
|
+
const globalsString = globals
|
86
|
+
.map((glob) => `if (!window.${glob}) {
|
87
|
+
logs.push(["Required library '${glob}' not loaded. Aborting..."])
|
88
|
+
done({ failures: 1, logs: logs })
|
89
|
+
return
|
90
|
+
}`)
|
55
91
|
.join("\n");
|
56
|
-
|
57
|
-
|
92
|
+
const testContent = `const expect = require("chai").expect
|
93
|
+
|
94
|
+
describe("Browser Mocha Tests", function () {
|
95
|
+
beforeEach((client, done) => {
|
96
|
+
client.url("http://localhost:7777/test-browser/index${iteration}.html")
|
97
|
+
done()
|
98
|
+
})
|
99
|
+
|
100
|
+
after((client, done) => {
|
101
|
+
client.end(() => done())
|
102
|
+
})
|
103
|
+
|
104
|
+
it("Should run the Mocha tests without error", (client) => {
|
105
|
+
client.waitForElementVisible("#main")
|
106
|
+
client.timeoutsAsyncScript(1500000).executeAsync(
|
107
|
+
(_data, done) => {
|
108
|
+
const mocha = window.mocha
|
109
|
+
|
110
|
+
//add required test librarys in this if statement
|
111
|
+
if (!mocha) {
|
112
|
+
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
113
|
+
done({ failures: 1, logs: logs })
|
114
|
+
return
|
115
|
+
}
|
116
|
+
|
117
|
+
${globalsString}
|
118
|
+
|
119
|
+
mocha.run(function (failures) {
|
120
|
+
done({ failures: failures, logs: logs })
|
121
|
+
})
|
122
|
+
},
|
123
|
+
[],
|
124
|
+
(result) => {
|
125
|
+
console.log("\\n--- browser mocha output ---")
|
126
|
+
|
127
|
+
if (result && result.value && result.value.logs) {
|
128
|
+
for (const logs of result.value.logs) {
|
129
|
+
console.log.apply(null, logs)
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
console.log("--- finished browser mocha output ---")
|
134
|
+
|
135
|
+
expect(result.value).to.not.be.undefined
|
136
|
+
expect(result.value.failures).to.equal(0)
|
137
|
+
}
|
138
|
+
)
|
139
|
+
})
|
140
|
+
})`;
|
141
|
+
fs.writeFileSync(path.join(outputPath, `mocha${iteration}.test.js`), testContent);
|
58
142
|
}
|
59
143
|
function requireGlobal(packageName) {
|
60
144
|
var childProcess = require("child_process");
|
@@ -71,7 +155,7 @@ function requireGlobal(packageName) {
|
|
71
155
|
return require(main);
|
72
156
|
}
|
73
157
|
function writeConfig(outputPath, port) {
|
74
|
-
|
158
|
+
const settings = {
|
75
159
|
src_folders: [outputPath],
|
76
160
|
filter: "*.test.js",
|
77
161
|
webdriver: {
|
@@ -87,7 +171,7 @@ function writeConfig(outputPath, port) {
|
|
87
171
|
}
|
88
172
|
},
|
89
173
|
test_settings: {
|
90
|
-
|
174
|
+
default: {
|
91
175
|
request_timeout_options: {
|
92
176
|
timeout: 1500000
|
93
177
|
},
|
@@ -119,9 +203,9 @@ function writeConfig(outputPath, port) {
|
|
119
203
|
};
|
120
204
|
//@ts-ignore
|
121
205
|
if (process.platform === "win32" || process.platform === "win64") {
|
122
|
-
settings.test_settings
|
206
|
+
settings.test_settings.default.desiredCapabilities.chromeOptions.binary =
|
123
207
|
"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe";
|
124
208
|
}
|
125
209
|
settings.webdriver.server_path = requireGlobal("chromedriver").path;
|
126
|
-
fs.writeFileSync(path.join(outputPath,
|
210
|
+
fs.writeFileSync(path.join(outputPath, `nightwatch.json`), JSON.stringify(settings));
|
127
211
|
}
|
package/dist/index.js
CHANGED
@@ -19,74 +19,52 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
19
|
__setModuleDefault(result, mod);
|
20
20
|
return result;
|
21
21
|
};
|
22
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
23
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
24
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
25
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
26
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
27
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
28
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
29
|
-
});
|
30
|
-
};
|
31
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
32
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
33
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
34
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
35
|
-
function step(op) {
|
36
|
-
if (f) throw new TypeError("Generator is already executing.");
|
37
|
-
while (_) try {
|
38
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
39
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
40
|
-
switch (op[0]) {
|
41
|
-
case 0: case 1: t = op; break;
|
42
|
-
case 4: _.label++; return { value: op[1], done: false };
|
43
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
44
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
45
|
-
default:
|
46
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
47
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
48
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
49
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
50
|
-
if (t[2]) _.ops.pop();
|
51
|
-
_.trys.pop(); continue;
|
52
|
-
}
|
53
|
-
op = body.call(thisArg, _);
|
54
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
55
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
56
|
-
}
|
57
|
-
};
|
58
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
59
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
60
24
|
};
|
61
|
-
exports
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
nightwatch.runNightwatch(outputPath, path.resolve(nbt.testFolder));
|
89
|
-
return [2 /*return*/];
|
90
|
-
}
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
const child_process = __importStar(require("child_process"));
|
27
|
+
const Nightwatch = __importStar(require("nightwatch"));
|
28
|
+
const path = __importStar(require("path"));
|
29
|
+
const helpers_1 = require("yargs/helpers");
|
30
|
+
const yargs_1 = __importDefault(require("yargs/yargs"));
|
31
|
+
const generator = __importStar(require("./generator"));
|
32
|
+
const rimraf = require("rimraf");
|
33
|
+
Nightwatch.cli(async function (argv) {
|
34
|
+
const args = await (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
35
|
+
.option("config", {
|
36
|
+
alias: "c",
|
37
|
+
type: "string",
|
38
|
+
description: "select a config file",
|
39
|
+
default: "nbt.json"
|
40
|
+
})
|
41
|
+
.option("port", {
|
42
|
+
alias: "p",
|
43
|
+
type: "number",
|
44
|
+
description: "select a port",
|
45
|
+
default: 9515
|
46
|
+
}).argv;
|
47
|
+
const nbt = require(path.join(process.cwd(), args.config));
|
48
|
+
const tempFolder = generator.generate(nbt.runners, nbt.additionalScripts, false, args.port);
|
49
|
+
const testFolder = path.resolve(nbt.testFolder);
|
50
|
+
var httpServerProc = child_process.spawn("node", [`${__dirname}/server.js`, tempFolder, testFolder], {
|
51
|
+
stdio: "inherit"
|
91
52
|
});
|
92
|
-
|
53
|
+
argv.config = path.join(tempFolder, "nightwatch.json");
|
54
|
+
const runner = Nightwatch.CliRunner(argv);
|
55
|
+
try {
|
56
|
+
await runner.setup({});
|
57
|
+
await runner.runTests();
|
58
|
+
}
|
59
|
+
catch (err) {
|
60
|
+
console.error("An error occurred:", err);
|
61
|
+
}
|
62
|
+
finally {
|
63
|
+
cleanup(httpServerProc, tempFolder);
|
64
|
+
}
|
65
|
+
});
|
66
|
+
function cleanup(httpServerProc, tempFolder) {
|
67
|
+
httpServerProc.kill("SIGINT");
|
68
|
+
rimraf.sync(tempFolder);
|
69
|
+
process.exit(0);
|
70
|
+
}
|
package/dist/index_debug.js
CHANGED
@@ -22,21 +22,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
24
24
|
};
|
25
|
-
exports
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
app.use("/test-browser", express_1
|
34
|
-
app.use("/test", express_1
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
const express_1 = __importDefault(require("express"));
|
27
|
+
const express_http_proxy_1 = __importDefault(require("express-http-proxy"));
|
28
|
+
const path = __importStar(require("path"));
|
29
|
+
const generator = __importStar(require("./generator"));
|
30
|
+
const app = (0, express_1.default)();
|
31
|
+
const nbt = require(path.join(process.cwd(), "nbt.json"));
|
32
|
+
const outputPath = generator.generate(nbt.runners, nbt.additionalScripts, true, 9515);
|
33
|
+
app.use("/test-browser", express_1.default.static(outputPath));
|
34
|
+
app.use("/test", express_1.default.static(path.resolve(nbt.testFolder)));
|
35
35
|
if (nbt.proxies) {
|
36
|
-
for (
|
37
|
-
|
38
|
-
app.use(proxy.local, (0, express_http_proxy_1["default"])(proxy.remote));
|
36
|
+
for (const proxy of nbt.proxies) {
|
37
|
+
app.use(proxy.local, (0, express_http_proxy_1.default)(proxy.remote));
|
39
38
|
}
|
40
39
|
}
|
41
40
|
console.log("Server Started. Open at http://localhost:7777/test-browser/index1.html.");
|
42
|
-
app.listen(7777,
|
41
|
+
app.listen(7777, () => { });
|
package/dist/nightwatch.js
CHANGED
@@ -23,9 +23,8 @@ exports.runNightwatch = void 0;
|
|
23
23
|
var child_process = __importStar(require("child_process"));
|
24
24
|
var nightwatch = __importStar(require("nightwatch"));
|
25
25
|
var path = __importStar(require("path"));
|
26
|
-
var rimraf = require("rimraf");
|
27
26
|
function runNightwatch(tempFolder, testFolder) {
|
28
|
-
var httpServerProc = child_process.spawn("node", [__dirname
|
27
|
+
var httpServerProc = child_process.spawn("node", ["".concat(__dirname, "/server.js"), tempFolder, testFolder], {
|
29
28
|
stdio: "inherit"
|
30
29
|
});
|
31
30
|
nightwatch.cli(function (argv) {
|
@@ -56,8 +55,3 @@ function runNightwatch(tempFolder, testFolder) {
|
|
56
55
|
});
|
57
56
|
}
|
58
57
|
exports.runNightwatch = runNightwatch;
|
59
|
-
function cleanup(httpServerProc, tempFolder) {
|
60
|
-
httpServerProc.kill("SIGINT");
|
61
|
-
rimraf.sync(tempFolder);
|
62
|
-
process.exit(0);
|
63
|
-
}
|
package/dist/server.js
CHANGED
@@ -2,18 +2,17 @@
|
|
2
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
|
-
exports
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
app.use("/test-browser", express_1
|
10
|
-
app.use("/test", express_1
|
11
|
-
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const express_1 = __importDefault(require("express"));
|
7
|
+
const path = require("path");
|
8
|
+
const app = (0, express_1.default)();
|
9
|
+
app.use("/test-browser", express_1.default.static(process.argv[2]));
|
10
|
+
app.use("/test", express_1.default.static(process.argv[3]));
|
11
|
+
const config = require(path.join(process.cwd(), "nbt.json"));
|
12
12
|
if (config && config.proxies) {
|
13
|
-
|
14
|
-
for (
|
15
|
-
var proxy = _a[_i];
|
13
|
+
const httpproxy = require("express-http-proxy");
|
14
|
+
for (const proxy of config.proxies) {
|
16
15
|
app.use(proxy.local, httpproxy(proxy.remote));
|
17
16
|
}
|
18
17
|
}
|
19
|
-
app.listen(7777,
|
18
|
+
app.listen(7777, () => { });
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "bt-runner",
|
3
|
-
"version": "
|
3
|
+
"version": "2.0.0-beta.1",
|
4
4
|
"description": "",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -23,19 +23,19 @@
|
|
23
23
|
"dependencies": {
|
24
24
|
"chai": "^4.3.4",
|
25
25
|
"express": "^4.17.1",
|
26
|
-
"express-http-proxy": "^1.6.
|
27
|
-
"mocha": "^9.1.
|
28
|
-
"nightwatch": "
|
26
|
+
"express-http-proxy": "^1.6.3",
|
27
|
+
"mocha": "^9.1.3",
|
28
|
+
"nightwatch": "^2.0.0-beta.1",
|
29
29
|
"rimraf": "^3.0.2",
|
30
|
-
"yargs": "^17.
|
30
|
+
"yargs": "^17.3.0"
|
31
31
|
},
|
32
32
|
"devDependencies": {
|
33
33
|
"@types/express": "^4.17.13",
|
34
34
|
"@types/express-http-proxy": "^1.6.3",
|
35
|
-
"@types/express-serve-static-core": "^4.17.
|
36
|
-
"@types/node": "^16.
|
35
|
+
"@types/express-serve-static-core": "^4.17.26",
|
36
|
+
"@types/node": "^16.11.12",
|
37
37
|
"@types/rimraf": "^3.0.2",
|
38
|
-
"@types/yargs": "^17.0.
|
38
|
+
"@types/yargs": "^17.0.7"
|
39
39
|
},
|
40
40
|
"publishConfig": {
|
41
41
|
"registry": "https://registry.npmjs.org"
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Mocha Tests</title>
|
5
|
-
</head>
|
6
|
-
|
7
|
-
<body>
|
8
|
-
<div id="mocha"></div>
|
9
|
-
|
10
|
-
|
11
|
-
<script>
|
12
|
-
window.logs = []
|
13
|
-
console.log = function () {
|
14
|
-
window.logs.push(Array.from(arguments))
|
15
|
-
}
|
16
|
-
</script>
|
17
|
-
|
18
|
-
|
19
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
20
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
21
|
-
<script>
|
22
|
-
mocha.setup("bdd")
|
23
|
-
mocha.reporter("spec")
|
24
|
-
</script>
|
25
|
-
<script>
|
26
|
-
window.TEST = {}
|
27
|
-
window.TEST2 = {}
|
28
|
-
</script>
|
29
|
-
|
30
|
-
<script src="/test/test.js"></script>
|
31
|
-
|
32
|
-
<div id="main">Test</div>
|
33
|
-
</body>
|
34
|
-
</html>
|
@@ -1,58 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
beforeEach((client, done) => {
|
5
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
6
|
-
done()
|
7
|
-
})
|
8
|
-
|
9
|
-
after((client, done) => {
|
10
|
-
client.end(() => done())
|
11
|
-
})
|
12
|
-
|
13
|
-
it("Should run the Mocha tests without error", (client) => {
|
14
|
-
client.waitForElementVisible("#main")
|
15
|
-
client.timeoutsAsyncScript(1500000).executeAsync(
|
16
|
-
function (done) {
|
17
|
-
const mocha = window.mocha
|
18
|
-
|
19
|
-
//add required test librarys in this if statement
|
20
|
-
if (!mocha) {
|
21
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
22
|
-
done({ failures: 1, logs: logs })
|
23
|
-
return
|
24
|
-
}
|
25
|
-
|
26
|
-
if (!window.TEST) {
|
27
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
28
|
-
done({ failures: 1, logs: logs })
|
29
|
-
return
|
30
|
-
}
|
31
|
-
if (!window.TEST2) {
|
32
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
33
|
-
done({ failures: 1, logs: logs })
|
34
|
-
return
|
35
|
-
}
|
36
|
-
|
37
|
-
mocha.run(function (failures) {
|
38
|
-
done({ failures: failures, logs: logs })
|
39
|
-
})
|
40
|
-
},
|
41
|
-
[],
|
42
|
-
(result) => {
|
43
|
-
console.log("\n--- browser mocha output ---")
|
44
|
-
|
45
|
-
if (result && result.value && result.value.logs) {
|
46
|
-
for (const logs of result.value.logs) {
|
47
|
-
console.log.apply(null, logs)
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
console.log("--- finished browser mocha output ---")
|
52
|
-
|
53
|
-
expect(result.value).to.not.be.undefined
|
54
|
-
expect(result.value.failures).to.equal(0)
|
55
|
-
}
|
56
|
-
)
|
57
|
-
})
|
58
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-7fkStF"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515},"test_runner":{"type":"mocha","options":{"ui":"bdd","reporter":"spec"}},"test_settings":{"default":{"request_timeout_options":{"timeout":1500000},"desiredCapabilities":{"javascriptEnabled":true,"acceptSslCerts":true,"acceptInsecureCerts":true,"browserName":"chrome","chromeOptions":{"args":["headless","disable-gpu","ignore-certificate-errors","no-sandbox","disable-features=NetworkService"],"binary":"/usr/bin/google-chrome"}}}},"globals":{"waitForConditionTimeout":100000,"asyncHookTimeout":1500000,"unitTestsTimeout":100000,"customReporterCallbackTimeout":100000,"retryAssertionTimeout":50000}}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Mocha Tests</title>
|
5
|
-
</head>
|
6
|
-
|
7
|
-
<body>
|
8
|
-
<div id="mocha"></div>
|
9
|
-
|
10
|
-
|
11
|
-
<script>
|
12
|
-
window.logs = []
|
13
|
-
console.log = function () {
|
14
|
-
window.logs.push(Array.from(arguments))
|
15
|
-
}
|
16
|
-
</script>
|
17
|
-
|
18
|
-
|
19
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
20
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
21
|
-
<script>
|
22
|
-
mocha.setup("bdd")
|
23
|
-
mocha.reporter("spec")
|
24
|
-
</script>
|
25
|
-
<script>
|
26
|
-
window.TEST = {}
|
27
|
-
window.TEST2 = {}
|
28
|
-
</script>
|
29
|
-
|
30
|
-
<script src="/test/test.js"></script>
|
31
|
-
|
32
|
-
<div id="main">Test</div>
|
33
|
-
</body>
|
34
|
-
</html>
|
@@ -1,58 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
beforeEach((client, done) => {
|
5
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
6
|
-
done()
|
7
|
-
})
|
8
|
-
|
9
|
-
after((client, done) => {
|
10
|
-
client.end(() => done())
|
11
|
-
})
|
12
|
-
|
13
|
-
it("Should run the Mocha tests without error", (client) => {
|
14
|
-
client.waitForElementVisible("#main")
|
15
|
-
client.timeoutsAsyncScript(1500000).executeAsync(
|
16
|
-
function (done) {
|
17
|
-
const mocha = window.mocha
|
18
|
-
|
19
|
-
//add required test librarys in this if statement
|
20
|
-
if (!mocha) {
|
21
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
22
|
-
done({ failures: 1, logs: logs })
|
23
|
-
return
|
24
|
-
}
|
25
|
-
|
26
|
-
if (!window.TEST) {
|
27
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
28
|
-
done({ failures: 1, logs: logs })
|
29
|
-
return
|
30
|
-
}
|
31
|
-
if (!window.TEST2) {
|
32
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
33
|
-
done({ failures: 1, logs: logs })
|
34
|
-
return
|
35
|
-
}
|
36
|
-
|
37
|
-
mocha.run(function (failures) {
|
38
|
-
done({ failures: failures, logs: logs })
|
39
|
-
})
|
40
|
-
},
|
41
|
-
[],
|
42
|
-
(result) => {
|
43
|
-
console.log("\n--- browser mocha output ---")
|
44
|
-
|
45
|
-
if (result && result.value && result.value.logs) {
|
46
|
-
for (const logs of result.value.logs) {
|
47
|
-
console.log.apply(null, logs)
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
console.log("--- finished browser mocha output ---")
|
52
|
-
|
53
|
-
expect(result.value).to.not.be.undefined
|
54
|
-
expect(result.value.failures).to.equal(0)
|
55
|
-
}
|
56
|
-
)
|
57
|
-
})
|
58
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-YHaqFo"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515},"test_runner":{"type":"mocha","options":{"ui":"bdd","reporter":"spec"}},"test_settings":{"default":{"request_timeout_options":{"timeout":1500000},"desiredCapabilities":{"javascriptEnabled":true,"acceptSslCerts":true,"acceptInsecureCerts":true,"browserName":"chrome","chromeOptions":{"args":["headless","disable-gpu","ignore-certificate-errors","no-sandbox","disable-features=NetworkService"],"binary":"/usr/bin/google-chrome"}}}},"globals":{"waitForConditionTimeout":100000,"asyncHookTimeout":1500000,"unitTestsTimeout":100000,"customReporterCallbackTimeout":100000,"retryAssertionTimeout":50000}}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Mocha Tests</title>
|
5
|
-
</head>
|
6
|
-
|
7
|
-
<body>
|
8
|
-
<div id="mocha"></div>
|
9
|
-
|
10
|
-
|
11
|
-
<script>
|
12
|
-
window.logs = []
|
13
|
-
console.log = function () {
|
14
|
-
window.logs.push(Array.from(arguments))
|
15
|
-
}
|
16
|
-
</script>
|
17
|
-
|
18
|
-
|
19
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
20
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
21
|
-
<script>
|
22
|
-
mocha.setup("bdd")
|
23
|
-
mocha.reporter("spec")
|
24
|
-
</script>
|
25
|
-
<script>
|
26
|
-
window.TEST = {}
|
27
|
-
window.TEST2 = {}
|
28
|
-
</script>
|
29
|
-
|
30
|
-
<script src="/test/test.js"></script>
|
31
|
-
|
32
|
-
<div id="main">Test</div>
|
33
|
-
</body>
|
34
|
-
</html>
|
@@ -1,58 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
beforeEach((client, done) => {
|
5
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
6
|
-
done()
|
7
|
-
})
|
8
|
-
|
9
|
-
after((client, done) => {
|
10
|
-
client.end(() => done())
|
11
|
-
})
|
12
|
-
|
13
|
-
it("Should run the Mocha tests without error", (client) => {
|
14
|
-
client.waitForElementVisible("#main")
|
15
|
-
client.timeoutsAsyncScript(1500000).executeAsync(
|
16
|
-
function (done) {
|
17
|
-
const mocha = window.mocha
|
18
|
-
|
19
|
-
//add required test librarys in this if statement
|
20
|
-
if (!mocha) {
|
21
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
22
|
-
done({ failures: 1, logs: logs })
|
23
|
-
return
|
24
|
-
}
|
25
|
-
|
26
|
-
if (!window.TEST) {
|
27
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
28
|
-
done({ failures: 1, logs: logs })
|
29
|
-
return
|
30
|
-
}
|
31
|
-
if (!window.TEST2) {
|
32
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
33
|
-
done({ failures: 1, logs: logs })
|
34
|
-
return
|
35
|
-
}
|
36
|
-
|
37
|
-
mocha.run(function (failures) {
|
38
|
-
done({ failures: failures, logs: logs })
|
39
|
-
})
|
40
|
-
},
|
41
|
-
[],
|
42
|
-
(result) => {
|
43
|
-
console.log("\n--- browser mocha output ---")
|
44
|
-
|
45
|
-
if (result && result.value && result.value.logs) {
|
46
|
-
for (const logs of result.value.logs) {
|
47
|
-
console.log.apply(null, logs)
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
console.log("--- finished browser mocha output ---")
|
52
|
-
|
53
|
-
expect(result.value).to.not.be.undefined
|
54
|
-
expect(result.value.failures).to.equal(0)
|
55
|
-
}
|
56
|
-
)
|
57
|
-
})
|
58
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-hYX45f"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515},"test_runner":{"type":"mocha","options":{"ui":"bdd","reporter":"spec"}},"test_settings":{"default":{"request_timeout_options":{"timeout":1500000},"desiredCapabilities":{"javascriptEnabled":true,"acceptSslCerts":true,"acceptInsecureCerts":true,"browserName":"chrome","chromeOptions":{"args":["headless","disable-gpu","ignore-certificate-errors","no-sandbox","disable-features=NetworkService"],"binary":"/usr/bin/google-chrome"}}}},"globals":{"waitForConditionTimeout":100000,"asyncHookTimeout":1500000,"unitTestsTimeout":100000,"customReporterCallbackTimeout":100000,"retryAssertionTimeout":50000}}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Mocha Tests</title>
|
5
|
-
</head>
|
6
|
-
|
7
|
-
<body>
|
8
|
-
<div id="mocha"></div>
|
9
|
-
|
10
|
-
|
11
|
-
<script>
|
12
|
-
window.logs = []
|
13
|
-
console.log = function () {
|
14
|
-
window.logs.push(Array.from(arguments))
|
15
|
-
}
|
16
|
-
</script>
|
17
|
-
|
18
|
-
|
19
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
20
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
21
|
-
<script>
|
22
|
-
mocha.setup("bdd")
|
23
|
-
mocha.reporter("spec")
|
24
|
-
</script>
|
25
|
-
<script>
|
26
|
-
window.TEST = {}
|
27
|
-
window.TEST2 = {}
|
28
|
-
</script>
|
29
|
-
|
30
|
-
<script src="/test/test.js"></script>
|
31
|
-
|
32
|
-
<div id="main">Test</div>
|
33
|
-
</body>
|
34
|
-
</html>
|
@@ -1,58 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
beforeEach((client, done) => {
|
5
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
6
|
-
done()
|
7
|
-
})
|
8
|
-
|
9
|
-
after((client, done) => {
|
10
|
-
client.end(() => done())
|
11
|
-
})
|
12
|
-
|
13
|
-
it("Should run the Mocha tests without error", (client) => {
|
14
|
-
client.waitForElementVisible("#main")
|
15
|
-
client.timeoutsAsyncScript(1500000).executeAsync(
|
16
|
-
function (done) {
|
17
|
-
const mocha = window.mocha
|
18
|
-
|
19
|
-
//add required test librarys in this if statement
|
20
|
-
if (!mocha) {
|
21
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
22
|
-
done({ failures: 1, logs: logs })
|
23
|
-
return
|
24
|
-
}
|
25
|
-
|
26
|
-
if (!window.TEST) {
|
27
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
28
|
-
done({ failures: 1, logs: logs })
|
29
|
-
return
|
30
|
-
}
|
31
|
-
if (!window.TEST2) {
|
32
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
33
|
-
done({ failures: 1, logs: logs })
|
34
|
-
return
|
35
|
-
}
|
36
|
-
|
37
|
-
mocha.run(function (failures) {
|
38
|
-
done({ failures: failures, logs: logs })
|
39
|
-
})
|
40
|
-
},
|
41
|
-
[],
|
42
|
-
(result) => {
|
43
|
-
console.log("\n--- browser mocha output ---")
|
44
|
-
|
45
|
-
if (result && result.value && result.value.logs) {
|
46
|
-
for (const logs of result.value.logs) {
|
47
|
-
console.log.apply(null, logs)
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
console.log("--- finished browser mocha output ---")
|
52
|
-
|
53
|
-
expect(result.value).to.not.be.undefined
|
54
|
-
expect(result.value.failures).to.equal(0)
|
55
|
-
}
|
56
|
-
)
|
57
|
-
})
|
58
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-l6v6DC"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515},"test_runner":{"type":"mocha","options":{"ui":"bdd","reporter":"spec"}},"test_settings":{"default":{"request_timeout_options":{"timeout":1500000},"desiredCapabilities":{"javascriptEnabled":true,"acceptSslCerts":true,"acceptInsecureCerts":true,"browserName":"chrome","chromeOptions":{"args":["headless","disable-gpu","ignore-certificate-errors","no-sandbox","disable-features=NetworkService"],"binary":"/usr/bin/google-chrome"}}}},"globals":{"waitForConditionTimeout":100000,"asyncHookTimeout":1500000,"unitTestsTimeout":100000,"customReporterCallbackTimeout":100000,"retryAssertionTimeout":50000}}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Mocha Tests</title>
|
5
|
-
</head>
|
6
|
-
|
7
|
-
<body>
|
8
|
-
<div id="mocha"></div>
|
9
|
-
|
10
|
-
|
11
|
-
<script>
|
12
|
-
window.logs = []
|
13
|
-
console.log = function () {
|
14
|
-
window.logs.push(Array.from(arguments))
|
15
|
-
}
|
16
|
-
</script>
|
17
|
-
|
18
|
-
|
19
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
20
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
21
|
-
<script>
|
22
|
-
mocha.setup("bdd")
|
23
|
-
mocha.reporter("spec")
|
24
|
-
</script>
|
25
|
-
<script>
|
26
|
-
window.TEST = {}
|
27
|
-
window.TEST2 = {}
|
28
|
-
</script>
|
29
|
-
|
30
|
-
<script src="/test/test.js"></script>
|
31
|
-
|
32
|
-
<div id="main">Test</div>
|
33
|
-
</body>
|
34
|
-
</html>
|
@@ -1,58 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
beforeEach((client, done) => {
|
5
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
6
|
-
done()
|
7
|
-
})
|
8
|
-
|
9
|
-
after((client, done) => {
|
10
|
-
client.end(() => done())
|
11
|
-
})
|
12
|
-
|
13
|
-
it("Should run the Mocha tests without error", (client) => {
|
14
|
-
client.waitForElementVisible("#main")
|
15
|
-
client.timeoutsAsyncScript(1500000).executeAsync(
|
16
|
-
function (done) {
|
17
|
-
const mocha = window.mocha
|
18
|
-
|
19
|
-
//add required test librarys in this if statement
|
20
|
-
if (!mocha) {
|
21
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
22
|
-
done({ failures: 1, logs: logs })
|
23
|
-
return
|
24
|
-
}
|
25
|
-
|
26
|
-
if (!window.TEST) {
|
27
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
28
|
-
done({ failures: 1, logs: logs })
|
29
|
-
return
|
30
|
-
}
|
31
|
-
if (!window.TEST2) {
|
32
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
33
|
-
done({ failures: 1, logs: logs })
|
34
|
-
return
|
35
|
-
}
|
36
|
-
|
37
|
-
mocha.run(function (failures) {
|
38
|
-
done({ failures: failures, logs: logs })
|
39
|
-
})
|
40
|
-
},
|
41
|
-
[],
|
42
|
-
(result) => {
|
43
|
-
console.log("\n--- browser mocha output ---")
|
44
|
-
|
45
|
-
if (result && result.value && result.value.logs) {
|
46
|
-
for (const logs of result.value.logs) {
|
47
|
-
console.log.apply(null, logs)
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
console.log("--- finished browser mocha output ---")
|
52
|
-
|
53
|
-
expect(result.value).to.not.be.undefined
|
54
|
-
expect(result.value.failures).to.equal(0)
|
55
|
-
}
|
56
|
-
)
|
57
|
-
})
|
58
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-qy89ux"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515},"test_runner":{"type":"mocha","options":{"ui":"bdd","reporter":"spec"}},"test_settings":{"default":{"request_timeout_options":{"timeout":1500000},"desiredCapabilities":{"javascriptEnabled":true,"acceptSslCerts":true,"acceptInsecureCerts":true,"browserName":"chrome","chromeOptions":{"args":["headless","disable-gpu","ignore-certificate-errors","no-sandbox","disable-features=NetworkService"],"binary":"/usr/bin/google-chrome"}}}},"globals":{"waitForConditionTimeout":100000,"asyncHookTimeout":1500000,"unitTestsTimeout":100000,"customReporterCallbackTimeout":100000,"retryAssertionTimeout":50000}}
|