File tree Expand file tree Collapse file tree 5 files changed +61
-1
lines changed Expand file tree Collapse file tree 5 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ before_script:
53
53
54
54
script :
55
55
- ./scripts/ci/build-and-test.sh ${MODE}
56
+ - ./scripts/ci/test-e2e-js.sh
56
57
57
58
cache :
58
59
directories :
Original file line number Diff line number Diff line change 41
41
"karma-firefox-launcher" : " ^0.1.7" ,
42
42
"karma-jasmine" : " ^0.3.6" ,
43
43
"karma-sauce-launcher" : " ^0.2.14" ,
44
- "typescript" : " ^1.7.5"
44
+ "protractor" : " ^3.0.0" ,
45
+ "typescript" : " ^1.7.5" ,
46
+ "webdriver-manager" : " ^8.0.0"
45
47
}
46
48
}
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -ex
3
+
4
+ echo =============================================================================
5
+ # go to project dir
6
+ SCRIPT_DIR=$( dirname $0 )
7
+ cd ${SCRIPT_DIR} /../..
8
+
9
+ ./node_modules/.bin/webdriver-manager update
10
+
11
+ function killServer () {
12
+ kill $serverPid
13
+ }
14
+
15
+
16
+ ./node_modules/.bin/ng serve&
17
+ serverPid=$!
18
+
19
+ # If this scipt is killed, ensure that the server is terminated.
20
+ trap killServer EXIT
21
+
22
+ # Wait for server to come up!
23
+ sleep 10
24
+
25
+ # Let protractor use default browser unless one is specified.
26
+ OPTIONS=" " ;
27
+ if [[ -n " $E2E_BROWSERS " ]]; then
28
+ OPTIONS=" --browsers=$E2E_BROWSERS " ;
29
+ fi
30
+
31
+ ./node_modules/.bin/protractor test/protractor-js.conf.js ${OPTIONS}
Original file line number Diff line number Diff line change
1
+ describe ( 'protractor sanity test' , function ( ) {
2
+ var url = 'index.html' ;
3
+
4
+ beforeEach ( ( ) => { browser . get ( url ) ; } ) ;
5
+
6
+ it ( 'should sanity check the demo-app' , ( ) => {
7
+ var button = element . all ( by . css ( 'button' ) ) . first ( ) ;
8
+ expect ( button . getAttribute ( 'md-button' ) ) . toBeDefined ( ) ;
9
+ } ) ;
10
+ } ) ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Configuration for running e2e tests with Protractor.
3
+ */
4
+ exports . config = {
5
+ framework : 'jasmine2' ,
6
+ useAllAngular2AppRoots : true ,
7
+
8
+ baseUrl : 'http://localhost:4200/' ,
9
+ specs : [ '../dist/e2e/button-e2e-spec.js' ] ,
10
+
11
+ // Specific options for jasmine.
12
+ jasmineNodeOpts : {
13
+ showColors : true ,
14
+ defaultTimeoutInterval : 60000
15
+ } ,
16
+ } ;
You can’t perform that action at this time.
0 commit comments