Skip to content

Commit d420019

Browse files
author
Fabian Wiles
authored
feat(examples): add protractor angular architect (#1594)
1 parent f75d5f2 commit d420019

3 files changed

Lines changed: 63 additions & 3 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
## IMPORTANT
1111
# If you change the `default_docker_image` version, also change the `cache_key` version
12-
var_1: &default_docker_image circleci/node:10.16
13-
var_2: &browsers_docker_image circleci/node:10.16-browsers
12+
var_1: &default_docker_image circleci/node:12.14
13+
var_2: &browsers_docker_image circleci/node:12.14-browsers
1414
var_3: &cache_key node-0.16-{{ checksum "yarn.lock" }}-v2
1515

1616

examples/angular_bazel_architect/BUILD.bazel

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,45 @@ architect_test(
7373
],
7474
)
7575

76+
architect_test(
77+
name = "e2e",
78+
args = ["frontend:e2e"],
79+
configuration_env_vars = ["NG_BUILD_CACHE"],
80+
data = glob([
81+
"src/*",
82+
"src/**",
83+
"e2e/*",
84+
"e2e/**",
85+
]) + [
86+
"angular.json",
87+
"browserslist",
88+
"tsconfig.app.json",
89+
"tsconfig.json",
90+
"@npm//mime",
91+
"@npm//@angular/cli",
92+
"@npm//@angular/core",
93+
"@npm//@angular/router",
94+
"@npm//@angular/platform-browser-dynamic",
95+
"@npm//@angular-devkit/build-angular",
96+
"@npm//protractor",
97+
"@npm//jasmine-spec-reporter",
98+
"@npm//ts-node",
99+
"@npm//@types/jasmine",
100+
"@npm//@types/jasminewd2",
101+
"@npm//@types/node",
102+
],
103+
tags = [
104+
"browser:chromium-local",
105+
# Fails in buildkite with this error
106+
# [19:48:16] E/launcher - unknown error: cannot find Chrome binary
107+
# (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Mac OS X 10.15.3 x86_64)
108+
# [19:48:16] E/launcher - WebDriverError: unknown error: cannot find Chrome binary
109+
# (Driver info: chromedriver=79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}),platform=Mac OS X 10.15.3 x86_64)
110+
# at Object.checkLegacyResponse
111+
"no-bazelci-mac",
112+
],
113+
)
114+
76115
# Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test
77116
sh_test(
78117
name = "dummy_test",

examples/angular_bazel_architect/e2e/protractor.conf.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,34 @@ const {SpecReporter} = require('jasmine-spec-reporter');
1010
exports.config = {
1111
allScriptsTimeout: 11000,
1212
specs: ['./src/**/*.e2e-spec.ts'],
13-
capabilities: {'browserName': 'chrome'},
1413
directConnect: true,
1514
baseUrl: 'http://localhost:4200/',
1615
framework: 'jasmine',
1716
jasmineNodeOpts: {showColors: true, defaultTimeoutInterval: 30000, print: function() {}},
1817
onPrepare() {
1918
require('ts-node').register({project: require('path').join(__dirname, './tsconfig.json')});
2019
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
20+
},
21+
capabilities: {
22+
browserName: 'chrome',
23+
chromeOptions: {
24+
// `--no-sandbox` flag disables the chrome sandbox because it causes Chrome to crash on some
25+
// environments
26+
// http://chromedriver.chromium.org/help/chrome-doesn-t-start
27+
// https://github.com/puppeteer/puppeteer/blob/v1.0.0/docs/troubleshooting.md#chrome-headless-fails-due-to-sandbox-issues
28+
// `--headess` flag runs the browser in headless mode
29+
// `--disable-gpu` flag disables GPU usage because it causes Chrome to crash on some
30+
// environments
31+
// `--disable-dev-shm-usage` flag disables the usage of `/dev/shm` because it causes Chrome to
32+
// crash on some environments.
33+
// https://github.com/puppeteer/puppeteer/blob/v1.0.0/docs/troubleshooting.md#tips
34+
// https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t
35+
// `--hide-scrollbars` flag comes from puppeteer headless mode defaults
36+
// `--mute-audio` flag comes from puppeteer headless mode defaults
37+
args: [
38+
'--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage',
39+
'--hide-scrollbars', '--mute-audio'
40+
]
41+
}
2142
}
2243
};

0 commit comments

Comments
 (0)