Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit a7235c8

Browse files
cgeweckenivida
authored andcommitted
Add karma & chrome/firefox headless browser fixtures (#3146)
* Add karma & chrome/firefox headless browser fixtures * Add test helper for conditional web3 require * Add websocket port test helper * Move build/lint to their own CI job * Fix package-lock from rebase * Fix ci.sh * Skip all websockets tests for geth.instamine
1 parent a2027aa commit a7235c8

File tree

14 files changed

+1269
-73
lines changed

14 files changed

+1269
-73
lines changed

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ matrix:
1010
- node_js: 12
1111
env: TEST=unit
1212
- node_js: 10
13-
env: TEST=unit_and_e2e
13+
env: TEST=build_and_lint
14+
- node_js: 10
15+
env: TEST=unit_and_e2e_clients
16+
- node_js: 10
17+
env: TEST=e2e_browsers
18+
addons:
19+
chrome: stable
20+
firefox: latest
1421
addons:
1522
apt:
1623
sources:
@@ -26,6 +33,7 @@ before_install:
2633
export LINK="gcc-5";
2734
export LINKXX="g++-5";
2835
fi
36+
- "export DISPLAY=:99.0"
2937
install:
3038
- npm install
3139
script:

karma.conf.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
process.env.CHROME_BIN = require('puppeteer').executablePath();
2+
process.env.MOZ_HEADLESS = 1;
3+
4+
module.exports = function (config) {
5+
config.set({
6+
frameworks: [
7+
'mocha',
8+
'browserify'
9+
],
10+
files: [
11+
'node_modules/@babel/polyfill/dist/polyfill.js', // For async/await in tests
12+
'test/**/e2e*.js'
13+
],
14+
preprocessors: {
15+
'test/**/e2e*.js': [ 'browserify' ]
16+
},
17+
plugins: [
18+
'karma-chrome-launcher',
19+
'karma-firefox-launcher',
20+
'karma-mocha',
21+
'karma-browserify',
22+
'karma-spec-reporter'
23+
],
24+
reporters: ['spec'],
25+
port: 9876, // karma web server port
26+
colors: true,
27+
logLevel: config.LOG_INFO,
28+
autoWatch: false,
29+
browsers: [
30+
'ChromeHeadless',
31+
'FirefoxHeadless'
32+
],
33+
customLaunchers: {
34+
FirefoxHeadless: {
35+
base: 'Firefox',
36+
flags: ['-headless'],
37+
},
38+
},
39+
});
40+
};

0 commit comments

Comments
 (0)