bt-runner 2.0.0-beta.7 → 2.0.2
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/package.json +9 -9
- package/dist/nightwatch.js +0 -57
- package/tmp/browsertests-2fcYZ0/index1.html +0 -36
- package/tmp/browsertests-2fcYZ0/mocha1.test.js +0 -60
- package/tmp/browsertests-2fcYZ0/nightwatch.json +0 -1
- package/tmp/browsertests-V08Qr0/index1.html +0 -36
- package/tmp/browsertests-V08Qr0/mocha1.test.js +0 -60
- package/tmp/browsertests-V08Qr0/nightwatch.json +0 -1
- package/tmp/browsertests-VU06XW/index1.html +0 -36
- package/tmp/browsertests-VU06XW/mocha1.test.js +0 -58
- package/tmp/browsertests-VU06XW/nightwatch.json +0 -38
- package/tmp/browsertests-X9vFHn/index1.html +0 -36
- package/tmp/browsertests-X9vFHn/mocha1.test.js +0 -60
- package/tmp/browsertests-X9vFHn/nightwatch.json +0 -1
- package/tmp/browsertests-eRN2ih/index1.html +0 -36
- package/tmp/browsertests-eRN2ih/mocha1.test.js +0 -59
- package/tmp/browsertests-eRN2ih/nightwatch.json +0 -1
- package/tmp/browsertests-iEIWXm/index1.html +0 -36
- package/tmp/browsertests-iEIWXm/mocha1.test.js +0 -59
- package/tmp/browsertests-iEIWXm/nightwatch.json +0 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "bt-runner",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.2",
|
4
4
|
"description": "",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -21,21 +21,21 @@
|
|
21
21
|
"prepublishOnly": "tsc"
|
22
22
|
},
|
23
23
|
"dependencies": {
|
24
|
-
"chai": "^4.3.
|
25
|
-
"express": "^4.17.
|
24
|
+
"chai": "^4.3.6",
|
25
|
+
"express": "^4.17.2",
|
26
26
|
"express-http-proxy": "^1.6.3",
|
27
|
-
"mocha": "^9.
|
28
|
-
"nightwatch": "^2.0.
|
27
|
+
"mocha": "^9.2.0",
|
28
|
+
"nightwatch": "^2.0.2",
|
29
29
|
"rimraf": "^3.0.2",
|
30
|
-
"yargs": "^17.3.
|
30
|
+
"yargs": "^17.3.1"
|
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": "^
|
35
|
+
"@types/express-serve-static-core": "^4.17.28",
|
36
|
+
"@types/node": "^17.0.14",
|
37
37
|
"@types/rimraf": "^3.0.2",
|
38
|
-
"@types/yargs": "^17.0.
|
38
|
+
"@types/yargs": "^17.0.8"
|
39
39
|
},
|
40
40
|
"publishConfig": {
|
41
41
|
"registry": "https://registry.npmjs.org"
|
package/dist/nightwatch.js
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
-
}) : (function(o, m, k, k2) {
|
6
|
-
if (k2 === undefined) k2 = k;
|
7
|
-
o[k2] = m[k];
|
8
|
-
}));
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
-
}) : function(o, v) {
|
12
|
-
o["default"] = v;
|
13
|
-
});
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
-
if (mod && mod.__esModule) return mod;
|
16
|
-
var result = {};
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
-
__setModuleDefault(result, mod);
|
19
|
-
return result;
|
20
|
-
};
|
21
|
-
exports.__esModule = true;
|
22
|
-
exports.runNightwatch = void 0;
|
23
|
-
var child_process = __importStar(require("child_process"));
|
24
|
-
var nightwatch = __importStar(require("nightwatch"));
|
25
|
-
var path = __importStar(require("path"));
|
26
|
-
function runNightwatch(tempFolder, testFolder) {
|
27
|
-
var httpServerProc = child_process.spawn("node", ["".concat(__dirname, "/server.js"), tempFolder, testFolder], {
|
28
|
-
stdio: "inherit"
|
29
|
-
});
|
30
|
-
nightwatch.cli(function (argv) {
|
31
|
-
argv.config = path.join(tempFolder, "nightwatch.json");
|
32
|
-
var runner = nightwatch.CliRunner(argv);
|
33
|
-
runner
|
34
|
-
.setup()
|
35
|
-
.startWebDriver()["catch"](function (err) {
|
36
|
-
console.error(err);
|
37
|
-
cleanup(httpServerProc, tempFolder);
|
38
|
-
})
|
39
|
-
.then(function () {
|
40
|
-
return runner.runTests();
|
41
|
-
})["catch"](function (err) {
|
42
|
-
console.error(err);
|
43
|
-
runner.processListener.setExitCode(10);
|
44
|
-
cleanup(httpServerProc, tempFolder);
|
45
|
-
})
|
46
|
-
.then(function () {
|
47
|
-
return runner.stopWebDriver();
|
48
|
-
})
|
49
|
-
.then(function () {
|
50
|
-
cleanup(httpServerProc, tempFolder);
|
51
|
-
})["catch"](function (err) {
|
52
|
-
console.error(err);
|
53
|
-
cleanup(httpServerProc, tempFolder);
|
54
|
-
});
|
55
|
-
});
|
56
|
-
}
|
57
|
-
exports.runNightwatch = runNightwatch;
|
@@ -1,36 +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
|
-
const oldLog = console.log
|
14
|
-
console.log = function () {
|
15
|
-
oldLog.apply(console, arguments)
|
16
|
-
window.logs.push(Array.from(arguments))
|
17
|
-
}
|
18
|
-
</script>
|
19
|
-
|
20
|
-
|
21
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
22
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
23
|
-
<script>
|
24
|
-
mocha.setup("bdd")
|
25
|
-
mocha.reporter("spec")
|
26
|
-
</script>
|
27
|
-
<script>
|
28
|
-
window.TEST = {}
|
29
|
-
window.TEST2 = {}
|
30
|
-
</script>
|
31
|
-
|
32
|
-
<script src="/test/test.js"></script>
|
33
|
-
|
34
|
-
<div id="main">Test</div>
|
35
|
-
</body>
|
36
|
-
</html>
|
@@ -1,60 +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
|
-
(done) => {
|
17
|
-
const localDone = done
|
18
|
-
|
19
|
-
const mocha = window.mocha
|
20
|
-
|
21
|
-
//add required test librarys in this if statement
|
22
|
-
if (!mocha) {
|
23
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
24
|
-
localDone({ failures: 1, logs: logs })
|
25
|
-
return
|
26
|
-
}
|
27
|
-
|
28
|
-
if (!window.TEST) {
|
29
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
30
|
-
localDone({ failures: 1, logs: logs })
|
31
|
-
return
|
32
|
-
}
|
33
|
-
if (!window.TEST2) {
|
34
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
35
|
-
localDone({ failures: 1, logs: logs })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
|
39
|
-
mocha.run(function (failures) {
|
40
|
-
localDone({ failures: failures, logs: logs })
|
41
|
-
})
|
42
|
-
},
|
43
|
-
[],
|
44
|
-
(result) => {
|
45
|
-
console.log("\n--- browser mocha output ---")
|
46
|
-
|
47
|
-
if (result && result.value && result.value.logs) {
|
48
|
-
for (const logs of result.value.logs) {
|
49
|
-
console.log.apply(null, logs)
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
console.log("--- finished browser mocha output ---")
|
54
|
-
|
55
|
-
expect(result.value).to.not.be.undefined
|
56
|
-
expect(result.value.failures).to.equal(0)
|
57
|
-
}
|
58
|
-
)
|
59
|
-
})
|
60
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-2fcYZ0"],"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","goog:chromeOptions":{"w3c":true,"args":["--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,36 +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
|
-
const oldLog = console.log
|
14
|
-
console.log = function () {
|
15
|
-
oldLog.apply(console, arguments)
|
16
|
-
window.logs.push(Array.from(arguments))
|
17
|
-
}
|
18
|
-
</script>
|
19
|
-
|
20
|
-
|
21
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
22
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
23
|
-
<script>
|
24
|
-
mocha.setup("bdd")
|
25
|
-
mocha.reporter("spec")
|
26
|
-
</script>
|
27
|
-
<script>
|
28
|
-
window.TEST = {}
|
29
|
-
window.TEST2 = {}
|
30
|
-
</script>
|
31
|
-
|
32
|
-
<script src="/test/test.js"></script>
|
33
|
-
|
34
|
-
<div id="main">Test</div>
|
35
|
-
</body>
|
36
|
-
</html>
|
@@ -1,60 +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
|
-
(_data, done) => {
|
17
|
-
const localDone = typeof _data === "function" ? _data : done
|
18
|
-
|
19
|
-
const mocha = window.mocha
|
20
|
-
|
21
|
-
//add required test librarys in this if statement
|
22
|
-
if (!mocha) {
|
23
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
24
|
-
localDone({ failures: 1, logs: logs })
|
25
|
-
return
|
26
|
-
}
|
27
|
-
|
28
|
-
if (!window.TEST) {
|
29
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
30
|
-
localDone({ failures: 1, logs: logs })
|
31
|
-
return
|
32
|
-
}
|
33
|
-
if (!window.TEST2) {
|
34
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
35
|
-
localDone({ failures: 1, logs: logs })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
|
39
|
-
mocha.run(function (failures) {
|
40
|
-
localDone({ failures: failures, logs: logs })
|
41
|
-
})
|
42
|
-
},
|
43
|
-
[],
|
44
|
-
(result) => {
|
45
|
-
console.log("\n--- browser mocha output ---")
|
46
|
-
|
47
|
-
if (result && result.value && result.value.logs) {
|
48
|
-
for (const logs of result.value.logs) {
|
49
|
-
console.log.apply(null, logs)
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
console.log("--- finished browser mocha output ---")
|
54
|
-
|
55
|
-
expect(result.value).to.not.be.undefined
|
56
|
-
expect(result.value.failures).to.equal(0)
|
57
|
-
}
|
58
|
-
)
|
59
|
-
})
|
60
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-V08Qr0"],"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","goog:chromeOptions":{"w3c":true,"args":["--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,36 +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
|
-
const oldLog = console.log
|
14
|
-
console.log = function () {
|
15
|
-
oldLog.apply(console, arguments)
|
16
|
-
window.logs.push(Array.from(arguments))
|
17
|
-
}
|
18
|
-
</script>
|
19
|
-
|
20
|
-
|
21
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
22
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
23
|
-
<script>
|
24
|
-
mocha.setup("bdd")
|
25
|
-
mocha.reporter("spec")
|
26
|
-
</script>
|
27
|
-
<script>
|
28
|
-
window.TEST = {}
|
29
|
-
window.TEST2 = {}
|
30
|
-
</script>
|
31
|
-
|
32
|
-
<script src="/test/test.js"></script>
|
33
|
-
|
34
|
-
<div id="main">Test</div>
|
35
|
-
</body>
|
36
|
-
</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
|
-
(_data, 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,38 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"src_folders": ["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-VU06XW"],
|
3
|
-
"filter": "*.test.js",
|
4
|
-
"webdriver": {
|
5
|
-
"start_process": true,
|
6
|
-
"server_path": "/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver",
|
7
|
-
"port": 9515
|
8
|
-
},
|
9
|
-
"test_runner": { "type": "mocha", "options": { "ui": "bdd", "reporter": "spec" } },
|
10
|
-
"test_settings": {
|
11
|
-
"default": {
|
12
|
-
"request_timeout_options": { "timeout": 1500000 },
|
13
|
-
"desiredCapabilities": {
|
14
|
-
"javascriptEnabled": true,
|
15
|
-
"acceptSslCerts": true,
|
16
|
-
"acceptInsecureCerts": true,
|
17
|
-
"browserName": "chrome",
|
18
|
-
"goog:chromeOptions": {
|
19
|
-
"w3c": true,
|
20
|
-
"args": [
|
21
|
-
"--disable-gpu",
|
22
|
-
"--ignore-certificate-errors",
|
23
|
-
"--no-sandbox",
|
24
|
-
"--disable-features=NetworkService"
|
25
|
-
],
|
26
|
-
"binary": "/usr/bin/google-chrome"
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
},
|
31
|
-
"globals": {
|
32
|
-
"waitForConditionTimeout": 100000,
|
33
|
-
"asyncHookTimeout": 1500000,
|
34
|
-
"unitTestsTimeout": 100000,
|
35
|
-
"customReporterCallbackTimeout": 100000,
|
36
|
-
"retryAssertionTimeout": 50000
|
37
|
-
}
|
38
|
-
}
|
@@ -1,36 +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
|
-
const oldLog = console.log
|
14
|
-
console.log = function () {
|
15
|
-
oldLog.apply(console, arguments)
|
16
|
-
window.logs.push(Array.from(arguments))
|
17
|
-
}
|
18
|
-
</script>
|
19
|
-
|
20
|
-
|
21
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
22
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
23
|
-
<script>
|
24
|
-
mocha.setup("bdd")
|
25
|
-
mocha.reporter("spec")
|
26
|
-
</script>
|
27
|
-
<script>
|
28
|
-
window.TEST = {}
|
29
|
-
window.TEST2 = {}
|
30
|
-
</script>
|
31
|
-
|
32
|
-
<script src="/test/test.js"></script>
|
33
|
-
|
34
|
-
<div id="main">Test</div>
|
35
|
-
</body>
|
36
|
-
</html>
|
@@ -1,60 +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
|
-
(done) => {
|
17
|
-
const localDone = typeof _data === "function" ? _data : done
|
18
|
-
|
19
|
-
const mocha = window.mocha
|
20
|
-
|
21
|
-
//add required test librarys in this if statement
|
22
|
-
if (!mocha) {
|
23
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
24
|
-
localDone({ failures: 1, logs: logs })
|
25
|
-
return
|
26
|
-
}
|
27
|
-
|
28
|
-
if (!window.TEST) {
|
29
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
30
|
-
localDone({ failures: 1, logs: logs })
|
31
|
-
return
|
32
|
-
}
|
33
|
-
if (!window.TEST2) {
|
34
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
35
|
-
localDone({ failures: 1, logs: logs })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
|
39
|
-
mocha.run(function (failures) {
|
40
|
-
localDone({ failures: failures, logs: logs })
|
41
|
-
})
|
42
|
-
},
|
43
|
-
[],
|
44
|
-
(result) => {
|
45
|
-
console.log("\n--- browser mocha output ---")
|
46
|
-
|
47
|
-
if (result && result.value && result.value.logs) {
|
48
|
-
for (const logs of result.value.logs) {
|
49
|
-
console.log.apply(null, logs)
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
console.log("--- finished browser mocha output ---")
|
54
|
-
|
55
|
-
expect(result.value).to.not.be.undefined
|
56
|
-
expect(result.value.failures).to.equal(0)
|
57
|
-
}
|
58
|
-
)
|
59
|
-
})
|
60
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-X9vFHn"],"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","goog:chromeOptions":{"w3c":true,"args":["--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,36 +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
|
-
const oldLog = console.log
|
14
|
-
console.log = function () {
|
15
|
-
oldLog.apply(console, arguments)
|
16
|
-
window.logs.push(Array.from(arguments))
|
17
|
-
}
|
18
|
-
</script>
|
19
|
-
|
20
|
-
|
21
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
22
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
23
|
-
<script>
|
24
|
-
mocha.setup("bdd")
|
25
|
-
mocha.reporter("spec")
|
26
|
-
</script>
|
27
|
-
<script>
|
28
|
-
window.TEST = {}
|
29
|
-
window.TEST2 = {}
|
30
|
-
</script>
|
31
|
-
|
32
|
-
<script src="/test/test.js"></script>
|
33
|
-
|
34
|
-
<div id="main">Test</div>
|
35
|
-
</body>
|
36
|
-
</html>
|
@@ -1,59 +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
|
-
(done) => {
|
17
|
-
const localDone = done
|
18
|
-
|
19
|
-
const mocha = window.mocha
|
20
|
-
|
21
|
-
//add required test librarys in this if statement
|
22
|
-
if (!mocha) {
|
23
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
24
|
-
localDone({ failures: 1, logs: logs })
|
25
|
-
return
|
26
|
-
}
|
27
|
-
|
28
|
-
if (!window.TEST) {
|
29
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
30
|
-
localDone({ failures: 1, logs: logs })
|
31
|
-
return
|
32
|
-
}
|
33
|
-
if (!window.TEST2) {
|
34
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
35
|
-
localDone({ failures: 1, logs: logs })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
|
39
|
-
mocha.run(function (failures) {
|
40
|
-
localDone({ failures: failures, logs: logs })
|
41
|
-
})
|
42
|
-
},
|
43
|
-
(result) => {
|
44
|
-
console.log("\n--- browser mocha output ---")
|
45
|
-
|
46
|
-
if (result && result.value && result.value.logs) {
|
47
|
-
for (const logs of result.value.logs) {
|
48
|
-
console.log.apply(null, logs)
|
49
|
-
}
|
50
|
-
}
|
51
|
-
|
52
|
-
console.log("--- finished browser mocha output ---")
|
53
|
-
|
54
|
-
expect(result.value).to.not.be.undefined
|
55
|
-
expect(result.value.failures).to.equal(0)
|
56
|
-
}
|
57
|
-
)
|
58
|
-
})
|
59
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-eRN2ih"],"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","goog:chromeOptions":{"w3c":true,"args":["--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,36 +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
|
-
const oldLog = console.log
|
14
|
-
console.log = function () {
|
15
|
-
oldLog.apply(console, arguments)
|
16
|
-
window.logs.push(Array.from(arguments))
|
17
|
-
}
|
18
|
-
</script>
|
19
|
-
|
20
|
-
|
21
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/7.2.0/mocha.min.js"></script>
|
22
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.min.js"></script>
|
23
|
-
<script>
|
24
|
-
mocha.setup("bdd")
|
25
|
-
mocha.reporter("spec")
|
26
|
-
</script>
|
27
|
-
<script>
|
28
|
-
window.TEST = {}
|
29
|
-
window.TEST2 = {}
|
30
|
-
</script>
|
31
|
-
|
32
|
-
<script src="/test/test.js"></script>
|
33
|
-
|
34
|
-
<div id="main">Test</div>
|
35
|
-
</body>
|
36
|
-
</html>
|
@@ -1,59 +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
|
-
(done) => {
|
17
|
-
const localDone = done
|
18
|
-
|
19
|
-
const mocha = window.mocha
|
20
|
-
|
21
|
-
//add required test librarys in this if statement
|
22
|
-
if (!mocha) {
|
23
|
-
logs.push(["Required library 'mocha' not loaded. Aborting..."])
|
24
|
-
localDone({ failures: 1, logs: logs })
|
25
|
-
return
|
26
|
-
}
|
27
|
-
|
28
|
-
if (!window.TEST) {
|
29
|
-
logs.push(["Required library 'TEST' not loaded. Aborting..."])
|
30
|
-
localDone({ failures: 1, logs: logs })
|
31
|
-
return
|
32
|
-
}
|
33
|
-
if (!window.TEST2) {
|
34
|
-
logs.push(["Required library 'TEST2' not loaded. Aborting..."])
|
35
|
-
localDone({ failures: 1, logs: logs })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
|
39
|
-
mocha.run(function (failures) {
|
40
|
-
localDone({ failures: failures, logs: logs })
|
41
|
-
})
|
42
|
-
},
|
43
|
-
(result) => {
|
44
|
-
console.log("\n--- browser mocha output ---")
|
45
|
-
|
46
|
-
if (result && result.value && result.value.logs) {
|
47
|
-
for (const logs of result.value.logs) {
|
48
|
-
console.log.apply(null, logs)
|
49
|
-
}
|
50
|
-
}
|
51
|
-
|
52
|
-
console.log("--- finished browser mocha output ---")
|
53
|
-
|
54
|
-
expect(result.value).to.not.be.undefined
|
55
|
-
expect(result.value.failures).to.equal(0)
|
56
|
-
}
|
57
|
-
)
|
58
|
-
})
|
59
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-iEIWXm"],"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","goog:chromeOptions":{"w3c":true,"args":["--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}}
|