@@ -47,7 +47,7 @@ casper.test.begin('todomvc', 69, function (test) {
4747 } )
4848 . then ( function ( ) {
4949 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' )
5151 test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
5252 } )
5353
@@ -61,7 +61,7 @@ casper.test.begin('todomvc', 69, function (test) {
6161
6262 test . assertSelectorHasText ( '#todo-count strong' , '1' , 'remaining count should be 1' )
6363 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)' )
6565 } )
6666
6767 // add yet another item -----------------------------------------------
@@ -71,7 +71,7 @@ casper.test.begin('todomvc', 69, function (test) {
7171 } )
7272 . then ( function ( ) {
7373 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' )
7575 test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
7676 } )
7777
@@ -88,12 +88,12 @@ casper.test.begin('todomvc', 69, function (test) {
8888
8989 // check more as completed --------------------------------------------
9090 . 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' )
9393 } )
9494 . then ( function ( ) {
9595 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)' )
9797 test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
9898 } )
9999
@@ -102,7 +102,7 @@ casper.test.begin('todomvc', 69, function (test) {
102102 . thenClick ( '.todo:nth-child(1) .destroy' , function ( ) {
103103 test . assertElementCount ( '.todo' , 4 , 'should have 4 items now' )
104104 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)' )
106106 test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
107107 } )
108108
@@ -111,15 +111,15 @@ casper.test.begin('todomvc', 69, function (test) {
111111 . thenClick ( '.todo:nth-child(2) .destroy' , function ( ) {
112112 test . assertElementCount ( '.todo' , 3 , 'should have 3 items now' )
113113 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)' )
115115 test . assertSelectorHasText ( '#todo-count strong' , '1' , 'remaining count should be 1' )
116116 } )
117117
118118 // remove all completed ------------------------------------------------
119119
120120 . thenClick ( '#clear-completed' , function ( ) {
121121 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' )
123123 test . assertElementCount ( '.todo.completed' , 0 , 'should have no completed items now' )
124124 test . assertSelectorHasText ( '#todo-count strong' , '1' , 'remaining count should be 1' )
125125 test . assertNotVisible ( '#clear-completed' , '#clear-completed should be hidden' )
@@ -129,14 +129,14 @@ casper.test.begin('todomvc', 69, function (test) {
129129 . then ( function ( ) {
130130 createNewItem ( 'test' )
131131 createNewItem ( 'test' )
132- this . click ( '.todo:nth-child(1) .toggle' )
133132 this . click ( '.todo:nth-child(2) .toggle' )
133+ this . click ( '.todo:nth-child(3) .toggle' )
134134 } )
135135
136136 // active filter ----------------------------------------------------------
137137 . 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 ' )
140140 } )
141141
142142 // add item with filter active --------------------------------------------
@@ -158,15 +158,15 @@ casper.test.begin('todomvc', 69, function (test) {
158158 . thenOpen ( '../../examples/todomvc/index.html#/active' , function ( ) {
159159 test . assertElementCount ( '.todo' , 2 , 'filter active should have 2 items' )
160160 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)' )
162162 test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
163163 } )
164164
165165 // completed filter on page load ------------------------------------------
166166 . thenOpen ( '../../examples/todomvc/index.html#/completed' , function ( ) {
167167 test . assertElementCount ( '.todo' , 2 , 'filter completed should have 2 items' )
168168 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)' )
170170 test . assertSelectorHasText ( '#todo-count strong' , '2' , 'remaining count should be 2' )
171171 } )
172172
0 commit comments