feat(build): enforce mobile layout during e2e tests
This is important as we run our benchmarks on mobile devices as web driver tests fails if buttons are not visible / overlaid by other content.
This commit is contained in:
@ -33,17 +33,32 @@ var argv = require('yargs')
|
||||
|
||||
var browsers = argv['browsers'].split(',');
|
||||
|
||||
var CHROME_OPTIONS = {
|
||||
'args': ['--js-flags=--expose-gc'],
|
||||
'perfLoggingPrefs': {
|
||||
'traceCategories': 'blink.console,disabled-by-default-devtools.timeline'
|
||||
}
|
||||
};
|
||||
|
||||
var CHROME_MOBILE_EMULATION = {
|
||||
// Can't use 'deviceName':'Google Nexus 7 2'
|
||||
// as this would yield wrong orientation,
|
||||
// so we specify facts explicitly
|
||||
'deviceMetrics': {
|
||||
'width': 600,
|
||||
'height': 960,
|
||||
'pixelRatio': 2
|
||||
}
|
||||
};
|
||||
|
||||
var BROWSER_CAPS = {
|
||||
Dartium: {
|
||||
name: 'Dartium',
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
'binary': process.env.DARTIUM,
|
||||
'args': ['--js-flags=--expose-gc'],
|
||||
'perfLoggingPrefs': {
|
||||
'traceCategories': 'blink.console,disabled-by-default-devtools.timeline'
|
||||
}
|
||||
},
|
||||
chromeOptions: mergeInto(CHROME_OPTIONS, {
|
||||
'mobileEmulation': CHROME_MOBILE_EMULATION,
|
||||
'binary': process.env.DARTIUM
|
||||
}),
|
||||
loggingPrefs: {
|
||||
performance: 'ALL',
|
||||
browser: 'ALL'
|
||||
@ -51,12 +66,9 @@ var BROWSER_CAPS = {
|
||||
},
|
||||
ChromeDesktop: {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
'args': ['--js-flags=--expose-gc'],
|
||||
'perfLoggingPrefs': {
|
||||
'traceCategories': 'blink.console,disabled-by-default-devtools.timeline'
|
||||
}
|
||||
},
|
||||
chromeOptions: mergeInto(CHROME_OPTIONS, {
|
||||
'mobileEmulation': CHROME_MOBILE_EMULATION
|
||||
}),
|
||||
loggingPrefs: {
|
||||
performance: 'ALL',
|
||||
browser: 'ALL'
|
||||
@ -64,13 +76,9 @@ var BROWSER_CAPS = {
|
||||
},
|
||||
ChromeAndroid: {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
androidPackage: 'com.android.chrome',
|
||||
'args': ['--js-flags=--expose-gc'],
|
||||
'perfLoggingPrefs': {
|
||||
'traceCategories': 'blink.console,disabled-by-default-devtools.timeline'
|
||||
}
|
||||
},
|
||||
chromeOptions: mergeInto(CHROME_OPTIONS, {
|
||||
'androidPackage': 'com.android.chrome',
|
||||
}),
|
||||
loggingPrefs: {
|
||||
performance: 'ALL',
|
||||
browser: 'ALL'
|
||||
@ -201,3 +209,10 @@ exports.createBenchpressRunner = function(options) {
|
||||
|
||||
global.benchpressRunner = new benchpress.Runner(bindings);
|
||||
}
|
||||
|
||||
function mergeInto(src, target) {
|
||||
for (var prop in src) {
|
||||
target[prop] = src[prop];
|
||||
}
|
||||
return target;
|
||||
}
|
Reference in New Issue
Block a user