From be34ccae54b29e5df4a9416f24291497f9fab46a Mon Sep 17 00:00:00 2001 From: Fabian Wiles Date: Fri, 31 Jan 2020 07:36:58 +0000 Subject: [PATCH] feat(examples): add protractor angular architect --- examples/angular_bazel_architect/BUILD.bazel | 32 +++++++++++++++++++ examples/angular_bazel_architect/angular.json | 3 +- .../e2e/protractor.conf.js | 10 +++++- 3 files changed, 43 insertions(+), 2 deletions(-) diff --git a/examples/angular_bazel_architect/BUILD.bazel b/examples/angular_bazel_architect/BUILD.bazel index eb3aeda0cc..3f8376e13c 100644 --- a/examples/angular_bazel_architect/BUILD.bazel +++ b/examples/angular_bazel_architect/BUILD.bazel @@ -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", diff --git a/examples/angular_bazel_architect/angular.json b/examples/angular_bazel_architect/angular.json index 152207cb04..573c5d650f 100644 --- a/examples/angular_bazel_architect/angular.json +++ b/examples/angular_bazel_architect/angular.json @@ -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": { diff --git a/examples/angular_bazel_architect/e2e/protractor.conf.js b/examples/angular_bazel_architect/e2e/protractor.conf.js index abf547c4e2..00cb29accd 100644 --- a/examples/angular_bazel_architect/e2e/protractor.conf.js +++ b/examples/angular_bazel_architect/e2e/protractor.conf.js @@ -10,7 +10,6 @@ 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', @@ -18,5 +17,14 @@ exports.config = { 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' + ] + } } }; \ No newline at end of file