@@ -9,32 +9,32 @@ describe('Vite React Typescript Template Test Suite', () => {
99 it ( 'should perform counter operations' , ( ) => {
1010 cy . visit ( '/' ) ;
1111
12- cy . contains ( ' Decrement') . click ( ) ;
12+ cy . findByRole ( 'button' , { name : ' Decrement' } ) . click ( ) ;
1313 cy . get ( '.Counter [role="note"]' ) . should ( 'contain.text' , 'count is -1' ) ;
1414
15- cy . contains ( ' Increment') . click ( ) ;
15+ cy . findByRole ( 'button' , { name : ' Increment' } ) . click ( ) ;
1616 cy . get ( '.Counter [role="note"]' ) . should ( 'contain.text' , 'count is 0' ) ;
1717
1818 cy . get ( 'input.MuiInput-input' ) . clear ( ) . type ( '5' ) ;
19- cy . contains ( ' Increment By Value') . click ( ) ;
19+ cy . findByRole ( 'button' , { name : ' Increment By Value' } ) . click ( ) ;
2020 cy . get ( '.Counter [role="note"]' ) . should ( 'contain.text' , 'count is 5' ) ;
2121
2222 cy . get ( 'input.MuiInput-input' ) . clear ( ) . type ( '-5' ) ;
23- cy . contains ( ' Increment By Value') . click ( ) ;
23+ cy . findByRole ( 'button' , { name : ' Increment By Value' } ) . click ( ) ;
2424 cy . get ( '.Counter [role="note"]' ) . should ( 'contain.text' , 'count is 0' ) ;
2525
26- cy . contains ( ' Decrement Async') . click ( ) ;
26+ cy . findByRole ( 'button' , { name : ' Decrement Async' } ) . click ( ) ;
2727 cy . get ( '.Counter [role="note"]' ) . should ( 'contain.text' , 'count is -1' ) ;
2828
29- cy . contains ( ' Increment Async') . click ( ) ;
29+ cy . findByRole ( 'button' , { name : ' Increment Async' } ) . click ( ) ;
3030 cy . get ( '.Counter [role="note"]' ) . should ( 'contain.text' , 'count is 0' ) ;
3131
3232 cy . get ( 'input.MuiInput-input' ) . clear ( ) . type ( '5' ) ;
33- cy . contains ( ' Increment Async By Value') . click ( ) ;
33+ cy . findByRole ( 'button' , { name : ' Increment Async By Value' } ) . click ( ) ;
3434 cy . get ( '.Counter [role="note"]' ) . should ( 'contain.text' , 'count is 5' ) ;
3535
3636 cy . get ( 'input.MuiInput-input' ) . clear ( ) . type ( '-5' ) ;
37- cy . contains ( ' Increment Async By Value') . click ( ) ;
37+ cy . findByRole ( 'button' , { name : ' Increment Async By Value' } ) . click ( ) ;
3838 cy . get ( '.Counter [role="note"]' ) . should ( 'contain.text' , 'count is 0' ) ;
3939 } ) ;
4040
0 commit comments