@@ -123,17 +123,17 @@ describe('database page', () => {
123123
124124 // Table/view dropdown
125125 it ( 'Table/view dropdown' , ( ) => {
126- cy . get ( '[data-cy="tabledropdown"] ' ) . click ( )
127- cy . get ( '[data-cy="row-Constituency_Turnout_Information"] ' ) . click ( )
128- cy . get ( '[data-cy="col-Constituency_Name "]' ) . should ( 'contain ' , 'Constituency_Name ' )
126+ cy . get ( '[name="viewtable"]' ) . parent ( '.react-dropdown-select ') . click ( )
127+ cy . get ( '[name="viewtable"]' ) . siblings ( '.react-dropdown-select-dropdown' ) . find ( '.react-dropdown-select-item' ) . contains ( 'Constituency_Turnout_Information ') . click ( )
128+ cy . get ( '[name="viewtable "]' ) . should ( 'have.value ' , 'Constituency_Turnout_Information ' )
129129 } )
130130
131131 // Branch dropdown
132132 it ( 'Branch dropdown' , ( ) => {
133- cy . get ( '[data-cy="branchname "]' ) . should ( 'contain.text ' , 'main' )
134- cy . get ( '[data-cy="branchdropdown"] ' ) . click ( )
135- cy . get ( '[data-cy="branch-stuff"] ' ) . click ( )
136- cy . get ( '[data-cy="branchname "]' ) . should ( 'contain.text ' , 'stuff' )
133+ cy . get ( '[name="viewbranch "]' ) . should ( 'have.value ' , 'main' )
134+ cy . get ( '[name="viewbranch"]' ) . parent ( '.react-dropdown-select ') . click ( )
135+ cy . get ( '[name="viewbranch"]' ) . siblings ( '.react-dropdown-select-dropdown' ) . find ( '.react-dropdown-select-item' ) . contains ( 'stuff ') . click ( )
136+ cy . get ( '[name="viewbranch "]' ) . should ( 'have.value ' , 'stuff' )
137137 } )
138138
139139 // New Merge Request button
@@ -207,57 +207,57 @@ describe('database page', () => {
207207
208208 // Click on column header (sort ascending)
209209 it ( 'Click on column header - 1st time' , ( ) => {
210- cy . get ( '[data-cy="col- Candidate_First_Pref_Votes"] ' ) . click ( )
211- cy . get ( '[data-cy="datarow-Candidate_First_Pref_Votes"]' ) . should ( 'contain' , '27' )
210+ cy . get ( '.rdg-header-row' ) . find ( 'span' ) . contains ( ' Candidate_First_Pref_Votes') . click ( )
211+ cy . get ( '.rdg-row' ) . first ( ) . find ( '.rdg-cell' ) . first ( ) . should ( 'contain' , '27' )
212212 } )
213213
214214 // Click on column header twice (sort descending)
215215 it ( 'Click on column header - 2nd time' , ( ) => {
216- cy . get ( '[data-cy="col- Candidate_First_Pref_Votes"] ' ) . click ( )
217- cy . get ( '[data-cy="col- Candidate_First_Pref_Votes"] ' ) . click ( )
218- cy . get ( '[data-cy="datarow-Candidate_First_Pref_Votes"]' ) . should ( 'contain' , '10258' )
216+ cy . get ( '.rdg-header-row' ) . find ( 'span' ) . contains ( ' Candidate_First_Pref_Votes') . click ( )
217+ cy . get ( '.rdg-header-row' ) . find ( 'span' ) . contains ( ' Candidate_First_Pref_Votes') . click ( )
218+ cy . get ( '.rdg-row' ) . first ( ) . find ( '.rdg-cell' ) . first ( ) . should ( 'contain' , '10258' )
219219 } )
220220
221221 // Click on page down button
222222 it ( 'Page down button' , ( ) => {
223223 // Initial sort to guarantee a stable order
224- cy . get ( '[data-cy="col- Candidate_First_Pref_Votes"] ' ) . click ( )
224+ cy . get ( '.rdg-header-row' ) . find ( 'span' ) . contains ( ' Candidate_First_Pref_Votes') . click ( )
225225
226226 // Click the button we're testing
227227 cy . get ( '[data-cy="pgdnbtn"]' ) . click ( )
228- cy . get ( '[data-cy="datarow-Candidate_First_Pref_Votes"]' ) . should ( 'contain' , '85' )
228+ cy . get ( '.rdg-row' ) . first ( ) . find ( '.rdg-cell' ) . first ( ) . should ( 'contain' , '85' )
229229 } )
230230
231231 // Click on "go to the last page" button
232232 it ( 'Last page button' , ( ) => {
233233 // Initial sort to guarantee a stable order
234- cy . get ( '[data-cy="col- Candidate_First_Pref_Votes"] ' ) . click ( )
234+ cy . get ( '.rdg-header-row' ) . find ( 'span' ) . contains ( ' Candidate_First_Pref_Votes') . click ( )
235235
236236 // Click the button we're testing
237237 cy . get ( '[data-cy="lastpgbtn"]' ) . click ( )
238- cy . get ( '[data-cy="datarow-Candidate_First_Pref_Votes"]' ) . should ( 'contain' , '8881' )
238+ cy . get ( '.rdg-row' ) . first ( ) . find ( '.rdg-cell' ) . first ( ) . should ( 'contain' , '8881' )
239239 } )
240240
241241 // Click on page up button
242242 it ( 'Page up button' , ( ) => {
243243 // Initial sort to guarantee a stable order
244- cy . get ( '[data-cy="col- Candidate_First_Pref_Votes"] ' ) . click ( )
244+ cy . get ( '.rdg-header-row' ) . find ( 'span' ) . contains ( ' Candidate_First_Pref_Votes') . click ( )
245245
246246 // Click the button we're testing
247247 cy . get ( '[data-cy="lastpgbtn"]' ) . click ( )
248248 cy . get ( '[data-cy="pgupbtn"]' ) . click ( )
249- cy . get ( '[data-cy="datarow-Candidate_First_Pref_Votes"]' ) . should ( 'contain' , '7786' )
249+ cy . get ( '.rdg-row' ) . first ( ) . find ( '.rdg-cell' ) . first ( ) . should ( 'contain' , '7786' )
250250 } )
251251
252252 // Click on "go to the first page" button
253253 it ( 'First page button' , ( ) => {
254254 // Initial sort to guarantee a stable order
255- cy . get ( '[data-cy="col- Candidate_First_Pref_Votes"] ' ) . click ( )
255+ cy . get ( '.rdg-header-row' ) . find ( 'span' ) . contains ( ' Candidate_First_Pref_Votes') . click ( )
256256
257257 // Click the button we're testing
258258 cy . get ( '[data-cy="lastpgbtn"]' ) . click ( )
259259 cy . get ( '[data-cy="firstpgbtn"]' ) . click ( )
260- cy . get ( '[data-cy="datarow-Candidate_First_Pref_Votes"]' ) . should ( 'contain' , '27' )
260+ cy . get ( '.rdg-row' ) . first ( ) . find ( '.rdg-cell' ) . first ( ) . should ( 'contain' , '27' )
261261 } )
262262
263263 // Readme contents
0 commit comments