File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,27 @@ test.describe('User Select View', () => {
35
35
test ( 'Can choose existing user' , async ( { userSelectPage, page } ) => {
36
36
await page . goto ( userSelectPage . url )
37
37
await expect ( page ) . toHaveURL ( userSelectPage . selectionUrl )
38
+
38
39
await userSelectPage . existingUserSelect . click ( )
39
- await page . locator ( '.p-select-list .p-select-option' ) . first ( ) . click ( )
40
+
41
+ const dropdownList = page . locator ( '.p-select-list' )
42
+ await expect ( dropdownList ) . toBeVisible ( )
43
+
44
+ // Wait for dropdown to populate
45
+ await page . waitForTimeout ( 500 )
46
+
47
+ // Try to click first option if it exists
48
+ const firstOption = page . locator ( '.p-select-list .p-select-option' ) . first ( )
49
+
50
+ if ( await firstOption . count ( ) > 0 ) {
51
+ await firstOption . click ( )
52
+ } else {
53
+ // No options available - close dropdown and use new user input
54
+ await page . keyboard . press ( 'Escape' )
55
+ await userSelectPage . newUserInput . fill ( `test-user-${ Date . now ( ) } ` )
56
+ }
57
+
40
58
await userSelectPage . nextButton . click ( )
41
- await expect ( page ) . toHaveURL ( userSelectPage . url )
59
+ await expect ( page ) . toHaveURL ( userSelectPage . url , { timeout : 15000 } )
42
60
} )
43
61
} )
You can’t perform that action at this time.
0 commit comments