|
2 | 2 |
|
3 | 3 | /*
|
4 | 4 | * Browser Configuration for the different jobs in the CI.
|
5 |
| - * Target can be either: BS (Browserstack) | SL (Saucelabs) | TC (Travis CI) | null (To not run) |
| 5 | + * |
| 6 | + * - local: Launches the browser locally on the current operating system. |
| 7 | + * - BS: Launches the browser within BrowserStack |
| 8 | + * - SL: Launches the browser within Saucelabs |
| 9 | + * |
| 10 | + * TODO(devversion): rename this to "browserstack" and "saucelabs". |
6 | 11 | */
|
7 | 12 | const browserConfig = {
|
8 |
| - 'ChromeHeadlessCI': { unitTest: {target: 'TC', required: true }}, |
9 |
| - 'FirefoxHeadless': { unitTest: {target: 'TC', required: true }}, |
10 |
| - 'ChromeBeta': { unitTest: {target: null, required: false }}, |
11 |
| - 'FirefoxBeta': { unitTest: {target: null, required: false }}, |
12 |
| - 'ChromeDev': { unitTest: {target: null, required: false }}, |
13 |
| - 'FirefoxDev': { unitTest: {target: null, required: false }}, |
14 |
| - 'IE9': { unitTest: {target: null, required: false }}, |
15 |
| - 'IE10': { unitTest: {target: null, required: false }}, |
16 |
| - 'IE11': { unitTest: {target: null, required: false }}, |
17 |
| - 'Edge': { unitTest: {target: 'BS', required: true }}, |
18 |
| - 'Android4.1': { unitTest: {target: null, required: false }}, |
19 |
| - 'Android4.2': { unitTest: {target: null, required: false }}, |
20 |
| - 'Android4.3': { unitTest: {target: null, required: false }}, |
21 |
| - 'Android4.4': { unitTest: {target: null, required: false }}, |
22 |
| - 'Android5': { unitTest: {target: null, required: false }}, |
23 |
| - 'Safari7': { unitTest: {target: null, required: false }}, |
24 |
| - 'Safari8': { unitTest: {target: null, required: false }}, |
25 |
| - 'Safari9': { unitTest: {target: null, required: false }}, |
26 |
| - 'Safari10': { unitTest: {target: 'BS', required: true }}, |
27 |
| - 'iOS7': { unitTest: {target: null, required: false }}, |
28 |
| - 'iOS8': { unitTest: {target: null, required: false }}, |
29 |
| - 'iOS9': { unitTest: {target: null, required: false }}, |
30 |
| - 'iOS10': { unitTest: {target: null, required: false }}, |
| 13 | + 'ChromeHeadlessCI': { unitTest: {target: 'local', }}, |
| 14 | + 'FirefoxHeadless': { unitTest: {target: 'local', }}, |
| 15 | + 'ChromeBeta': { unitTest: {target: null, }}, |
| 16 | + 'FirefoxBeta': { unitTest: {target: null, }}, |
| 17 | + 'ChromeDev': { unitTest: {target: null, }}, |
| 18 | + 'FirefoxDev': { unitTest: {target: null, }}, |
| 19 | + 'IE9': { unitTest: {target: null, }}, |
| 20 | + 'IE10': { unitTest: {target: null, }}, |
| 21 | + 'IE11': { unitTest: {target: null, }}, |
| 22 | + 'Edge': { unitTest: {target: 'BS', }}, |
| 23 | + 'Android4.1': { unitTest: {target: null, }}, |
| 24 | + 'Android4.2': { unitTest: {target: null, }}, |
| 25 | + 'Android4.3': { unitTest: {target: null, }}, |
| 26 | + 'Android4.4': { unitTest: {target: null, }}, |
| 27 | + 'Android5': { unitTest: {target: null, }}, |
| 28 | + 'Safari7': { unitTest: {target: null, }}, |
| 29 | + 'Safari8': { unitTest: {target: null, }}, |
| 30 | + 'Safari9': { unitTest: {target: null, }}, |
| 31 | + 'Safari10': { unitTest: {target: 'BS', }}, |
| 32 | + 'iOS7': { unitTest: {target: null, }}, |
| 33 | + 'iOS8': { unitTest: {target: null, }}, |
| 34 | + 'iOS9': { unitTest: {target: null, }}, |
| 35 | + 'iOS10': { unitTest: {target: null, }}, |
31 | 36 | // Don't use Browserstack until our open-source license includes automate testing on
|
32 | 37 | // mobile devices. For now, we need to use Saucelabs to keep our coverage.
|
33 |
| - 'iOS11': { unitTest: {target: 'SL', required: true }}, |
34 |
| - 'WindowsPhone': { unitTest: {target: null, required: false }} |
| 38 | + 'iOS11': { unitTest: {target: 'SL', }}, |
| 39 | + 'WindowsPhone': { unitTest: {target: null, }} |
35 | 40 | };
|
36 | 41 |
|
37 | 42 | /** Exports all available remote browsers. */
|
38 | 43 | exports.customLaunchers = require('./remote_browsers.json');
|
39 | 44 |
|
40 |
| -/** Exports a map of configured browsers, which should run on the CI. */ |
| 45 | +/** Exports a map of configured browsers, which should run in the given platform. */ |
41 | 46 | exports.platformMap = {
|
42 |
| - 'saucelabs': { |
43 |
| - required: buildConfiguration('unitTest', 'SL', true), |
44 |
| - optional: buildConfiguration('unitTest', 'SL', false) |
45 |
| - }, |
46 |
| - 'browserstack': { |
47 |
| - required: buildConfiguration('unitTest', 'BS', true), |
48 |
| - optional: buildConfiguration('unitTest', 'BS', false) |
49 |
| - }, |
50 |
| - 'travis': { |
51 |
| - required: buildConfiguration('unitTest', 'TC', true), |
52 |
| - optional: buildConfiguration('unitTest', 'TC', false) |
53 |
| - } |
| 47 | + 'saucelabs': buildConfiguration('unitTest', 'SL'), |
| 48 | + 'browserstack': buildConfiguration('unitTest', 'BS'), |
| 49 | + 'local': buildConfiguration('unitTest', 'local'), |
54 | 50 | };
|
55 | 51 |
|
56 | 52 | /** Build a list of configuration (custom launcher names). */
|
57 |
| -function buildConfiguration(type, target, required) { |
| 53 | +function buildConfiguration(type, target) { |
58 | 54 | const targetBrowsers = Object.keys(browserConfig)
|
59 | 55 | .map(browserName => [browserName, browserConfig[browserName][type]])
|
60 |
| - .filter(([, config]) => config.required === required && config.target === target) |
| 56 | + .filter(([, config]) => config.target === target) |
61 | 57 | .map(([browserName]) => browserName);
|
62 | 58 |
|
63 |
| - // For browsers that run on Travis CI the browser name shouldn't be prefixed with the shortcut |
64 |
| - // of Travis. The different Karma launchers only work with the plain browser name (e.g Firefox) |
65 |
| - if (target === 'TC') { |
| 59 | + // For browsers that run locally, the browser name shouldn't be prefixed with the target |
| 60 | + // platform. We only prefix the external platforms in order to distinguish between |
| 61 | + // local and remote browsers in our "customLaunchers" for Karma. |
| 62 | + if (target === 'local') { |
66 | 63 | return targetBrowsers;
|
67 | 64 | }
|
68 | 65 |
|
|
0 commit comments