bt-runner 3.0.1 → 3.1.0
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/index.js +7 -62
- package/dist/index_debug.js +25 -18
- package/dist/{IRunner.js → util/Config.js} +0 -0
- package/dist/util/Server.js +64 -0
- package/{tmp/browsertests-9PMQFx/index1.html → dist/util/generateHtml.js} +10 -5
- package/dist/{getPort.js → util/getPort.js} +3 -2
- package/dist/util/index.js +21 -0
- package/dist/util/runTests.js +45 -0
- package/package.json +2 -5
- package/dist/generate.js +0 -62
- package/dist/server.js +0 -18
- package/tmp/.gitkeep +0 -0
- package/tmp/browsertests-9PMQFx/index2.html +0 -25
- package/tmp/browsertests-CRhBRJ/index1.html +0 -25
- package/tmp/browsertests-CRhBRJ/index2.html +0 -25
- package/tmp/browsertests-CRhBRJ/mocha.test.js +0 -100
- package/tmp/browsertests-CRhBRJ/nightwatch.json +0 -1
- package/tmp/browsertests-Ef8QDb/index1.html +0 -25
- package/tmp/browsertests-Ef8QDb/index2.html +0 -25
- package/tmp/browsertests-Ef8QDb/mocha.test.js +0 -100
- package/tmp/browsertests-Ef8QDb/nightwatch.json +0 -1
- package/tmp/browsertests-FNrySD/index1.html +0 -25
- package/tmp/browsertests-FNrySD/index2.html +0 -25
- package/tmp/browsertests-FNrySD/mocha.test.js +0 -100
- package/tmp/browsertests-FNrySD/nightwatch.json +0 -1
- package/tmp/browsertests-HnV7W1/index1.html +0 -25
- package/tmp/browsertests-HnV7W1/index2.html +0 -25
- package/tmp/browsertests-HnV7W1/mocha.test.js +0 -100
- package/tmp/browsertests-HnV7W1/nightwatch.json +0 -1
- package/tmp/browsertests-Kr11Ep/index1.html +0 -25
- package/tmp/browsertests-Kr11Ep/index2.html +0 -25
- package/tmp/browsertests-Kr11Ep/mocha.test.js +0 -100
- package/tmp/browsertests-Kr11Ep/nightwatch.json +0 -1
- package/tmp/browsertests-QTo9jV/index1.html +0 -25
- package/tmp/browsertests-QTo9jV/index2.html +0 -25
- package/tmp/browsertests-QTo9jV/mocha.test.js +0 -100
- package/tmp/browsertests-QTo9jV/nightwatch.json +0 -1
- package/tmp/browsertests-VXReLQ/index1.html +0 -25
- package/tmp/browsertests-VXReLQ/index2.html +0 -25
- package/tmp/browsertests-VXReLQ/mocha.test.js +0 -100
- package/tmp/browsertests-VXReLQ/nightwatch.json +0 -1
- package/tmp/browsertests-dat86a/index1.html +0 -25
- package/tmp/browsertests-dat86a/index2.html +0 -25
- package/tmp/browsertests-dat86a/mocha.test.js +0 -94
- package/tmp/browsertests-dat86a/nightwatch.json +0 -1
- package/tmp/browsertests-eI4Px3/index1.html +0 -25
- package/tmp/browsertests-eI4Px3/index2.html +0 -25
- package/tmp/browsertests-eI4Px3/mocha.test.js +0 -100
- package/tmp/browsertests-eI4Px3/nightwatch.json +0 -1
- package/tmp/browsertests-eQY4O5/index1.html +0 -25
- package/tmp/browsertests-eQY4O5/index2.html +0 -25
- package/tmp/browsertests-eQY4O5/mocha.test.js +0 -100
- package/tmp/browsertests-eQY4O5/nightwatch.json +0 -1
- package/tmp/browsertests-gOUWdm/index1.html +0 -25
- package/tmp/browsertests-gOUWdm/index2.html +0 -25
- package/tmp/browsertests-gOUWdm/mocha.test.js +0 -100
- package/tmp/browsertests-gOUWdm/nightwatch.json +0 -1
- package/tmp/browsertests-jhoSdz/index1.html +0 -25
- package/tmp/browsertests-jhoSdz/index2.html +0 -25
- package/tmp/browsertests-jhoSdz/mocha.test.js +0 -100
- package/tmp/browsertests-jhoSdz/nightwatch.json +0 -1
- package/tmp/browsertests-koaNEn/index1.html +0 -25
- package/tmp/browsertests-koaNEn/index2.html +0 -25
- package/tmp/browsertests-koaNEn/mocha.test.js +0 -100
- package/tmp/browsertests-koaNEn/nightwatch.json +0 -1
- package/tmp/browsertests-ngYMnq/index1.html +0 -25
- package/tmp/browsertests-ngYMnq/index2.html +0 -25
- package/tmp/browsertests-ngYMnq/mocha.test.js +0 -100
- package/tmp/browsertests-ngYMnq/nightwatch.json +0 -1
- package/tmp/browsertests-oAq8xk/index1.html +0 -25
- package/tmp/browsertests-oAq8xk/index2.html +0 -25
- package/tmp/browsertests-oAq8xk/mocha.test.js +0 -100
- package/tmp/browsertests-oAq8xk/nightwatch.json +0 -1
- package/tmp/browsertests-q1rpZj/index1.html +0 -25
- package/tmp/browsertests-q1rpZj/index2.html +0 -25
- package/tmp/browsertests-q1rpZj/mocha.test.js +0 -100
- package/tmp/browsertests-q1rpZj/nightwatch.json +0 -1
- package/tmp/browsertests-zYgHlc/index1.html +0 -25
- package/tmp/browsertests-zYgHlc/index2.html +0 -25
- package/tmp/browsertests-zYgHlc/mocha.test.js +0 -100
- package/tmp/browsertests-zYgHlc/nightwatch.json +0 -1
@@ -1,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,100 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
before((client, done) => {
|
5
|
-
client.captureBrowserConsoleLogs((event) => {
|
6
|
-
const args = event.args.map((arg) => arg.value)
|
7
|
-
console.log.apply(console, args)
|
8
|
-
})
|
9
|
-
|
10
|
-
done()
|
11
|
-
})
|
12
|
-
|
13
|
-
after((client, done) => {
|
14
|
-
client.end(() => done())
|
15
|
-
})
|
16
|
-
|
17
|
-
|
18
|
-
it("Should run the Mocha tests without error (runner 1)", async (client) => {
|
19
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
20
|
-
|
21
|
-
client.waitForElementVisible("#main")
|
22
|
-
|
23
|
-
const executeFunction = (done) => {
|
24
|
-
const mocha = window.mocha
|
25
|
-
|
26
|
-
//add required test librarys in this if statement
|
27
|
-
if (!mocha) {
|
28
|
-
console.log("Required library 'mocha' not loaded. Aborting...")
|
29
|
-
done({ failures: 1 })
|
30
|
-
return
|
31
|
-
}
|
32
|
-
|
33
|
-
if (!window.TEST) {
|
34
|
-
console.log("Required library 'TEST' not loaded. Aborting...")
|
35
|
-
done({ failures: 1 })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
if (!window.TEST2) {
|
39
|
-
console.log("Required library 'TEST2' not loaded. Aborting...")
|
40
|
-
done({ failures: 1 })
|
41
|
-
return
|
42
|
-
}
|
43
|
-
|
44
|
-
mocha.run(function (failures) {
|
45
|
-
done({ failures: failures })
|
46
|
-
})
|
47
|
-
}
|
48
|
-
|
49
|
-
const result = await new Promise(resolve => client.timeoutsAsyncScript(1500000).executeAsyncScript(
|
50
|
-
executeFunction,
|
51
|
-
(result) => resolve(result)
|
52
|
-
))
|
53
|
-
|
54
|
-
expect(result.value).to.not.be.undefined
|
55
|
-
expect(result.value.failures).to.equal(0)
|
56
|
-
})
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
it("Should run the Mocha tests without error (runner 2)", async (client) => {
|
61
|
-
client.url("http://localhost:7777/test-browser/index2.html")
|
62
|
-
|
63
|
-
client.waitForElementVisible("#main")
|
64
|
-
|
65
|
-
const executeFunction = (done) => {
|
66
|
-
const mocha = window.mocha
|
67
|
-
|
68
|
-
//add required test librarys in this if statement
|
69
|
-
if (!mocha) {
|
70
|
-
console.log("Required library 'mocha' not loaded. Aborting...")
|
71
|
-
done({ failures: 1 })
|
72
|
-
return
|
73
|
-
}
|
74
|
-
|
75
|
-
if (!window.TEST) {
|
76
|
-
console.log("Required library 'TEST' not loaded. Aborting...")
|
77
|
-
done({ failures: 1 })
|
78
|
-
return
|
79
|
-
}
|
80
|
-
if (!window.TEST2) {
|
81
|
-
console.log("Required library 'TEST2' not loaded. Aborting...")
|
82
|
-
done({ failures: 1 })
|
83
|
-
return
|
84
|
-
}
|
85
|
-
|
86
|
-
mocha.run(function (failures) {
|
87
|
-
done({ failures: failures })
|
88
|
-
})
|
89
|
-
}
|
90
|
-
|
91
|
-
const result = await new Promise(resolve => client.timeoutsAsyncScript(1500000).executeAsyncScript(
|
92
|
-
executeFunction,
|
93
|
-
(result) => resolve(result)
|
94
|
-
))
|
95
|
-
|
96
|
-
expect(result.value).to.not.be.undefined
|
97
|
-
expect(result.value.failures).to.equal(0)
|
98
|
-
})
|
99
|
-
|
100
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-Ef8QDb"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515,"timeout_options":{"timeout":1500000}},"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":["--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,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,100 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
before((client, done) => {
|
5
|
-
client.captureBrowserConsoleLogs((event) => {
|
6
|
-
const args = event.args.map((arg) => arg.value)
|
7
|
-
console.log.apply(console, args)
|
8
|
-
})
|
9
|
-
|
10
|
-
done()
|
11
|
-
})
|
12
|
-
|
13
|
-
after((client, done) => {
|
14
|
-
client.end(() => done())
|
15
|
-
})
|
16
|
-
|
17
|
-
|
18
|
-
it("Should run the Mocha tests without error (runner 1)", async (client) => {
|
19
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
20
|
-
|
21
|
-
client.waitForElementVisible("#main")
|
22
|
-
|
23
|
-
const executeFunction = (done) => {
|
24
|
-
const mocha = window.mocha
|
25
|
-
|
26
|
-
//add required test librarys in this if statement
|
27
|
-
if (!mocha) {
|
28
|
-
console.log("Required library 'mocha' not loaded. Aborting...")
|
29
|
-
done({ failures: 1 })
|
30
|
-
return
|
31
|
-
}
|
32
|
-
|
33
|
-
if (!window.TEST) {
|
34
|
-
console.log("Required library 'TEST' not loaded. Aborting...")
|
35
|
-
done({ failures: 1 })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
if (!window.TEST2) {
|
39
|
-
console.log("Required library 'TEST2' not loaded. Aborting...")
|
40
|
-
done({ failures: 1 })
|
41
|
-
return
|
42
|
-
}
|
43
|
-
|
44
|
-
mocha.run(function (failures) {
|
45
|
-
done({ failures: failures })
|
46
|
-
})
|
47
|
-
}
|
48
|
-
|
49
|
-
const result = await new Promise(resolve => client.timeoutsAsyncScript(1500000).executeAsyncScript(
|
50
|
-
executeFunction,
|
51
|
-
(result) => resolve(result)
|
52
|
-
))
|
53
|
-
|
54
|
-
expect(result.value).to.not.be.undefined
|
55
|
-
expect(result.value.failures).to.equal(0)
|
56
|
-
})
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
it("Should run the Mocha tests without error (runner 2)", async (client) => {
|
61
|
-
client.url("http://localhost:7777/test-browser/index2.html")
|
62
|
-
|
63
|
-
client.waitForElementVisible("#main")
|
64
|
-
|
65
|
-
const executeFunction = (done) => {
|
66
|
-
const mocha = window.mocha
|
67
|
-
|
68
|
-
//add required test librarys in this if statement
|
69
|
-
if (!mocha) {
|
70
|
-
console.log("Required library 'mocha' not loaded. Aborting...")
|
71
|
-
done({ failures: 1 })
|
72
|
-
return
|
73
|
-
}
|
74
|
-
|
75
|
-
if (!window.TEST) {
|
76
|
-
console.log("Required library 'TEST' not loaded. Aborting...")
|
77
|
-
done({ failures: 1 })
|
78
|
-
return
|
79
|
-
}
|
80
|
-
if (!window.TEST2) {
|
81
|
-
console.log("Required library 'TEST2' not loaded. Aborting...")
|
82
|
-
done({ failures: 1 })
|
83
|
-
return
|
84
|
-
}
|
85
|
-
|
86
|
-
mocha.run(function (failures) {
|
87
|
-
done({ failures: failures })
|
88
|
-
})
|
89
|
-
}
|
90
|
-
|
91
|
-
const result = await new Promise(resolve => client.timeoutsAsyncScript(1500000).executeAsyncScript(
|
92
|
-
executeFunction,
|
93
|
-
(result) => resolve(result)
|
94
|
-
))
|
95
|
-
|
96
|
-
expect(result.value).to.not.be.undefined
|
97
|
-
expect(result.value.failures).to.equal(0)
|
98
|
-
})
|
99
|
-
|
100
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-FNrySD"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515,"timeout_options":{"timeout":1500000}},"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":["--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,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,100 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
before((client, done) => {
|
5
|
-
client.captureBrowserConsoleLogs((event) => {
|
6
|
-
const args = event.args.map((arg) => arg.value)
|
7
|
-
console.log.apply(console, args)
|
8
|
-
})
|
9
|
-
|
10
|
-
done()
|
11
|
-
})
|
12
|
-
|
13
|
-
after((client, done) => {
|
14
|
-
client.end(() => done())
|
15
|
-
})
|
16
|
-
|
17
|
-
|
18
|
-
it("Should run the Mocha tests without error (runner 1)", async (client) => {
|
19
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
20
|
-
|
21
|
-
client.waitForElementVisible("#main")
|
22
|
-
|
23
|
-
const executeFunction = (done) => {
|
24
|
-
const mocha = window.mocha
|
25
|
-
|
26
|
-
//add required test librarys in this if statement
|
27
|
-
if (!mocha) {
|
28
|
-
console.log("Required library 'mocha' not loaded. Aborting...")
|
29
|
-
done({ failures: 1 })
|
30
|
-
return
|
31
|
-
}
|
32
|
-
|
33
|
-
if (!window.TEST) {
|
34
|
-
console.log("Required library 'TEST' not loaded. Aborting...")
|
35
|
-
done({ failures: 1 })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
if (!window.TEST2) {
|
39
|
-
console.log("Required library 'TEST2' not loaded. Aborting...")
|
40
|
-
done({ failures: 1 })
|
41
|
-
return
|
42
|
-
}
|
43
|
-
|
44
|
-
mocha.run(function (failures) {
|
45
|
-
done({ failures: failures })
|
46
|
-
})
|
47
|
-
}
|
48
|
-
|
49
|
-
const result = await new Promise(resolve => client.timeoutsAsyncScript(1500000).executeAsyncScript(
|
50
|
-
executeFunction,
|
51
|
-
(result) => resolve(result)
|
52
|
-
))
|
53
|
-
|
54
|
-
expect(result.value).to.not.be.undefined
|
55
|
-
expect(result.value.failures).to.equal(0)
|
56
|
-
})
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
it("Should run the Mocha tests without error (runner 2)", async (client) => {
|
61
|
-
client.url("http://localhost:7777/test-browser/index2.html")
|
62
|
-
|
63
|
-
client.waitForElementVisible("#main")
|
64
|
-
|
65
|
-
const executeFunction = (done) => {
|
66
|
-
const mocha = window.mocha
|
67
|
-
|
68
|
-
//add required test librarys in this if statement
|
69
|
-
if (!mocha) {
|
70
|
-
console.log("Required library 'mocha' not loaded. Aborting...")
|
71
|
-
done({ failures: 1 })
|
72
|
-
return
|
73
|
-
}
|
74
|
-
|
75
|
-
if (!window.TEST) {
|
76
|
-
console.log("Required library 'TEST' not loaded. Aborting...")
|
77
|
-
done({ failures: 1 })
|
78
|
-
return
|
79
|
-
}
|
80
|
-
if (!window.TEST2) {
|
81
|
-
console.log("Required library 'TEST2' not loaded. Aborting...")
|
82
|
-
done({ failures: 1 })
|
83
|
-
return
|
84
|
-
}
|
85
|
-
|
86
|
-
mocha.run(function (failures) {
|
87
|
-
done({ failures: failures })
|
88
|
-
})
|
89
|
-
}
|
90
|
-
|
91
|
-
const result = await new Promise(resolve => client.timeoutsAsyncScript(1500000).executeAsyncScript(
|
92
|
-
executeFunction,
|
93
|
-
(result) => resolve(result)
|
94
|
-
))
|
95
|
-
|
96
|
-
expect(result.value).to.not.be.undefined
|
97
|
-
expect(result.value.failures).to.equal(0)
|
98
|
-
})
|
99
|
-
|
100
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-HnV7W1"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515,"timeout_options":{"timeout":1500000}},"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":["--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,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,100 +0,0 @@
|
|
1
|
-
const expect = require("chai").expect
|
2
|
-
|
3
|
-
describe("Browser Mocha Tests", function () {
|
4
|
-
before((client, done) => {
|
5
|
-
client.captureBrowserConsoleLogs((event) => {
|
6
|
-
const args = event.args.map((arg) => arg.value)
|
7
|
-
console.log.apply(console, args)
|
8
|
-
})
|
9
|
-
|
10
|
-
done()
|
11
|
-
})
|
12
|
-
|
13
|
-
after((client, done) => {
|
14
|
-
client.end(() => done())
|
15
|
-
})
|
16
|
-
|
17
|
-
|
18
|
-
it("Should run the Mocha tests without error (runner 1)", async (client) => {
|
19
|
-
client.url("http://localhost:7777/test-browser/index1.html")
|
20
|
-
|
21
|
-
client.waitForElementVisible("#main")
|
22
|
-
|
23
|
-
const executeFunction = (done) => {
|
24
|
-
const mocha = window.mocha
|
25
|
-
|
26
|
-
//add required test librarys in this if statement
|
27
|
-
if (!mocha) {
|
28
|
-
console.log("Required library 'mocha' not loaded. Aborting...")
|
29
|
-
done({ failures: 1 })
|
30
|
-
return
|
31
|
-
}
|
32
|
-
|
33
|
-
if (!window.TEST) {
|
34
|
-
console.log("Required library 'TEST' not loaded. Aborting...")
|
35
|
-
done({ failures: 1 })
|
36
|
-
return
|
37
|
-
}
|
38
|
-
if (!window.TEST2) {
|
39
|
-
console.log("Required library 'TEST2' not loaded. Aborting...")
|
40
|
-
done({ failures: 1 })
|
41
|
-
return
|
42
|
-
}
|
43
|
-
|
44
|
-
mocha.run(function (failures) {
|
45
|
-
done({ failures: failures })
|
46
|
-
})
|
47
|
-
}
|
48
|
-
|
49
|
-
const result = await new Promise(resolve => client.timeoutsAsyncScript(1500000).executeAsyncScript(
|
50
|
-
executeFunction,
|
51
|
-
(result) => resolve(result)
|
52
|
-
))
|
53
|
-
|
54
|
-
expect(result.value).to.not.be.undefined
|
55
|
-
expect(result.value.failures).to.equal(0)
|
56
|
-
})
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
it("Should run the Mocha tests without error (runner 2)", async (client) => {
|
61
|
-
client.url("http://localhost:7777/test-browser/index2.html")
|
62
|
-
|
63
|
-
client.waitForElementVisible("#main")
|
64
|
-
|
65
|
-
const executeFunction = (done) => {
|
66
|
-
const mocha = window.mocha
|
67
|
-
|
68
|
-
//add required test librarys in this if statement
|
69
|
-
if (!mocha) {
|
70
|
-
console.log("Required library 'mocha' not loaded. Aborting...")
|
71
|
-
done({ failures: 1 })
|
72
|
-
return
|
73
|
-
}
|
74
|
-
|
75
|
-
if (!window.TEST) {
|
76
|
-
console.log("Required library 'TEST' not loaded. Aborting...")
|
77
|
-
done({ failures: 1 })
|
78
|
-
return
|
79
|
-
}
|
80
|
-
if (!window.TEST2) {
|
81
|
-
console.log("Required library 'TEST2' not loaded. Aborting...")
|
82
|
-
done({ failures: 1 })
|
83
|
-
return
|
84
|
-
}
|
85
|
-
|
86
|
-
mocha.run(function (failures) {
|
87
|
-
done({ failures: failures })
|
88
|
-
})
|
89
|
-
}
|
90
|
-
|
91
|
-
const result = await new Promise(resolve => client.timeoutsAsyncScript(1500000).executeAsyncScript(
|
92
|
-
executeFunction,
|
93
|
-
(result) => resolve(result)
|
94
|
-
))
|
95
|
-
|
96
|
-
expect(result.value).to.not.be.undefined
|
97
|
-
expect(result.value.failures).to.equal(0)
|
98
|
-
})
|
99
|
-
|
100
|
-
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-Kr11Ep"],"filter":"*.test.js","webdriver":{"start_process":true,"server_path":"/home/julian/.local/lib/node_modules/chromedriver/lib/chromedriver/chromedriver","port":9515,"timeout_options":{"timeout":1500000}},"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":["--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,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,25 +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
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.0.0/mocha.min.js"></script>
|
11
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.3.6/chai.min.js"></script>
|
12
|
-
<script>
|
13
|
-
mocha.setup("bdd")
|
14
|
-
mocha.reporter("spec")
|
15
|
-
</script>
|
16
|
-
<script>
|
17
|
-
window.TEST = {}
|
18
|
-
window.TEST2 = {}
|
19
|
-
</script>
|
20
|
-
|
21
|
-
<script src="/test/test.js"></script>
|
22
|
-
|
23
|
-
<div id="main">Test</div>
|
24
|
-
</body>
|
25
|
-
</html>
|