2016-05-19 13:20:21 -07:00
|
|
|
const fs = require('fs');
|
2016-04-01 14:39:01 -07:00
|
|
|
const path = require('path');
|
|
|
|
|
|
2016-05-19 13:20:21 -07:00
|
|
|
// Load ts-node to be able to execute TypeScript files with protractor.
|
|
|
|
|
require('ts-node').register({
|
|
|
|
|
project: path.join(__dirname, '../e2e/')
|
|
|
|
|
});
|
|
|
|
|
|
2016-04-01 15:21:15 -07:00
|
|
|
|
2016-04-01 14:39:01 -07:00
|
|
|
const E2E_BASE_URL = process.env['E2E_BASE_URL'] || 'http://localhost:4200';
|
|
|
|
|
const config = {
|
|
|
|
|
useAllAngular2AppRoots: true,
|
2017-06-10 01:09:08 +02:00
|
|
|
specs: [ path.join(__dirname, '../e2e/**/*.spec.ts') ],
|
2016-06-24 11:34:49 -07:00
|
|
|
baseUrl: E2E_BASE_URL,
|
2016-08-19 10:59:45 -07:00
|
|
|
allScriptsTimeout: 120000,
|
|
|
|
|
getPageTimeout: 120000,
|
2016-07-06 16:37:45 -07:00
|
|
|
jasmineNodeOpts: {
|
2016-08-19 10:59:45 -07:00
|
|
|
defaultTimeoutInterval: 120000,
|
2016-12-13 21:10:31 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
|
{
|
|
|
|
|
// Runs the axe-core accessibility checks each time the e2e page changes and
|
|
|
|
|
// Angular is ready.
|
|
|
|
|
path: '../tools/axe-protractor/axe-protractor.js',
|
|
|
|
|
|
|
|
|
|
rules: [
|
|
|
|
|
// Exclude md-menu elements because those are empty if not active.
|
|
|
|
|
{ id: 'aria-required-children', selector: '*:not(md-menu)' },
|
2016-12-15 11:15:26 -08:00
|
|
|
|
|
|
|
|
// Disable color constrast checks since the final colors will vary based on the theme.
|
|
|
|
|
{ id: 'color-contrast', enabled: false },
|
2016-12-13 21:10:31 +01:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
2016-04-01 14:39:01 -07:00
|
|
|
};
|
|
|
|
|
|
2016-06-24 11:34:49 -07:00
|
|
|
if (process.env['TRAVIS']) {
|
2016-12-06 04:08:01 +01:00
|
|
|
const key = require('../scripts/saucelabs/sauce_config');
|
2016-04-01 14:39:01 -07:00
|
|
|
config.sauceUser = process.env['SAUCE_USERNAME'];
|
|
|
|
|
config.sauceKey = key;
|
|
|
|
|
config.capabilities = {
|
|
|
|
|
'browserName': 'chrome',
|
2017-01-13 23:59:01 +01:00
|
|
|
'version': 'latest',
|
2017-06-10 01:09:08 +02:00
|
|
|
'chromedriverVersion': '2.28',
|
2017-01-06 20:32:12 +01:00
|
|
|
'tunnel-identifier': process.env['TRAVIS_JOB_ID'],
|
|
|
|
|
'build': process.env['TRAVIS_JOB_ID'],
|
2017-01-27 01:35:39 +02:00
|
|
|
'name': 'Material E2E Tests',
|
2016-12-20 19:47:46 +01:00
|
|
|
|
2017-01-03 18:30:26 +01:00
|
|
|
// Enables concurrent testing in the Webdriver. Currently runs five e2e files in parallel.
|
2017-06-10 01:09:08 +02:00
|
|
|
'maxInstances': 5,
|
|
|
|
|
'shardTestFiles': true,
|
2017-01-03 18:30:26 +01:00
|
|
|
|
2016-12-20 19:47:46 +01:00
|
|
|
// By default Saucelabs tries to record the whole e2e run. This can slow down the builds.
|
|
|
|
|
'recordVideo': false,
|
|
|
|
|
'recordScreenshots': false
|
2016-04-01 14:39:01 -07:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.config = config;
|