@@ -5,9 +5,16 @@ async function filterDevicePageByDeviceName(page: Page, deviceName: string) {
55 const filterInput = filter . locator ( "input" ) ;
66
77 await filterInput . fill ( "deviceName" ) ;
8+
9+ const dropdown = filter . locator ( "ix-dropdown" ) ;
10+ await expect ( dropdown . getByText ( "Categories" ) ) . toBeVisible ( ) ;
11+
812 await page . keyboard . press ( "Tab" ) ;
913 await page . keyboard . press ( "Enter" ) ;
1014
15+ await expect ( filter . locator ( "ix-dropdown" ) . getByText ( "Categories" ) ) . not . toBeVisible ( ) ;
16+ await expect ( filter . locator ( "ix-dropdown" ) . getByText ( "deviceName" ) ) . toBeVisible ( ) ;
17+
1118 await filterInput . fill ( deviceName ) ;
1219 await page . keyboard . press ( "Enter" ) ;
1320 await page . mouse . click ( 0 , 0 ) ;
@@ -18,11 +25,16 @@ async function filterDevicePageByDeviceName(page: Page, deviceName: string) {
1825test ( "filter for specific deviceName" , async ( { page } ) => {
1926 await page . goto ( "http://localhost:5173/#/devices" ) ;
2027
21- await filterDevicePageByDeviceName ( page , "s71200" ) ;
22-
2328 const aggrid = page . locator ( ".ag-root-wrapper" ) ;
2429 const rows = aggrid . locator ( ".ag-center-cols-container .ag-row" ) ;
2530
31+ await expect ( rows ) . toHaveCount ( 22 , {
32+ // AG-Grid takes some time to filter the rows
33+ timeout : 500 ,
34+ } ) ;
35+
36+ await filterDevicePageByDeviceName ( page , "s71200" ) ;
37+
2638 await expect ( rows ) . toHaveCount ( 1 , {
2739 // AG-Grid takes some time to filter the rows
2840 timeout : 500 ,
0 commit comments