This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +40
-6
lines changed Expand file tree Collapse file tree 5 files changed +40
-6
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,15 @@ exports.config = {
4
4
allScriptsTimeout : 11000 ,
5
5
6
6
specs : [
7
- 'test/e2e/tests/**/*.js'
7
+ 'test/e2e/tests/helpers/**/*.js' ,
8
+ 'test/e2e/tests/**/*Spec.js'
8
9
] ,
9
10
10
11
capabilities : {
11
12
'browserName' : 'chrome'
12
13
} ,
13
14
14
- baseUrl : 'http://localhost:8000/e2e/ ' ,
15
+ baseUrl : 'http://localhost:8000/' ,
15
16
16
17
framework : 'jasmine' ,
17
18
Original file line number Diff line number Diff line change @@ -28,10 +28,11 @@ config.multiCapabilities = [{
28
28
} ] ;
29
29
30
30
config . specs = [
31
- 'test/e2e/tests/**/*.js'
31
+ 'test/e2e/tests/helpers/**/*.js' ,
32
+ 'test/e2e/tests/**/*Spec.js'
32
33
] ;
33
34
34
- config . baseUrl = 'http://localhost:8000/e2e/ ' ;
35
+ config . baseUrl = 'http://localhost:8000/' ;
35
36
36
37
config . allScriptsTimeout = 30000 ;
37
38
config . getPageTimeout = 30000 ;
Original file line number Diff line number Diff line change 3
3
var config = require ( './protractor-shared-conf' ) . config ;
4
4
5
5
config . specs = [
6
- 'test/e2e/tests/**/*.js'
6
+ 'test/e2e/tests/helpers/**/*.js' ,
7
+ 'test/e2e/tests/**/*Spec.js'
7
8
] ;
8
9
9
- config . baseUrl = 'http://localhost:8000/e2e/ ' ;
10
+ config . baseUrl = 'http://localhost:8000/' ;
10
11
11
12
config . capabilities = {
12
13
browserName : 'chrome' ,
Original file line number Diff line number Diff line change
1
+ var helper = {
2
+ andWaitForAngular : function ( ) {
3
+ browser . waitForAngular ( ) ;
4
+ } ,
5
+ loadFixture : function ( fixture ) {
6
+ var i = 0 ;
7
+ while ( fixture [ i ] === '/' ) ++ i ;
8
+ fixture = fixture . slice ( i ) ;
9
+ if ( ! / \/ ( i n d e x \. h t m l ) ? $ / . test ( fixture ) ) {
10
+ fixture += '/' ;
11
+ }
12
+
13
+ browser . get ( '/e2e/fixtures/' + fixture ) ;
14
+ return helper ;
15
+ }
16
+ } ;
17
+
18
+ global . test = helper ;
19
+ global . loadFixture = helper . loadFixture ;
Original file line number Diff line number Diff line change
1
+ // Sample E2E test:
2
+ //
3
+ describe ( 'Sample' , function ( ) {
4
+ beforeEach ( function ( ) {
5
+ loadFixture ( "sample" ) . andWaitForAngular ( ) ;
6
+ } ) ;
7
+
8
+ it ( 'should have the interpolated text' , function ( ) {
9
+ expect ( element ( by . binding ( 'text' ) ) . getText ( ) )
10
+ . toBe ( 'Hello, world!' ) ;
11
+ } ) ;
12
+ } ) ;
You can’t perform that action at this time.
0 commit comments