mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
8e6bee8116
* Renames the e2e test file to match the pattern of `{{component}}-e2e.spec.ts`.
* Flattens the directory structure in the `e2e` directory. Having a separate dir for each component was overkill since only have one file per component.
* Fixes some inconsistent code styles in the Protractor config.
Fixes #5030.
62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// Load ts-node to be able to execute TypeScript files with protractor.
|
|
require('ts-node').register({
|
|
project: path.join(__dirname, '../e2e/')
|
|
});
|
|
|
|
|
|
const E2E_BASE_URL = process.env['E2E_BASE_URL'] || 'http://localhost:4200';
|
|
const config = {
|
|
useAllAngular2AppRoots: true,
|
|
specs: [ path.join(__dirname, '../e2e/**/*.spec.ts') ],
|
|
baseUrl: E2E_BASE_URL,
|
|
allScriptsTimeout: 120000,
|
|
getPageTimeout: 120000,
|
|
jasmineNodeOpts: {
|
|
defaultTimeoutInterval: 120000,
|
|
},
|
|
|
|
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)' },
|
|
|
|
// Disable color constrast checks since the final colors will vary based on the theme.
|
|
{ id: 'color-contrast', enabled: false },
|
|
]
|
|
}
|
|
]
|
|
};
|
|
|
|
if (process.env['TRAVIS']) {
|
|
const key = require('../scripts/saucelabs/sauce_config');
|
|
config.sauceUser = process.env['SAUCE_USERNAME'];
|
|
config.sauceKey = key;
|
|
config.capabilities = {
|
|
'browserName': 'chrome',
|
|
'version': 'latest',
|
|
'chromedriverVersion': '2.28',
|
|
'tunnel-identifier': process.env['TRAVIS_JOB_ID'],
|
|
'build': process.env['TRAVIS_JOB_ID'],
|
|
'name': 'Material E2E Tests',
|
|
|
|
// Enables concurrent testing in the Webdriver. Currently runs five e2e files in parallel.
|
|
'maxInstances': 5,
|
|
'shardTestFiles': true,
|
|
|
|
// By default Saucelabs tries to record the whole e2e run. This can slow down the builds.
|
|
'recordVideo': false,
|
|
'recordScreenshots': false
|
|
};
|
|
}
|
|
|
|
|
|
exports.config = config;
|