Skip to content

Commit 05d324f

Browse files
E2E tests run in NW.js but don't pass
1 parent e667237 commit 05d324f

1 file changed

Lines changed: 30 additions & 5 deletions

File tree

e2e/protractor.conf.js

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44

55
const { SpecReporter } = require('jasmine-spec-reporter');
66

7+
let nwBinary = 'nwjs/nw.exe';
8+
let driver = 'nwjs/chromedriver.exe';
9+
10+
if (process.platform === 'linux') {
11+
nwBinary = 'nwjs/nw';
12+
driver = 'nwjs/chromedriver'
13+
}
14+
if (process.platform === 'darwin') {
15+
nwBinary = 'nwjs.app/contents/MacOS/nwjs';
16+
driver = 'chromedriver';
17+
}
18+
19+
nwBinary = './node_modules/nw/' + nwBinary;
20+
driver = '../node_modules/nw/' + driver;
21+
722
/**
823
* @type { import("protractor").Config }
924
*/
@@ -12,21 +27,31 @@ exports.config = {
1227
specs: [
1328
'./src/**/*.e2e-spec.ts'
1429
],
30+
chromeDriver: driver,
1531
capabilities: {
16-
'browserName': 'chrome'
32+
browserName: 'chrome',
33+
chromeOptions: {
34+
binary: nwBinary
35+
}
1736
},
1837
directConnect: true,
1938
baseUrl: 'http://localhost:4200/',
2039
framework: 'jasmine',
2140
jasmineNodeOpts: {
2241
showColors: true,
2342
defaultTimeoutInterval: 30000,
24-
print: function() {}
43+
print: function () {}
2544
},
26-
onPrepare() {
45+
onPrepare: function () {
2746
require('ts-node').register({
2847
project: require('path').join(__dirname, './tsconfig.json')
2948
});
30-
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
49+
50+
jasmine.getEnv()
51+
.addReporter(new SpecReporter({
52+
spec: {
53+
displayStacktrace: true
54+
}
55+
}));
3156
}
32-
};
57+
};

0 commit comments

Comments
 (0)