diff --git a/integration/README.md b/integration/README.md index ee4ab3699f..9367c08f2e 100644 --- a/integration/README.md +++ b/integration/README.md @@ -6,15 +6,12 @@ to work, so they allow high-fidelity reproductions of real-world issues. For this to work, we first build the Angular distribution just like we would publish it to npm, then install the distribution into each app. -To test Angular CLI applications, we generate integration tests such as `cli-hello-world`. -This was generated with a current version of the CLI, and the only modification was replacement of `@angular/*` packages with their counterparts coming from `file:../../dist/packages-dist/*`. -When a significant change is released in the CLI, the application should be re-generated from scratch: +To test Angular CLI applications, we use the integration test `cli-hello-world`. +When a significant change is released in the CLI, the application should be updated with `ng update`: ```bash $ cd integration -$ rm -rf cli-hello-world -$ ng new cli-hello-world -# Edit cli-hello-world/package.json to point the @angular packages to dist/packages-dist, and preserve local mods to +$ ng update # ng build # ng test # typescript version diff --git a/integration/cli-hello-world/angular.json b/integration/cli-hello-world/angular.json index bc8ce2b0cc..0e6f64e89a 100644 --- a/integration/cli-hello-world/angular.json +++ b/integration/cli-hello-world/angular.json @@ -137,6 +137,11 @@ "options": { "protractorConfig": "./protractor.conf.js", "devServerTarget": "cli-hello-world:serve" + }, + "configurations": { + "production": { + "devServerTarget": "cli-hello-world:serve:production" + } } }, "lint": { diff --git a/integration/cli-hello-world/e2e/app.e2e-spec.ts b/integration/cli-hello-world/e2e/app.e2e-spec.ts index 5651a8a3a1..899e84d526 100644 --- a/integration/cli-hello-world/e2e/app.e2e-spec.ts +++ b/integration/cli-hello-world/e2e/app.e2e-spec.ts @@ -11,4 +11,9 @@ describe('cli-hello-world App', () => { page.navigateTo(); expect(page.getParagraphText()).toEqual('Welcome to app!'); }); + + it('the percent pipe should work', () => { + page.navigateTo(); + expect(page.getPipeContent()).toEqual('100 % awesome'); + }) }); diff --git a/integration/cli-hello-world/e2e/app.po.ts b/integration/cli-hello-world/e2e/app.po.ts index 82ea75ba50..ae3d5f7f15 100644 --- a/integration/cli-hello-world/e2e/app.po.ts +++ b/integration/cli-hello-world/e2e/app.po.ts @@ -8,4 +8,8 @@ export class AppPage { getParagraphText() { return element(by.css('app-root h1')).getText(); } + + getPipeContent() { + return element(by.css('app-root p')).getText(); + } } diff --git a/integration/cli-hello-world/package.json b/integration/cli-hello-world/package.json index c929434fc9..2486ce07da 100644 --- a/integration/cli-hello-world/package.json +++ b/integration/cli-hello-world/package.json @@ -3,12 +3,13 @@ "version": "0.0.0", "license": "MIT", "scripts": { - "ng": "ng", - "start": "ng serve", "build": "ng build --prod --progress false", - "test": "ng test", + "e2e": "ng e2e", "lint": "ng lint", - "e2e": "ng e2e" + "ng": "ng", + "postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG", + "start": "ng serve", + "test": "ng test && ng e2e --webdriver-update=false && ng e2e --prod --webdriver-update=false" }, "private": true, "dependencies": { @@ -27,13 +28,13 @@ }, "devDependencies": { "@angular-devkit/build-angular": "~0.5.0", - "@angular/cli": "^6.0.0-rc.0", + "@angular/cli": "^6.0.0-rc.5", "@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli", "@angular/language-service": "file:../../dist/packages-dist/language-service", "@types/jasmine": "~2.8.3", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", - "codelyzer": "^4.0.1", + "codelyzer": "^4.3.0", "jasmine-core": "~2.8.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~2.0.0", @@ -41,7 +42,7 @@ "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "~5.1.2", + "protractor": "file:../../node_modules/protractor", "ts-node": "~4.1.0", "tslint": "~5.9.1", "typescript": "file:../../node_modules/typescript" diff --git a/integration/cli-hello-world/protractor.conf.js b/integration/cli-hello-world/protractor.conf.js index 0422074c16..1c07cbce63 100644 --- a/integration/cli-hello-world/protractor.conf.js +++ b/integration/cli-hello-world/protractor.conf.js @@ -9,8 +9,9 @@ exports.config = { './e2e/**/*.e2e-spec.ts' ], capabilities: { - 'browserName': 'chrome', + browserName: 'chrome', chromeOptions: { + binary: process.env.CHROME_BIN, args: ['--no-sandbox'] } }, diff --git a/integration/cli-hello-world/src/app/app.component.html b/integration/cli-hello-world/src/app/app.component.html index fa2706a406..fade7834d1 100644 --- a/integration/cli-hello-world/src/app/app.component.html +++ b/integration/cli-hello-world/src/app/app.component.html @@ -5,6 +5,7 @@ Angular Logo +

{{ 1 | percent }} awesome

Here are some links to help you start: