Skip to content

Commit

Permalink
feat(examples): add protractor angular architect
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Wiles committed Jan 31, 2020
1 parent 5a2af71 commit be34cca
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
32 changes: 32 additions & 0 deletions examples/angular_bazel_architect/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,38 @@ architect_test(
],
)

architect_test(
name = "e2e",
args = ["frontend:e2e"],
configuration_env_vars = ["NG_BUILD_CACHE"],
data = glob([
"src/*",
"src/**",
"e2e/*",
"e2e/**",
]) + [
"angular.json",
"browserslist",
"tsconfig.app.json",
"tsconfig.json",
"@npm//mime",
"@npm//@angular/cli",
"@npm//@angular/core",
"@npm//@angular/router",
"@npm//@angular/platform-browser-dynamic",
"@npm//@angular-devkit/build-angular",
"@npm//protractor",
"@npm//jasmine-spec-reporter",
"@npm//ts-node",
"@npm//@types/jasmine",
"@npm//@types/jasminewd2",
"@npm//@types/node",
],
tags = [
"browser:chromium-local",
],
)

# Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test
sh_test(
name = "dummy_test",
Expand Down
3 changes: 2 additions & 1 deletion examples/angular_bazel_architect/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "frontend:serve"
"devServerTarget": "frontend:serve",
"webdriverUpdate": true
},
"configurations": {
"production": {
Expand Down
10 changes: 9 additions & 1 deletion examples/angular_bazel_architect/e2e/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ const {SpecReporter} = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: ['./src/**/*.e2e-spec.ts'],
capabilities: {'browserName': 'chrome'},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {showColors: true, defaultTimeoutInterval: 30000, print: function() {}},
onPrepare() {
require('ts-node').register({project: require('path').join(__dirname, './tsconfig.json')});
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
},
capabilities: {
browserName: 'chrome',
pageLoadStrategy: 'normal',
chromeOptions: {
args: [
'--headless', '--disable-gpu', '--window-size=800,600', '--debuggerAddress=127.0.0.1:12633'
]
}
}
};

0 comments on commit be34cca

Please sign in to comment.