@@ -14,48 +14,25 @@ test.describe('Search Filters', { tag: ['@search', '@local-mode'] }, () => {
1414 await severityControl . click ( ) ;
1515 await page . waitForTimeout ( 500 ) ;
1616
17- const errorFilterCheckbox = page . locator ( '[data-testid="filter-checkbox-error"]' ) ;
17+ const errorFilterCheckbox = page . locator ( '[data-testid="filter-checkbox-input- error"]' ) ;
1818 await expect ( errorFilterCheckbox ) . toBeVisible ( ) ;
1919 await errorFilterCheckbox . click ( ) ;
20- await page . waitForTimeout ( 1000 ) ;
21-
22- const errorCheckboxInput = page . locator ( '[data-testid="filter-checkbox-input-error"]' ) ;
23- await expect ( errorCheckboxInput ) . toBeChecked ( ) ;
24-
25- await page . waitForLoadState ( 'networkidle' ) ;
26- await page . waitForTimeout ( 2000 ) ;
27-
20+ await expect ( errorFilterCheckbox ) . toBeChecked ( ) ;
2821 const searchResults = page . locator ( '[data-testid="search-results-table"]' ) ;
2922 await expect ( searchResults ) . toBeVisible ( ) ;
23+ //todo: Check counts and accuracy of results
3024 } ) ;
3125
3226 await test . step ( 'Exclude error filter' , async ( ) => {
3327 const errorFilterCheckbox = page . locator ( '[data-testid="filter-checkbox-error"]' ) ;
3428 await errorFilterCheckbox . hover ( ) ;
35- await page . waitForTimeout ( 500 ) ;
3629
37- const excludeButton = page . locator ( '[data-testid="filter-exclude-error"]' ) ;
30+ const excludeButton = page . locator ( '[data-testid="filter-exclude-error"]' ) . first ( ) ;
3831 await expect ( excludeButton ) . toBeVisible ( ) ;
3932 await excludeButton . click ( ) ;
40- await page . waitForTimeout ( 1000 ) ;
41-
42- // Wait for the filter state to update and verify exclusion
33+ await page . waitForTimeout ( 500 ) ;
4334 const errorCheckboxInput = page . locator ( '[data-testid="filter-checkbox-input-error"]' ) ;
44-
45- // Wait for the exclude state to be applied - check for indeterminate state
46- await page . waitForFunction (
47- ( selector ) => {
48- const checkbox = document . querySelector ( selector ) as HTMLInputElement ;
49- return checkbox && checkbox . indeterminate === true ;
50- } ,
51- '[data-testid="filter-checkbox-input-error"]' ,
52- { timeout : 5000 }
53- ) ;
54-
55- // Verify the indeterminate state
56- const isIndeterminate = await errorCheckboxInput . evaluate ( ( el : HTMLInputElement ) => el . indeterminate ) ;
57- expect ( isIndeterminate ) . toBe ( true ) ;
58-
35+ await expect ( errorCheckboxInput ) . toHaveAttribute ( 'data-indeterminate' , 'true' ) ;
5936 await page . waitForLoadState ( 'networkidle' ) ;
6037 await page . waitForTimeout ( 2000 ) ;
6138 } ) ;
@@ -86,10 +63,7 @@ test.describe('Search Filters', { tag: ['@search', '@local-mode'] }, () => {
8663 const excludeButton = page . locator ( '[data-testid="filter-exclude-error"]' ) ;
8764
8865 await errorFilterCheckbox . hover ( ) ;
89- await page . waitForTimeout ( 500 ) ;
9066 await excludeButton . click ( ) ;
91- await page . waitForTimeout ( 500 ) ;
92-
9367 await errorFilterCheckbox . hover ( ) ;
9468 await page . waitForTimeout ( 500 ) ;
9569
0 commit comments