File tree 10 files changed +69
-32
lines changed
10 files changed +69
-32
lines changed Original file line number Diff line number Diff line change @@ -152,16 +152,13 @@ Tests will execute after a build is executed via [Karma](http://karma-runner.git
152
152
153
153
### Running end-to-end tests
154
154
155
- Before running the tests make sure that you have an updated webdriver and that
156
- the tests are built:
157
-
158
155
``` bash
159
- $( npm bin) /webdriver-manager update
160
- $( npm bin) /tsc -p e2e/
156
+ ng e2e
161
157
```
162
158
163
- Afterwards you only need to run ` $(npm bin)/protractor ` while serving via
164
- ` ng serve ` .
159
+ Before running the tests make sure you are serving the app via ` ng serve ` .
160
+
161
+ End-to-end tests are ran via [ Protractor] ( https://angular.github.io/protractor/ ) .
165
162
166
163
167
164
### Deploying the app via GitHub Pages
Original file line number Diff line number Diff line change 1
- import "angular2/testing" ;
1
+ /// <reference path="../typings/main.d.ts" />
2
+
2
3
import { < %= jsComponentName % > Page } from './app.po' ;
3
4
4
5
describe ( '<%= htmlComponentName %> App' , function ( ) {
Original file line number Diff line number Diff line change 1
- import "angular2/testing" ;
2
-
3
1
export class < %= jsComponentName % > Page {
4
2
navigateTo ( ) { return browser . get ( '/' ) ; }
5
3
getParagraphText ( ) { return element ( by . css ( '<%= jsComponentName %>-app p' ) ) . getText ( ) ; }
Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
- "target" : " ES5" ,
4
- "module" : " commonjs" ,
5
- "sourceMap" : true ,
6
3
"declaration" : false ,
7
4
"emitDecoratorMetadata" : true ,
8
5
"experimentalDecorators" : true ,
9
- "removeComments" : false
6
+ "mapRoot" : " " ,
7
+ "module" : " system" ,
8
+ "moduleResolution" : " node" ,
9
+ "noEmitOnError" : true ,
10
+ "noImplicitAny" : false ,
11
+ "rootDir" : " ." ,
12
+ "sourceMap" : true ,
13
+ "sourceRoot" : " /" ,
14
+ "target" : " es5"
10
15
}
11
16
}
Original file line number Diff line number Diff line change 12
12
"start" : " ng server" ,
13
13
"postinstall" : " typings install --ambient" ,
14
14
"lint" : " tslint src/**/*.ts" ,
15
- "format" : " clang-format -i -style=file --glob=src/**/*.ts"
15
+ "format" : " clang-format -i -style=file --glob=src/**/*.ts" ,
16
+ "pree2e" : " webdriver-manager update" ,
17
+ "e2e" : " protractor"
16
18
},
17
19
"private" : true ,
18
20
"dependencies" : {
30
32
"ember-cli-inject-live-reload" : " ^1.3.0" ,
31
33
"glob" : " ^6.0.4" ,
32
34
"jasmine-core" : " ^2.3.4" ,
35
+ "jasmine-spec-reporter" : " ^2.4.0" ,
33
36
"karma" : " ^0.13.15" ,
34
37
"karma-chrome-launcher" : " ^0.2.1" ,
35
38
"karma-jasmine" : " ^0.3.6" ,
36
39
"protractor" : " ^3.0.0" ,
37
40
"tslint" : " ^3.3.0" ,
38
41
"typescript" : " ^1.7.3" ,
39
- "typings" : " ^0.6.6"
42
+ "typings" : " ^0.6.6" ,
43
+ "ts-node" : " ^0.5.5"
40
44
}
41
45
}
Original file line number Diff line number Diff line change
1
+ var SpecReporter = require ( 'jasmine-spec-reporter' ) ;
2
+
1
3
exports . config = {
2
4
allScriptsTimeout : 11000 ,
3
-
4
5
specs : [
5
- 'e2e/**/*.e2e.js '
6
+ 'e2e/**/*.e2e.ts '
6
7
] ,
7
-
8
8
capabilities : {
9
9
'browserName' : 'chrome'
10
10
} ,
11
-
12
11
directConnect : true ,
13
-
14
12
baseUrl : 'http://localhost:4200/' ,
15
-
16
13
framework : 'jasmine' ,
17
-
18
14
jasmineNodeOpts : {
19
- defaultTimeoutInterval : 30000
15
+ showColors : true ,
16
+ defaultTimeoutInterval : 30000 ,
17
+ print : function ( ) { }
20
18
} ,
21
-
22
19
useAllAngular2AppRoots : true ,
23
-
24
20
beforeLaunch : function ( ) {
25
- require ( 'zone.js' ) ;
26
- require ( 'reflect-metadata' ) ;
27
- }
21
+ require ( 'ts-node/register' ) ;
22
+ } ,
23
+ onPrepare : function ( ) {
24
+ jasmine . getEnv ( ) . addReporter ( new SpecReporter ( ) ) ;
25
+ } ,
28
26
} ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"dependencies" : {},
3
- "devDependencies" : {
4
- },
3
+ "devDependencies" : {},
5
4
"ambientDevDependencies" : {
6
- "jasmine" : " github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#26c98c8a9530c44f8c801ccc3b2057e2101187ee"
5
+ "angular-protractor" : " github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#17fa1e5f269189f7f8e0f53f8c443e6c2eac562c" ,
6
+ "jasmine" : " github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#26c98c8a9530c44f8c801ccc3b2057e2101187ee" ,
7
+ "selenium-webdriver" : " github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#a83677ed13add14c2ab06c7325d182d0ba2784ea"
7
8
},
8
9
"ambientDependencies" : {
9
10
"es6-shim" : " github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#6697d6f7dadbf5773cb40ecda35a76027e0783b2"
Original file line number Diff line number Diff line change
1
+ /* jshint node: true */
2
+ 'use strict' ;
3
+
4
+ var Command = require ( 'ember-cli/lib/models/command' ) ;
5
+ var E2ETask = require ( '../tasks/e2e' ) ;
6
+
7
+ module . exports = Command . extend ( {
8
+ name : 'e2e' ,
9
+ description : 'Run e2e tests in existing project' ,
10
+ works : 'insideProject' ,
11
+ run : function ( ) {
12
+ var e2eTask = new E2ETask ( {
13
+ ui : this . ui ,
14
+ analytics : this . analytics ,
15
+ project : this . project
16
+ } ) ;
17
+
18
+ return e2eTask . run ( ) ;
19
+ }
20
+ } ) ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ module.exports = {
10
10
'install' : require ( './commands/install' ) ,
11
11
'uninstall' : require ( './commands/uninstall' ) ,
12
12
'test' : require ( './commands/test' ) ,
13
+ 'e2e' : require ( './commands/e2e' ) ,
13
14
'lint' : require ( './commands/lint' ) ,
14
15
'format' : require ( './commands/format' )
15
16
} ;
Original file line number Diff line number Diff line change
1
+ /* jshint node: true */
2
+ 'use strict' ;
3
+
4
+ var Promise = require ( 'ember-cli/lib/ext/promise' ) ;
5
+ var Task = require ( 'ember-cli/lib/models/task' ) ;
6
+ var exec = Promise . denodeify ( require ( 'shelljs' ) . exec ) ;
7
+
8
+ module . exports = Task . extend ( {
9
+ run : function ( ) {
10
+ return exec ( 'npm run e2e' ) ;
11
+ }
12
+ } ) ;
You can’t perform that action at this time.
0 commit comments