Skip to content

Commit 9d882a0

Browse files
devversionmmalerba
authored andcommitted
build: do not e2e tests on saucelabs (#12700)
* No longer runs e2e tests inside of Saucelabs because Chrome is also installed on Travis CI and we should keep Saucelabs available for other browsers that don't run inside of Dockers or Travis.
1 parent ac8339c commit 9d882a0

File tree

4 files changed

+21
-31
lines changed

4 files changed

+21
-31
lines changed

scripts/ci/sources/tunnel.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WAIT_RETRIES=2
88

99
start_tunnel() {
1010
case "$MODE" in
11-
e2e*|saucelabs*)
11+
saucelabs*)
1212
./scripts/saucelabs/start-tunnel.sh
1313
;;
1414
browserstack*)
@@ -21,7 +21,7 @@ start_tunnel() {
2121

2222
wait_for_tunnel() {
2323
case "$MODE" in
24-
e2e*|saucelabs*)
24+
saucelabs*)
2525
retryCall ${WAIT_RETRIES} ./scripts/saucelabs/wait-tunnel.sh
2626
;;
2727
browserstack*)
@@ -34,7 +34,7 @@ wait_for_tunnel() {
3434

3535
teardown_tunnel() {
3636
case "$MODE" in
37-
e2e*|saucelabs*)
37+
saucelabs*)
3838
./scripts/saucelabs/stop-tunnel.sh
3939
;;
4040
browserstack*)

scripts/ci/travis-testing.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ wait_for_tunnel
3434
if is_lint; then
3535
$(npm bin)/gulp ci:lint
3636
elif is_e2e; then
37-
$(npm bin)/gulp ci:e2e
37+
# Run e2e tests inside of Xvfb because we need to test the HTML Fullscreen API's that cannot
38+
# be tested within Chrome headless.
39+
xvfb-run -a --server-args='-screen 0, 1024x768x16' $(npm bin)/gulp ci:e2e
3840
elif is_aot; then
3941
$(npm bin)/gulp ci:aot
4042
elif is_payload; then

scripts/saucelabs/sauce_config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/protractor.conf.js

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ require('ts-node').register({
55
project: path.join(__dirname, '../e2e/')
66
});
77

8-
98
const E2E_BASE_URL = process.env['E2E_BASE_URL'] || 'http://localhost:4200';
10-
const config = {
9+
10+
exports.config = {
1111
useAllAngular2AppRoots: true,
1212
specs: [ path.join(__dirname, '../e2e/**/*.spec.ts') ],
1313
baseUrl: E2E_BASE_URL,
@@ -27,34 +27,23 @@ const config = {
2727
// Exclude mat-menu elements because those are empty if not active.
2828
{ id: 'aria-required-children', selector: '*:not(mat-menu)' },
2929

30-
// Disable color constrast checks since the final colors will vary based on the theme.
30+
// Disable color contrast checks since the final colors will vary based on the theme.
3131
{ id: 'color-contrast', enabled: false },
3232
]
3333
}
34-
]
35-
};
34+
],
3635

37-
if (process.env['TRAVIS']) {
38-
const key = require('../scripts/saucelabs/sauce_config');
36+
capabilities: {
37+
browserName: 'chrome',
3938

40-
config.sauceUser = process.env['SAUCE_USERNAME'];
41-
config.sauceKey = key;
42-
config.capabilities = {
43-
'browserName': 'chrome',
44-
'version': 'latest',
45-
'tunnel-identifier': process.env['TRAVIS_JOB_ID'],
46-
'build': process.env['TRAVIS_JOB_ID'],
47-
'name': 'Material E2E Tests',
39+
chromeOptions: {
40+
// Inside of Travis, we need to specify `--no-sandbox` because otherwise Chrome cannot
41+
// be launched properly due to insufficient permissions in a non-sudo environment.
42+
args: process.env['TRAVIS'] ? ['--no-sandbox'] : [],
43+
},
4844

4945
// Enables concurrent testing in the Webdriver. Currently runs five e2e files in parallel.
50-
'maxInstances': 5,
51-
'shardTestFiles': true,
52-
53-
// By default Saucelabs tries to record the whole e2e run. This can slow down the builds.
54-
'recordVideo': false,
55-
'recordScreenshots': false
56-
};
57-
}
58-
59-
60-
exports.config = config;
46+
shardTestFiles: true,
47+
maxInstances: 5,
48+
}
49+
};

0 commit comments

Comments
 (0)