This commit is contained in:
ophir 2020-04-28 00:42:49 +02:00
parent e2ebb3e6f5
commit 189ebbed80
4 changed files with 49 additions and 32 deletions

View file

@ -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

View file

@ -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"]
}
}
}
}
}

1
.gitignore vendored
View file

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

45
nightwatch.conf.js Normal file
View file

@ -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) { }
}