bt-runner 2.0.0-beta.6 → 2.0.0-beta.7

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 CHANGED
@@ -185,7 +185,7 @@ function writeConfig(outputPath, port) {
185
185
  "goog:chromeOptions": {
186
186
  w3c: true,
187
187
  args: [
188
- // "--headless",
188
+ "--headless",
189
189
  "--disable-gpu",
190
190
  "--ignore-certificate-errors",
191
191
  "--no-sandbox",
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ const path = __importStar(require("path"));
29
29
  const helpers_1 = require("yargs/helpers");
30
30
  const yargs_1 = __importDefault(require("yargs/yargs"));
31
31
  const generator = __importStar(require("./generator"));
32
+ const rimraf = require("rimraf");
32
33
  Nightwatch.cli(async function (argv) {
33
34
  const args = await (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
34
35
  .option("config", {
@@ -64,6 +65,6 @@ Nightwatch.cli(async function (argv) {
64
65
  });
65
66
  function cleanup(httpServerProc, tempFolder) {
66
67
  httpServerProc.kill("SIGINT");
67
- // rimraf.sync(tempFolder)
68
+ rimraf.sync(tempFolder);
68
69
  process.exit(0);
69
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-runner",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-beta.7",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,36 @@
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>
@@ -0,0 +1,60 @@
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
+ })
@@ -0,0 +1 @@
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}}
@@ -0,0 +1,36 @@
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>
@@ -0,0 +1,60 @@
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
+ })
@@ -0,0 +1 @@
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}}
@@ -0,0 +1,36 @@
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>
@@ -0,0 +1,60 @@
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
+ })
@@ -0,0 +1 @@
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}}
@@ -0,0 +1,36 @@
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>
@@ -0,0 +1,59 @@
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
+ })
@@ -0,0 +1 @@
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}}
@@ -0,0 +1,36 @@
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>
@@ -0,0 +1,59 @@
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
+ })
@@ -0,0 +1 @@
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}}