File tree Expand file tree Collapse file tree 7 files changed +86
-6
lines changed
addon/ng2/blueprints/ng2/files Expand file tree Collapse file tree 7 files changed +86
-6
lines changed Original file line number Diff line number Diff line change @@ -67,19 +67,33 @@ ng build
6767The build artifacts will be stored in the ` dist/ ` directory.
6868
6969
70- ### Running tests
70+ ### Running unit tests
7171
72- Before running the tests make sure that the project is built. To build the
72+ Before running the tests make sure that the project is built. To build the
7373project once you can use:
7474
7575``` bash
7676ng build
7777```
7878
79- With the project built in the ` dist/ ` folder you can just run: ` karma start ` .
79+ With the project built in the ` dist/ ` folder you can just run: ` karma start ` .
8080Karma will run the tests and keep the browser open waiting to run again.
8181
82- This will be easier when the command
82+
83+ ### Running end-to-end tests
84+
85+ Before running the tests make sure that you have an updated webdriver and that
86+ the tests are built:
87+
88+ ``` bash
89+ $( npm bin) /webdriver-manager update
90+ $( npm bin) /tsc -p e2e/
91+ ```
92+
93+ Afterwards you only need to run ` $(npm bin)/protractor ` while serving via
94+ ` ng serve ` .
95+
96+ This will be easier when the command
8397[ ng test] ( https://github.com/angular/angular-cli/issues/70 ) is implemented.
8498
8599
Original file line number Diff line number Diff line change 1+ import "angular2/testing" ;
2+ import { < %= jsComponentName % > Page } from './app.po' ;
3+
4+ describe ( '<%= htmlComponentName %> App' , function ( ) {
5+ let page : < %= jsComponentName % > Page ;
6+
7+ beforeEach ( ( ) => {
8+ page = new < %= jsComponentName % > Page ( ) ;
9+ } )
10+
11+ it ( 'should display message saying app works' , ( ) => {
12+ page . navigateTo ( )
13+ expect ( page . getParagraphText ( ) ) . toEqual ( '<%= htmlComponentName %> Works!' ) ;
14+ } ) ;
15+ } ) ;
Original file line number Diff line number Diff line change 1+ import "angular2/testing" ;
2+
3+ export class < %= jsComponentName % > Page {
4+ navigateTo ( ) { return browser . get ( '/' ) ; }
5+ getParagraphText ( ) { return element ( by . css ( '<%= jsComponentName %>-app p' ) ) . getText ( ) ; }
6+ }
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "target" : " ES5" ,
4+ "module" : " commonjs" ,
5+ "sourceMap" : true ,
6+ "declaration" : false ,
7+ "emitDecoratorMetadata" : true ,
8+ "experimentalDecorators" : true ,
9+ "removeComments" : false
10+ }
11+ }
Original file line number Diff line number Diff line change 1414/coverage/*
1515/libpeerconnection.log
1616npm-debug.log
17- testem.log
17+ testem.log
18+
19+ # e2e
20+ /e2e/*.js
21+ /e2e/*.map
Original file line number Diff line number Diff line change 1818 "jasmine-core" : " ^2.3.4" ,
1919 "karma" : " ^0.13.15" ,
2020 "karma-chrome-launcher" : " ^0.2.1" ,
21- "karma-jasmine" : " ^0.3.6"
21+ "karma-jasmine" : " ^0.3.6" ,
22+ "protractor" : " ^3.0.0" ,
23+ "typescript" : " ^1.7.3"
2224 }
2325}
Original file line number Diff line number Diff line change 1+ exports . config = {
2+ allScriptsTimeout : 11000 ,
3+
4+ specs : [
5+ 'e2e/**/*.e2e.js'
6+ ] ,
7+
8+ capabilities : {
9+ 'browserName' : 'chrome'
10+ } ,
11+
12+ directConnect : true ,
13+
14+ baseUrl : 'http://localhost:4200/' ,
15+
16+ framework : 'jasmine' ,
17+
18+ jasmineNodeOpts : {
19+ defaultTimeoutInterval : 30000
20+ } ,
21+
22+ useAllAngular2AppRoots : true ,
23+
24+ beforeLaunch : function ( ) {
25+ require ( 'zone.js' ) ;
26+ require ( 'reflect-metadata' ) ;
27+ }
28+ } ;
You can’t perform that action at this time.
0 commit comments