From 189ebbed80800b1847aa7290e9a22c4d2921e89d Mon Sep 17 00:00:00 2001 From: ophir Date: Tue, 28 Apr 2020 00:42:49 +0200 Subject: [PATCH] Fix CI --- .github/workflows/CI.yml | 12 +++------ .github/workflows/nightwatch.json | 23 ---------------- .gitignore | 1 - nightwatch.conf.js | 45 +++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/nightwatch.json create mode 100644 nightwatch.conf.js diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 420df80f..14b48bbf 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -20,19 +20,15 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: nanasess/setup-chromedriver@master - with: - chromedriver-version: '79.0.3945.36' - - run: | - export DISPLAY=:99 - sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional - cp .github/workflows/nightwatch.json . - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - run: | + export DISPLAY=:99 + sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional - run: npm ci - run: npm run build --if-present - - run: npm test + - run: npx nightwatch tests --verbose env: CI: true diff --git a/.github/workflows/nightwatch.json b/.github/workflows/nightwatch.json deleted file mode 100644 index 9b0caa73..00000000 --- a/.github/workflows/nightwatch.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "src_folders": ["tests"], - "webdriver": { - "start_process": true, - "server_path": "node_modules/.bin/chromedriver", - "port": 9515 - }, - "test_settings": { - "default": { - "desiredCapabilities": { - "browserName": "chrome", - "javascriptEnabled": true, - "acceptSslCerts": true, - "chromeOptions": { - "prefs": { - "intl.accept_languages": "en-US,en" - }, - "args": ["--headless"] - } - } - } - } -} diff --git a/.gitignore b/.gitignore index e2d086fc..6405991f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,3 @@ wbo-backup.zip # Nightwatch test results tests_output/ -nightwatch.conf.js \ No newline at end of file diff --git a/nightwatch.conf.js b/nightwatch.conf.js new file mode 100644 index 00000000..647e40ee --- /dev/null +++ b/nightwatch.conf.js @@ -0,0 +1,45 @@ +// Autogenerated by Nightwatch +// Refer to the online docs for more details: https://nightwatchjs.org/gettingstarted/configuration/ +const Services = {}; loadServices(); + +module.exports = { + "src_folders": ["tests"], + + "webdriver": { + "start_process": true, + "server_path": "./node_modules/.bin/geckodriver", + "cli_args": [ + "--log", "debug" + ], + "port": 4444 + }, + + "test_settings": { + "default": { + "desiredCapabilities": { + "browserName": "firefox", + "acceptInsecureCerts": true, + "alwaysMatch": { + "moz:firefoxOptions": { + "args": ["-headless"] + } + } + + } + } + } +}; + +function loadServices() { + try { + Services.seleniumServer = require('selenium-server'); + } catch (err) { } + + try { + Services.chromedriver = require('chromedriver'); + } catch (err) { } + + try { + Services.geckodriver = require('geckodriver'); + } catch (err) { } +}