-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac40325
commit 56a5c5e
Showing
3 changed files
with
47 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,54 @@ | ||
var argv = require('yargs').argv; | ||
var envIndex = process.argv.indexOf('--env') + 1; | ||
var env = envIndex ? process.argv[envIndex] : undefined; | ||
|
||
module.exports = { | ||
testTimeout: 180 * 1000, | ||
verbose: false, | ||
plugins: { | ||
local: { | ||
browserOptions: { | ||
chrome: [ | ||
'headless', | ||
'disable-gpu', | ||
'no-sandbox' | ||
] | ||
} | ||
} | ||
}, | ||
|
||
registerHooks: function(context) { | ||
var saucelabsPlatforms = [ | ||
'macOS 10.12/[email protected]', | ||
'macOS 10.12/[email protected]', | ||
'Windows 10/microsoftedge@15', | ||
'Windows 10/internet explorer@11', | ||
'macOS 10.12/[email protected]', | ||
'macOS 9.3.2/[email protected]' | ||
const saucelabsPlatformsMobile = [ | ||
'iOS Simulator/[email protected]', | ||
'iOS Simulator/[email protected]' | ||
]; | ||
|
||
var cronPlatforms = [ | ||
'Windows 10/chrome@59', | ||
'Windows 10/firefox@54' | ||
const saucelabsPlatformsDesktop = [ | ||
'macOS 10.13/[email protected]', | ||
'Windows 10/microsoftedge@17', | ||
'Windows 10/internet explorer@11' | ||
]; | ||
|
||
if (argv.env === 'saucelabs') { | ||
context.options.plugins.sauce.browsers = saucelabsPlatforms; | ||
const saucelabsPlatforms = [ | ||
...saucelabsPlatformsMobile, | ||
...saucelabsPlatformsDesktop | ||
]; | ||
|
||
} else if (argv.env === 'saucelabs-cron') { | ||
const cronPlatforms = [ | ||
{ | ||
deviceName: 'Android GoogleAPI Emulator', | ||
platformName: 'Android', | ||
platformVersion: '7.1', | ||
browserName: 'chrome' | ||
}, | ||
'iOS Simulator/[email protected]', | ||
'iOS Simulator/[email protected]', | ||
'Windows 10/chrome@latest', | ||
'Windows 10/firefox@latest' | ||
]; | ||
|
||
if (env === 'saucelabs') { | ||
context.options.plugins.sauce.browsers = saucelabsPlatforms; | ||
} else if (env === 'saucelabs-cron') { | ||
context.options.plugins.sauce.browsers = cronPlatforms; | ||
} | ||
} | ||
|