Browse Source

Fix CI

dev_h
ophir 4 years ago
parent
commit
189ebbed80
4 changed files with 49 additions and 32 deletions
  1. 4
    8
      .github/workflows/CI.yml
  2. 0
    23
      .github/workflows/nightwatch.json
  3. 0
    1
      .gitignore
  4. 45
    0
      nightwatch.conf.js

+ 4
- 8
.github/workflows/CI.yml View File

@@ -20,19 +20,15 @@ jobs:
20 20
 
21 21
     steps:
22 22
     - uses: actions/checkout@v2
23
-    - uses: nanasess/setup-chromedriver@master
24
-      with:
25
-        chromedriver-version: '79.0.3945.36'
26
-    - run: |
27
-        export DISPLAY=:99
28
-        sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
29
-        cp .github/workflows/nightwatch.json .
30 23
     - name: Use Node.js ${{ matrix.node-version }}
31 24
       uses: actions/setup-node@v1
32 25
       with:
33 26
         node-version: ${{ matrix.node-version }}
27
+    - run: |
28
+        export DISPLAY=:99
29
+        sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
34 30
     - run: npm ci
35 31
     - run: npm run build --if-present
36
-    - run: npm test
32
+    - run: npx nightwatch tests --verbose
37 33
       env:
38 34
         CI: true

+ 0
- 23
.github/workflows/nightwatch.json View File

@@ -1,23 +0,0 @@
1
-{
2
-  "src_folders": ["tests"],
3
-  "webdriver": {
4
-    "start_process": true,
5
-    "server_path": "node_modules/.bin/chromedriver",
6
-    "port": 9515
7
-  },
8
-  "test_settings": {
9
-    "default": {
10
-      "desiredCapabilities": {
11
-        "browserName": "chrome",
12
-        "javascriptEnabled": true,
13
-        "acceptSslCerts": true,
14
-        "chromeOptions": {
15
-          "prefs": {
16
-            "intl.accept_languages": "en-US,en"
17
-          },
18
-          "args": ["--headless"]
19
-        }
20
-      }
21
-    }
22
-  }
23
-}

+ 0
- 1
.gitignore View File

@@ -26,4 +26,3 @@ wbo-backup.zip
26 26
 
27 27
 # Nightwatch test results
28 28
 tests_output/
29
-nightwatch.conf.js

+ 45
- 0
nightwatch.conf.js View File

@@ -0,0 +1,45 @@
1
+// Autogenerated by Nightwatch
2
+// Refer to the online docs for more details: https://nightwatchjs.org/gettingstarted/configuration/
3
+const Services = {}; loadServices();
4
+
5
+module.exports = {
6
+  "src_folders": ["tests"],
7
+
8
+  "webdriver": {
9
+    "start_process": true,
10
+    "server_path": "./node_modules/.bin/geckodriver",
11
+    "cli_args": [
12
+      "--log", "debug"
13
+    ],
14
+    "port": 4444
15
+  },
16
+
17
+  "test_settings": {
18
+    "default": {
19
+      "desiredCapabilities": {
20
+        "browserName": "firefox",
21
+        "acceptInsecureCerts": true,
22
+        "alwaysMatch": {
23
+          "moz:firefoxOptions": {
24
+            "args": ["-headless"]
25
+          }
26
+        }
27
+
28
+      }
29
+    }
30
+  }
31
+};
32
+
33
+function loadServices() {
34
+  try {
35
+    Services.seleniumServer = require('selenium-server');
36
+  } catch (err) { }
37
+
38
+  try {
39
+    Services.chromedriver = require('chromedriver');
40
+  } catch (err) { }
41
+
42
+  try {
43
+    Services.geckodriver = require('geckodriver');
44
+  } catch (err) { }
45
+}

Loading…
Cancel
Save