2018-02-13 09:01:28 -08:00
const flags = [
'--headless' ,
// Sandbox causes Chrome to crash on Travis
// https://github.com/travis-ci/travis-ci/issues/8836#issuecomment-359018652
'--no-sandbox' ,
'--disable-gpu'
] ;
2018-02-09 08:54:15 -08:00
exports . config = {
allScriptsTimeout : 11000 ,
2018-02-13 09:01:28 -08:00
jasmineNodeOpts : { defaultTimeoutInterval : 1000 * 60 * 10 } ,
2018-02-14 15:58:10 -08:00
maxSessions : 4 ,
2018-02-15 15:34:06 -08:00
specs : [ 'test/e2e/**/*.e2e-spec.ts' ] ,
2018-02-09 08:54:15 -08:00
// Available deviceNames for mobileEmulation: https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
multiCapabilities : [
{
2018-02-09 15:32:54 -08:00
name : '1024x720' ,
2018-02-09 08:54:15 -08:00
browserName : 'chrome' ,
chromeOptions : {
args : [
'--high-dpi-support=1' ,
'--force-device-scale-factor=2' ,
2018-02-13 05:51:21 -08:00
'--window-size=1024,720' ,
2018-02-13 09:01:28 -08:00
... flags
2018-02-09 08:54:15 -08:00
]
}
} ,
{
2018-02-09 15:32:54 -08:00
name : '1920x1080' ,
2018-02-09 08:54:15 -08:00
browserName : 'chrome' ,
chromeOptions : {
args : [
'--high-dpi-support=1' ,
'--force-device-scale-factor=2' ,
2018-02-13 05:51:21 -08:00
'--window-size=1920,1080' ,
2018-02-13 09:01:28 -08:00
... flags
2018-02-09 08:54:15 -08:00
]
}
} ,
{
2018-02-09 15:32:54 -08:00
name : 'iPhoneX' ,
2018-02-09 08:54:15 -08:00
browserName : 'chrome' ,
chromeOptions : {
mobileEmulation : {
deviceName : 'iPhone X'
} ,
2018-02-13 09:01:28 -08:00
args : [ ... flags ]
2018-02-09 08:54:15 -08:00
}
} ,
{
2018-02-09 15:32:54 -08:00
name : 'iPhone8' ,
2018-02-09 08:54:15 -08:00
browserName : 'chrome' ,
chromeOptions : {
mobileEmulation : {
deviceName : 'iPhone 8'
} ,
2018-02-13 09:01:28 -08:00
args : [ ... flags ]
2018-02-09 08:54:15 -08:00
}
} ,
{
2018-02-09 15:32:54 -08:00
name : 'iPad' ,
2018-02-09 08:54:15 -08:00
browserName : 'chrome' ,
chromeOptions : {
mobileEmulation : {
deviceName : 'iPad'
} ,
2018-02-13 09:01:28 -08:00
args : [ ... flags ]
2018-02-09 08:54:15 -08:00
}
} ,
{
2018-02-09 15:32:54 -08:00
name : 'iPadPro' ,
2018-02-09 08:54:15 -08:00
browserName : 'chrome' ,
chromeOptions : {
mobileEmulation : {
deviceName : 'iPad Pro'
} ,
2018-02-13 09:01:28 -08:00
args : [ ... flags ]
2018-02-09 08:54:15 -08:00
}
} ,
{
2018-02-09 15:32:54 -08:00
name : 'Nexus5X' ,
2018-02-09 08:54:15 -08:00
browserName : 'chrome' ,
chromeOptions : {
mobileEmulation : {
deviceName : 'Nexus 5X'
} ,
2018-02-13 09:01:28 -08:00
args : [ ... flags ]
2018-02-09 08:54:15 -08:00
}
}
] ,
directConnect : true ,
baseUrl : 'http://localhost:4200/' ,
framework : 'jasmine' ,
jasmineNodeOpts : {
showColors : true ,
defaultTimeoutInterval : 30000 ,
print : function ( ) { }
} ,
useAllAngular2AppRoots : true ,
beforeLaunch : function ( ) {
require ( 'connect' ) ( )
. use ( require ( 'serve-static' ) ( 'www' ) )
. listen ( 4200 ) ;
} ,
onPrepare ( ) {
require ( 'ts-node' ) . register ( {
2018-02-15 15:34:06 -08:00
project : 'test/e2e/tsconfig.e2e.json'
2018-02-09 08:54:15 -08:00
} ) ;
var jasmineReporters = require ( 'jasmine-reporters' ) ;
jasmine . getEnv ( ) . addReporter (
new jasmineReporters . TerminalReporter ( {
verbosity : 3 ,
color : true ,
showStack : true
} )
) ;
2018-02-15 08:38:35 -08:00
jasmine . getEnv ( ) . addReporter (
new jasmineReporters . JUnitXmlReporter ( {
savePath : process . env . JUNIT _REPORT _PATH || './test/' ,
outputFile : process . env . JUNIT _REPORT _NAME || 'junitresults.xml' ,
consolidateAll : true
} )
) ;
2018-02-09 08:54:15 -08:00
}
} ;