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.
Files changed (81) hide show
  1. package/dist/index.js +7 -62
  2. package/dist/index_debug.js +25 -18
  3. package/dist/{IRunner.js → util/Config.js} +0 -0
  4. package/dist/util/Server.js +64 -0
  5. package/{tmp/browsertests-9PMQFx/index1.html → dist/util/generateHtml.js} +10 -5
  6. package/dist/{getPort.js → util/getPort.js} +3 -2
  7. package/dist/util/index.js +21 -0
  8. package/dist/util/runTests.js +45 -0
  9. package/package.json +2 -5
  10. package/dist/generate.js +0 -62
  11. package/dist/server.js +0 -18
  12. package/tmp/.gitkeep +0 -0
  13. package/tmp/browsertests-9PMQFx/index2.html +0 -25
  14. package/tmp/browsertests-CRhBRJ/index1.html +0 -25
  15. package/tmp/browsertests-CRhBRJ/index2.html +0 -25
  16. package/tmp/browsertests-CRhBRJ/mocha.test.js +0 -100
  17. package/tmp/browsertests-CRhBRJ/nightwatch.json +0 -1
  18. package/tmp/browsertests-Ef8QDb/index1.html +0 -25
  19. package/tmp/browsertests-Ef8QDb/index2.html +0 -25
  20. package/tmp/browsertests-Ef8QDb/mocha.test.js +0 -100
  21. package/tmp/browsertests-Ef8QDb/nightwatch.json +0 -1
  22. package/tmp/browsertests-FNrySD/index1.html +0 -25
  23. package/tmp/browsertests-FNrySD/index2.html +0 -25
  24. package/tmp/browsertests-FNrySD/mocha.test.js +0 -100
  25. package/tmp/browsertests-FNrySD/nightwatch.json +0 -1
  26. package/tmp/browsertests-HnV7W1/index1.html +0 -25
  27. package/tmp/browsertests-HnV7W1/index2.html +0 -25
  28. package/tmp/browsertests-HnV7W1/mocha.test.js +0 -100
  29. package/tmp/browsertests-HnV7W1/nightwatch.json +0 -1
  30. package/tmp/browsertests-Kr11Ep/index1.html +0 -25
  31. package/tmp/browsertests-Kr11Ep/index2.html +0 -25
  32. package/tmp/browsertests-Kr11Ep/mocha.test.js +0 -100
  33. package/tmp/browsertests-Kr11Ep/nightwatch.json +0 -1
  34. package/tmp/browsertests-QTo9jV/index1.html +0 -25
  35. package/tmp/browsertests-QTo9jV/index2.html +0 -25
  36. package/tmp/browsertests-QTo9jV/mocha.test.js +0 -100
  37. package/tmp/browsertests-QTo9jV/nightwatch.json +0 -1
  38. package/tmp/browsertests-VXReLQ/index1.html +0 -25
  39. package/tmp/browsertests-VXReLQ/index2.html +0 -25
  40. package/tmp/browsertests-VXReLQ/mocha.test.js +0 -100
  41. package/tmp/browsertests-VXReLQ/nightwatch.json +0 -1
  42. package/tmp/browsertests-dat86a/index1.html +0 -25
  43. package/tmp/browsertests-dat86a/index2.html +0 -25
  44. package/tmp/browsertests-dat86a/mocha.test.js +0 -94
  45. package/tmp/browsertests-dat86a/nightwatch.json +0 -1
  46. package/tmp/browsertests-eI4Px3/index1.html +0 -25
  47. package/tmp/browsertests-eI4Px3/index2.html +0 -25
  48. package/tmp/browsertests-eI4Px3/mocha.test.js +0 -100
  49. package/tmp/browsertests-eI4Px3/nightwatch.json +0 -1
  50. package/tmp/browsertests-eQY4O5/index1.html +0 -25
  51. package/tmp/browsertests-eQY4O5/index2.html +0 -25
  52. package/tmp/browsertests-eQY4O5/mocha.test.js +0 -100
  53. package/tmp/browsertests-eQY4O5/nightwatch.json +0 -1
  54. package/tmp/browsertests-gOUWdm/index1.html +0 -25
  55. package/tmp/browsertests-gOUWdm/index2.html +0 -25
  56. package/tmp/browsertests-gOUWdm/mocha.test.js +0 -100
  57. package/tmp/browsertests-gOUWdm/nightwatch.json +0 -1
  58. package/tmp/browsertests-jhoSdz/index1.html +0 -25
  59. package/tmp/browsertests-jhoSdz/index2.html +0 -25
  60. package/tmp/browsertests-jhoSdz/mocha.test.js +0 -100
  61. package/tmp/browsertests-jhoSdz/nightwatch.json +0 -1
  62. package/tmp/browsertests-koaNEn/index1.html +0 -25
  63. package/tmp/browsertests-koaNEn/index2.html +0 -25
  64. package/tmp/browsertests-koaNEn/mocha.test.js +0 -100
  65. package/tmp/browsertests-koaNEn/nightwatch.json +0 -1
  66. package/tmp/browsertests-ngYMnq/index1.html +0 -25
  67. package/tmp/browsertests-ngYMnq/index2.html +0 -25
  68. package/tmp/browsertests-ngYMnq/mocha.test.js +0 -100
  69. package/tmp/browsertests-ngYMnq/nightwatch.json +0 -1
  70. package/tmp/browsertests-oAq8xk/index1.html +0 -25
  71. package/tmp/browsertests-oAq8xk/index2.html +0 -25
  72. package/tmp/browsertests-oAq8xk/mocha.test.js +0 -100
  73. package/tmp/browsertests-oAq8xk/nightwatch.json +0 -1
  74. package/tmp/browsertests-q1rpZj/index1.html +0 -25
  75. package/tmp/browsertests-q1rpZj/index2.html +0 -25
  76. package/tmp/browsertests-q1rpZj/mocha.test.js +0 -100
  77. package/tmp/browsertests-q1rpZj/nightwatch.json +0 -1
  78. package/tmp/browsertests-zYgHlc/index1.html +0 -25
  79. package/tmp/browsertests-zYgHlc/index2.html +0 -25
  80. package/tmp/browsertests-zYgHlc/mocha.test.js +0 -100
  81. package/tmp/browsertests-zYgHlc/nightwatch.json +0 -1
@@ -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-QTo9jV"],"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-VXReLQ"],"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,94 +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
- it("Should run the Mocha tests without error (runner 1)", async (client) => {
18
- client.url("http://localhost:7777/test-browser/index1.html")
19
-
20
- client.waitForElementVisible("#main")
21
-
22
- const executeFunction = (done) => {
23
- const mocha = window.mocha
24
-
25
- //add required test librarys in this if statement
26
- if (!mocha) {
27
- console.log("Required library 'mocha' not loaded. Aborting...")
28
- done({ failures: 1 })
29
- return
30
- }
31
-
32
- if (!window.TEST) {
33
- console.log("Required library 'TEST' not loaded. Aborting...")
34
- done({ failures: 1 })
35
- return
36
- }
37
- if (!window.TEST2) {
38
- console.log("Required library 'TEST2' not loaded. Aborting...")
39
- done({ failures: 1 })
40
- return
41
- }
42
-
43
- mocha.run(function (failures) {
44
- done({ failures: failures })
45
- })
46
- }
47
-
48
- const result = await new Promise((resolve) =>
49
- client.timeoutsAsyncScript(1500000).executeAsyncScript(executeFunction, (result) => resolve(result))
50
- )
51
-
52
- expect(result.value).to.not.be.undefined
53
- expect(result.value.failures).to.equal(0)
54
- })
55
-
56
- it("Should run the Mocha tests without error (runner 2)", async (client) => {
57
- client.url("http://localhost:7777/test-browser/index2.html")
58
-
59
- client.waitForElementVisible("#main")
60
-
61
- const executeFunction = (done) => {
62
- const mocha = window.mocha
63
-
64
- //add required test librarys in this if statement
65
- if (!mocha) {
66
- console.log("Required library 'mocha' not loaded. Aborting...")
67
- done({ failures: 1 })
68
- return
69
- }
70
-
71
- if (!window.TEST) {
72
- console.log("Required library 'TEST' not loaded. Aborting...")
73
- done({ failures: 1 })
74
- return
75
- }
76
- if (!window.TEST2) {
77
- console.log("Required library 'TEST2' not loaded. Aborting...")
78
- done({ failures: 1 })
79
- return
80
- }
81
-
82
- mocha.run(function (failures) {
83
- done({ failures: failures })
84
- })
85
- }
86
-
87
- const result = await new Promise((resolve) =>
88
- client.timeoutsAsyncScript(1500000).executeAsyncScript(executeFunction, (result) => resolve(result))
89
- )
90
-
91
- expect(result.value).to.not.be.undefined
92
- expect(result.value.failures).to.equal(0)
93
- })
94
- })
@@ -1 +0,0 @@
1
- {"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-dat86a"],"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-eI4Px3"],"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>