@@ -118,6 +118,7 @@ export async function testTab(
118
118
) : Promise < void > {
119
119
// Run the "Expect each tab to become selected, to go to the correct url, and to show all of its columns when selected" test
120
120
await page . goto ( startTab . url ) ;
121
+ await page . getByTestId ( TEST_IDS . TABLE_FIRST_CELL ) . waitFor ( ) ;
121
122
await expect ( getFirstRowNthColumnCellLocator ( page , 1 ) ) . toBeVisible ( ) ;
122
123
await getTabByText ( page , endTab . tabName ) . click ( ) ;
123
124
await expect ( page ) . toHaveURL ( endTab . url ) ;
@@ -183,13 +184,12 @@ export async function testSortAzul(
183
184
}
184
185
if ( columnObject ?. sortable ) {
185
186
// Locator that can be clicked to sort the column
186
- const columnSortLocator = page . getByRole ( "button" , {
187
- exact : true ,
188
- name : columnObject . name ,
189
- } ) ;
187
+ const columnSortLocator = page
188
+ . locator ( MUI_CLASSES . TABLE_SORT_LABEL )
189
+ . filter ( { hasText : columnObject . name } ) ;
190
190
// Locator for the column sort icon
191
191
const sortIconLocator = columnSortLocator . locator (
192
- ".MuiTableSortLabel-icon"
192
+ MUI_CLASSES . TABLE_SORT_LABEL_ICON
193
193
) ;
194
194
// If on the first cell, expect the sort icon to be visible. Otherwise, expect it not to be
195
195
if ( columnPosition === 0 ) {
@@ -1245,9 +1245,7 @@ export async function testPaginationContent(
1245
1245
* @returns - a Playwright locator object for the tab with the specified text.
1246
1246
*/
1247
1247
export const getTabByText = ( page : Page , tabText : string ) : Locator => {
1248
- return page . locator ( "[role='tab']" , {
1249
- has : page . locator ( `text="${ tabText } "` ) ,
1250
- } ) ;
1248
+ return page . locator ( "[role='tab']" ) . filter ( { hasText : tabText } ) ;
1251
1249
} ;
1252
1250
1253
1251
/* eslint-enable sonarjs/no-duplicate-string -- Checking duplicate strings again*/
0 commit comments