File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ exports . config = {
2+ seleniumAddress : 'http://localhost:4444/wd/hub' ,
3+ specs : [ 'test/e2e/*.js' ]
4+ } ;
Original file line number Diff line number Diff line change 11Inspired by Firebase & AngularJS TodoMVC Example
2+
3+ Unit Testing (Using Karma) - http://karma-runner.github.io/0.12/index.html
4+ Test case: test/unit/*
5+
6+ Run: $ karma start karma.conf.js
7+
8+ Installation:
9+ npm install karma
10+ sudo npm install -g karma-cli
11+ sugo npm install -g karma-chrome-launcher
12+ sudo npm install -g karma-jasmine
13+
14+ E2E Testing (Usung Protractor) - http://www.protractortest.org/#/
15+ Test case: test/e2e/*
16+
17+ Run: $ protractor protractor.conf.js
18+
19+ Installation:
20+ npm install -g protractor
21+ webdriver-manager update & webdriver-manager start
Original file line number Diff line number Diff line change 1+ describe ( 'angularjs homepage todo list' , function ( ) {
2+ it ( 'should add a todo' , function ( ) {
3+ browser . get ( 'https://angularjs.org' ) ;
4+
5+ element ( by . model ( 'todoList.todoText' ) ) . sendKeys ( 'write first protractor test' ) ;
6+ element ( by . css ( '[value="add"]' ) ) . click ( ) ;
7+
8+ var todoList = element . all ( by . repeater ( 'todo in todoList.todos' ) ) ;
9+ expect ( todoList . count ( ) ) . toEqual ( 3 ) ;
10+ expect ( todoList . get ( 2 ) . getText ( ) ) . toEqual ( 'write first protractor test' ) ;
11+
12+ // You wrote your first test, cross it off the list
13+ todoList . get ( 2 ) . element ( by . css ( 'input' ) ) . click ( ) ;
14+ var completedAmount = element . all ( by . css ( '.done-true' ) ) ;
15+ expect ( completedAmount . count ( ) ) . toEqual ( 2 ) ;
16+ } ) ;
17+ } ) ;
You can’t perform that action at this time.
0 commit comments