File tree 4 files changed +36
-9
lines changed
4 files changed +36
-9
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ module.exports = function (grunt) {
99
99
]
100
100
} ,
101
101
karma : {
102
+ e2e : {
103
+ configFile : 'karma-e2e.conf.js' ,
104
+ singleRun : true
105
+ } ,
102
106
unit : {
103
107
configFile : 'karma.conf.js' ,
104
108
singleRun : true
@@ -272,13 +276,22 @@ module.exports = function (grunt) {
272
276
'open' ,
273
277
'watch'
274
278
] ) ;
275
-
276
- grunt . registerTask ( 'test' , [
279
+
280
+ grunt . registerTask ( 'test:unit ' , [
277
281
'clean:server' ,
278
282
'coffee' ,
279
283
'compass' ,
280
284
'connect:test' ,
281
- 'karma'
285
+ 'karma:unit'
286
+ ] ) ;
287
+
288
+ grunt . registerTask ( 'test:e2e' , [
289
+ 'clean:server' ,
290
+ 'coffee' ,
291
+ 'compass' ,
292
+ 'livereload-start' ,
293
+ 'connect:livereload' ,
294
+ 'karma:e2e'
282
295
] ) ;
283
296
284
297
grunt . registerTask ( 'build' , [
Original file line number Diff line number Diff line change @@ -18,10 +18,19 @@ Because I wanted to write Testable Application in AngularJS.
18
18
#Try?
19
19
You need to have [ prerequisite components] ( http://wp.me/paveF-h6 ) installed to run it. Finally just run:
20
20
21
+ ###basic setup
21
22
* $ cd eShell
22
23
* $ sudo npm install
23
24
* $ sudo bower install
25
+
26
+ ### Fire up an app
24
27
* $ grunt server
25
28
29
+ ### Run unit tests
30
+ * $ grunt test: unit
31
+
32
+ ### Run e2e tests
33
+ * $ grunt test: e2e
34
+
26
35
#Todo?
27
36
Include more templates
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ basePath = '';
7
7
files = [
8
8
ANGULAR_SCENARIO ,
9
9
ANGULAR_SCENARIO_ADAPTER ,
10
- 'test/e2e/**/* .js'
10
+ 'test/app.scenarios .js'
11
11
] ;
12
12
13
13
// list of files to exclude
@@ -18,7 +18,7 @@ exclude = [];
18
18
reporters = [ 'progress' ] ;
19
19
20
20
// web server port
21
- port = 8080 ;
21
+ port = 8000 ;
22
22
23
23
// cli runner port
24
24
runnerPort = 9100 ;
@@ -28,10 +28,10 @@ colors = true;
28
28
29
29
// level of logging
30
30
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
31
- logLevel = LOG_INFO ;
31
+ logLevel = LOG_DEBUG ;
32
32
33
33
// enable / disable watching file and executing tests whenever any file changes
34
- autoWatch = false ;
34
+ autoWatch = true ;
35
35
36
36
// Start these browsers, currently available:
37
37
// - Chrome
@@ -49,3 +49,8 @@ captureTimeout = 5000;
49
49
// Continuous Integration mode
50
50
// if true, it capture browsers, run tests and exit
51
51
singleRun = false ;
52
+
53
+ proxies = {
54
+ '/' : 'http://localhost:9000/'
55
+ } ;
56
+ urlRoot = '/_e2e/' ;
Original file line number Diff line number Diff line change 1
1
describe ( 'text box scenario' , function ( ) {
2
2
beforeEach ( function ( ) {
3
- browser ( ) . navigateTo ( 'http://localhost:9000 ' ) ;
3
+ browser ( ) . navigateTo ( '/ ' ) ;
4
4
} ) ;
5
5
it ( 'should disable submit/tryagain/showans buttons on page/template load' , function ( ) {
6
6
expect ( element ( 'button:contains("Submit")' ) . attr ( 'disabled' ) ) . toBe ( 'disabled' ) ;
@@ -9,7 +9,7 @@ describe('text box scenario', function () {
9
9
} ) ;
10
10
11
11
it ( 'should set attempt 1 of N' , function ( ) {
12
- expect ( element ( 'div[ng-controller="FooterCtrl"] div.pull-left:first > input ' ) . val ( ) ) . toContain ( 'Attempt 1 of' ) ;
12
+ expect ( element ( 'div[ng-controller="FooterCtrl"] div.pull-left:first > button:eq(0) ' ) . html ( ) ) . toContain ( 'Attempt 1 of' ) ;
13
13
} ) ;
14
14
15
15
it ( 'should set template 1 of N' , function ( ) {
You can’t perform that action at this time.
0 commit comments