@@ -47,7 +47,7 @@ casper.test.begin('todomvc', 69, function (test) {
47
47
} )
48
48
. then ( function ( ) {
49
49
test . assertElementCount ( '.todo' , 2 , 'should have 2 items now' )
50
- test . assertSelectorHasText ( '.todo label' , 'test2' , 'new item should have correct label text' )
50
+ test . assertSelectorHasText ( '.todo:nth-child(2) label' , 'test2' , 'new item should have correct label text' )
51
51
test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
52
52
} )
53
53
@@ -61,7 +61,7 @@ casper.test.begin('todomvc', 69, function (test) {
61
61
62
62
test . assertSelectorHasText ( '#todo-count strong' , '1' , 'remaining count should be 1' )
63
63
test . assertVisible ( '#clear-completed' , '#clear-completed should now be visible' )
64
- test . assertSelectorHasText ( '#clear-completed' , 'Remove Completed (1)' )
64
+ test . assertSelectorHasText ( '#clear-completed' , 'Clear completed (1)' )
65
65
} )
66
66
67
67
// add yet another item -----------------------------------------------
@@ -71,7 +71,7 @@ casper.test.begin('todomvc', 69, function (test) {
71
71
} )
72
72
. then ( function ( ) {
73
73
test . assertElementCount ( '.todo' , 3 , 'should have 3 items now' )
74
- test . assertSelectorHasText ( '.todo label' , 'test3' , 'new item should have correct label text' )
74
+ test . assertSelectorHasText ( '.todo:nth-child(3) label' , 'test3' , 'new item should have correct label text' )
75
75
test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
76
76
} )
77
77
@@ -88,12 +88,12 @@ casper.test.begin('todomvc', 69, function (test) {
88
88
89
89
// check more as completed --------------------------------------------
90
90
. then ( function ( ) {
91
- this . click ( '.todo:nth-child(1 ) .toggle' )
92
- this . click ( '.todo:nth-child(2 ) .toggle' )
91
+ this . click ( '.todo:nth-child(4 ) .toggle' )
92
+ this . click ( '.todo:nth-child(5 ) .toggle' )
93
93
} )
94
94
. then ( function ( ) {
95
95
test . assertElementCount ( '.todo.completed' , 3 , 'should have 3 item completed' )
96
- test . assertSelectorHasText ( '#clear-completed' , 'Remove Completed (3)' )
96
+ test . assertSelectorHasText ( '#clear-completed' , 'Clear completed (3)' )
97
97
test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
98
98
} )
99
99
@@ -102,7 +102,7 @@ casper.test.begin('todomvc', 69, function (test) {
102
102
. thenClick ( '.todo:nth-child(1) .destroy' , function ( ) {
103
103
test . assertElementCount ( '.todo' , 4 , 'should have 4 items now' )
104
104
test . assertElementCount ( '.todo.completed' , 2 , 'should have 2 item completed' )
105
- test . assertSelectorHasText ( '#clear-completed' , 'Remove Completed (2)' )
105
+ test . assertSelectorHasText ( '#clear-completed' , 'Clear completed (2)' )
106
106
test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
107
107
} )
108
108
@@ -111,15 +111,15 @@ casper.test.begin('todomvc', 69, function (test) {
111
111
. thenClick ( '.todo:nth-child(2) .destroy' , function ( ) {
112
112
test . assertElementCount ( '.todo' , 3 , 'should have 3 items now' )
113
113
test . assertElementCount ( '.todo.completed' , 2 , 'should have 2 item completed' )
114
- test . assertSelectorHasText ( '#clear-completed' , 'Remove Completed (2)' )
114
+ test . assertSelectorHasText ( '#clear-completed' , 'Clear completed (2)' )
115
115
test . assertSelectorHasText ( '#todo-count strong' , '1' , 'remaining count should be 1' )
116
116
} )
117
117
118
118
// remove all completed ------------------------------------------------
119
119
120
120
. thenClick ( '#clear-completed' , function ( ) {
121
121
test . assertElementCount ( '.todo' , 1 , 'should have 1 item now' )
122
- test . assertSelectorHasText ( '.todo label' , 'test ' , 'the remaining one should be the first one' )
122
+ test . assertSelectorHasText ( '.todo label' , 'test2 ' , 'the remaining one should be the second one' )
123
123
test . assertElementCount ( '.todo.completed' , 0 , 'should have no completed items now' )
124
124
test . assertSelectorHasText ( '#todo-count strong' , '1' , 'remaining count should be 1' )
125
125
test . assertNotVisible ( '#clear-completed' , '#clear-completed should be hidden' )
@@ -129,14 +129,14 @@ casper.test.begin('todomvc', 69, function (test) {
129
129
. then ( function ( ) {
130
130
createNewItem ( 'test' )
131
131
createNewItem ( 'test' )
132
- this . click ( '.todo:nth-child(1) .toggle' )
133
132
this . click ( '.todo:nth-child(2) .toggle' )
133
+ this . click ( '.todo:nth-child(3) .toggle' )
134
134
} )
135
135
136
136
// active filter ----------------------------------------------------------
137
137
. thenClick ( '#filters li:nth-child(2) a' , function ( ) {
138
- test . assertElementCount ( '.todo' , 1 , 'filter active should have 2 items ' )
139
- test . assertElementCount ( '.todo.completed' , 0 , 'visible items should be incompleted ' )
138
+ test . assertElementCount ( '.todo' , 1 , 'filter active should have 1 item ' )
139
+ test . assertElementCount ( '.todo.completed' , 0 , 'visible items should be incomplete ' )
140
140
} )
141
141
142
142
// add item with filter active --------------------------------------------
@@ -158,15 +158,15 @@ casper.test.begin('todomvc', 69, function (test) {
158
158
. thenOpen ( '../../examples/todomvc/index.html#/active' , function ( ) {
159
159
test . assertElementCount ( '.todo' , 2 , 'filter active should have 2 items' )
160
160
test . assertElementCount ( '.todo.completed' , 0 , 'visible items should be incompleted' )
161
- test . assertSelectorHasText ( '#clear-completed' , 'Remove Completed (2)' )
161
+ test . assertSelectorHasText ( '#clear-completed' , 'Clear completed (2)' )
162
162
test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
163
163
} )
164
164
165
165
// completed filter on page load ------------------------------------------
166
166
. thenOpen ( '../../examples/todomvc/index.html#/completed' , function ( ) {
167
167
test . assertElementCount ( '.todo' , 2 , 'filter completed should have 2 items' )
168
168
test . assertElementCount ( '.todo.completed' , 2 , 'visible items should be completed' )
169
- test . assertSelectorHasText ( '#clear-completed' , 'Remove Completed (2)' )
169
+ test . assertSelectorHasText ( '#clear-completed' , 'Clear completed (2)' )
170
170
test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
171
171
} )
172
172
0 commit comments