File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,11 +2,19 @@ import { Page, expect } from "@playwright/test";
22
33export const selectFacultyAndRegistration = async ( page : Page ) => {
44 console . log ( "selectFacultyAndRegistration - 1" ) ;
5+ await page . waitForTimeout ( 1000 ) ;
56 const facultyButton = page . getByText ( / w y b i e r z s w ó j / i) ;
67 await facultyButton . click ( ) ;
78 console . log ( "selectFacultyAndRegistration - 2" ) ;
8- await page . waitForTimeout ( 1000 ) ;
9- const chosenFaculty = page . getByRole ( "option" , { name : / w 5 / i } ) ;
9+
10+ // Wait for the dropdown content to be visible
11+ await page . waitForSelector ( '[role="option"]' , { state : "visible" } ) ;
12+
13+ // Wait specifically for the W5 option to be available
14+ const chosenFaculty = page
15+ . locator ( '[role="option"]' )
16+ . filter ( { hasText : "W5" } ) ;
17+ await expect ( chosenFaculty ) . toBeVisible ( ) ;
1018 console . log ( "selectFacultyAndRegistration - 2.5" ) ;
1119 await chosenFaculty . click ( ) ;
1220 console . log ( "selectFacultyAndRegistration - 3" ) ;
You can’t perform that action at this time.
0 commit comments