@@ -10,13 +10,34 @@ const {SpecReporter} = require('jasmine-spec-reporter');
1010exports . config = {
1111 allScriptsTimeout : 11000 ,
1212 specs : [ './src/**/*.e2e-spec.ts' ] ,
13- capabilities : { 'browserName' : 'chrome' } ,
1413 directConnect : true ,
1514 baseUrl : 'http://localhost:4200/' ,
1615 framework : 'jasmine' ,
1716 jasmineNodeOpts : { showColors : true , defaultTimeoutInterval : 30000 , print : function ( ) { } } ,
1817 onPrepare ( ) {
1918 require ( 'ts-node' ) . register ( { project : require ( 'path' ) . join ( __dirname , './tsconfig.json' ) } ) ;
2019 jasmine . getEnv ( ) . addReporter ( new SpecReporter ( { spec : { displayStacktrace : true } } ) ) ;
20+ } ,
21+ capabilities : {
22+ browserName : 'chrome' ,
23+ chromeOptions : {
24+ // `--no-sandbox` flag disables the chrome sandbox because it causes Chrome to crash on some
25+ // environments
26+ // http://chromedriver.chromium.org/help/chrome-doesn-t-start
27+ // https://github.com/puppeteer/puppeteer/blob/v1.0.0/docs/troubleshooting.md#chrome-headless-fails-due-to-sandbox-issues
28+ // `--headess` flag runs the browser in headless mode
29+ // `--disable-gpu` flag disables GPU usage because it causes Chrome to crash on some
30+ // environments
31+ // `--disable-dev-shm-usage` flag disables the usage of `/dev/shm` because it causes Chrome to
32+ // crash on some environments.
33+ // https://github.com/puppeteer/puppeteer/blob/v1.0.0/docs/troubleshooting.md#tips
34+ // https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t
35+ // `--hide-scrollbars` flag comes from puppeteer headless mode defaults
36+ // `--mute-audio` flag comes from puppeteer headless mode defaults
37+ args : [
38+ '--no-sandbox' , '--headless' , '--disable-gpu' , '--disable-dev-shm-usage' ,
39+ '--hide-scrollbars' , '--mute-audio'
40+ ]
41+ }
2142 }
2243} ;
0 commit comments