bt-runner 2.0.5 → 3.0.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 (82) hide show
  1. package/dist/IRunner.js +2 -0
  2. package/dist/generate.js +62 -0
  3. package/dist/generator.js +62 -75
  4. package/dist/getPort.js +20 -0
  5. package/dist/index.js +63 -19
  6. package/dist/index_custom.js +100 -0
  7. package/dist/index_debug.js +13 -4
  8. package/dist/server.js +1 -1
  9. package/package.json +7 -10
  10. package/tmp/{browsertests-VXDG77 → browsertests-9PMQFx}/index1.html +2 -13
  11. package/tmp/browsertests-9PMQFx/index2.html +25 -0
  12. package/tmp/{browsertests-prIGUG → browsertests-CRhBRJ}/index1.html +2 -13
  13. package/tmp/browsertests-CRhBRJ/index2.html +25 -0
  14. package/tmp/browsertests-CRhBRJ/mocha.test.js +100 -0
  15. package/tmp/{browsertests-VXDG77 → browsertests-CRhBRJ}/nightwatch.json +1 -1
  16. package/tmp/browsertests-Ef8QDb/index1.html +25 -0
  17. package/tmp/browsertests-Ef8QDb/index2.html +25 -0
  18. package/tmp/browsertests-Ef8QDb/mocha.test.js +100 -0
  19. package/tmp/browsertests-Ef8QDb/nightwatch.json +1 -0
  20. package/tmp/browsertests-FNrySD/index1.html +25 -0
  21. package/tmp/browsertests-FNrySD/index2.html +25 -0
  22. package/tmp/browsertests-FNrySD/mocha.test.js +100 -0
  23. package/tmp/browsertests-FNrySD/nightwatch.json +1 -0
  24. package/tmp/browsertests-HnV7W1/index1.html +25 -0
  25. package/tmp/browsertests-HnV7W1/index2.html +25 -0
  26. package/tmp/browsertests-HnV7W1/mocha.test.js +100 -0
  27. package/tmp/browsertests-HnV7W1/nightwatch.json +1 -0
  28. package/tmp/browsertests-Kr11Ep/index1.html +25 -0
  29. package/tmp/browsertests-Kr11Ep/index2.html +25 -0
  30. package/tmp/browsertests-Kr11Ep/mocha.test.js +100 -0
  31. package/tmp/browsertests-Kr11Ep/nightwatch.json +1 -0
  32. package/tmp/browsertests-QTo9jV/index1.html +25 -0
  33. package/tmp/browsertests-QTo9jV/index2.html +25 -0
  34. package/tmp/browsertests-QTo9jV/mocha.test.js +100 -0
  35. package/tmp/browsertests-QTo9jV/nightwatch.json +1 -0
  36. package/tmp/browsertests-VXReLQ/index1.html +25 -0
  37. package/tmp/browsertests-VXReLQ/index2.html +25 -0
  38. package/tmp/browsertests-VXReLQ/mocha.test.js +100 -0
  39. package/tmp/browsertests-VXReLQ/nightwatch.json +1 -0
  40. package/tmp/browsertests-dat86a/index1.html +25 -0
  41. package/tmp/browsertests-dat86a/index2.html +25 -0
  42. package/tmp/browsertests-dat86a/mocha.test.js +94 -0
  43. package/tmp/browsertests-dat86a/nightwatch.json +1 -0
  44. package/tmp/browsertests-eI4Px3/index1.html +25 -0
  45. package/tmp/browsertests-eI4Px3/index2.html +25 -0
  46. package/tmp/browsertests-eI4Px3/mocha.test.js +100 -0
  47. package/tmp/browsertests-eI4Px3/nightwatch.json +1 -0
  48. package/tmp/browsertests-eQY4O5/index1.html +25 -0
  49. package/tmp/browsertests-eQY4O5/index2.html +25 -0
  50. package/tmp/browsertests-eQY4O5/mocha.test.js +100 -0
  51. package/tmp/browsertests-eQY4O5/nightwatch.json +1 -0
  52. package/tmp/browsertests-gOUWdm/index1.html +25 -0
  53. package/tmp/browsertests-gOUWdm/index2.html +25 -0
  54. package/tmp/browsertests-gOUWdm/mocha.test.js +100 -0
  55. package/tmp/browsertests-gOUWdm/nightwatch.json +1 -0
  56. package/tmp/browsertests-jhoSdz/index1.html +25 -0
  57. package/tmp/browsertests-jhoSdz/index2.html +25 -0
  58. package/tmp/browsertests-jhoSdz/mocha.test.js +100 -0
  59. package/tmp/browsertests-jhoSdz/nightwatch.json +1 -0
  60. package/tmp/browsertests-koaNEn/index1.html +25 -0
  61. package/tmp/browsertests-koaNEn/index2.html +25 -0
  62. package/tmp/browsertests-koaNEn/mocha.test.js +100 -0
  63. package/tmp/browsertests-koaNEn/nightwatch.json +1 -0
  64. package/tmp/browsertests-ngYMnq/index1.html +25 -0
  65. package/tmp/browsertests-ngYMnq/index2.html +25 -0
  66. package/tmp/browsertests-ngYMnq/mocha.test.js +100 -0
  67. package/tmp/browsertests-ngYMnq/nightwatch.json +1 -0
  68. package/tmp/browsertests-oAq8xk/index1.html +25 -0
  69. package/tmp/browsertests-oAq8xk/index2.html +25 -0
  70. package/tmp/browsertests-oAq8xk/mocha.test.js +100 -0
  71. package/tmp/browsertests-oAq8xk/nightwatch.json +1 -0
  72. package/tmp/browsertests-q1rpZj/index1.html +25 -0
  73. package/tmp/browsertests-q1rpZj/index2.html +25 -0
  74. package/tmp/browsertests-q1rpZj/mocha.test.js +100 -0
  75. package/tmp/browsertests-q1rpZj/nightwatch.json +1 -0
  76. package/tmp/browsertests-zYgHlc/index1.html +25 -0
  77. package/tmp/browsertests-zYgHlc/index2.html +25 -0
  78. package/tmp/browsertests-zYgHlc/mocha.test.js +100 -0
  79. package/tmp/browsertests-zYgHlc/nightwatch.json +1 -0
  80. package/tmp/browsertests-VXDG77/mocha1.test.js +0 -60
  81. package/tmp/browsertests-prIGUG/mocha1.test.js +0 -60
  82. package/tmp/browsertests-prIGUG/nightwatch.json +0 -1
@@ -0,0 +1,100 @@
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
+ })
@@ -0,0 +1 @@
1
+ {"src_folders":["/home/julian/git/jss/docker-node-browsertests/test-runner/tmp/browsertests-zYgHlc"],"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,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,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-prIGUG"],"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":["--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}}}},"globals":{"waitForConditionTimeout":100000,"asyncHookTimeout":1500000,"unitTestsTimeout":100000,"customReporterCallbackTimeout":100000,"retryAssertionTimeout":50000}}