@@ -35,7 +35,7 @@ setup('authenticate to OpenShift Cluster', async ({ page, baseURL }) => {
3535 console . log ( `IDP selection screen detected. Selecting provider: "${ idpName } "` ) ;
3636
3737 //look for the specific IDP
38- const idpLink = page . getByRole ( 'link' , { name : new RegExp ( idpName , 'i' ) } ) ;
38+ const idpLink = page . getByRole ( 'link' , { name : idpName , exact : true } ) ;
3939
4040 await idpLink . waitFor ( { state : 'visible' , timeout : TIMEOUTS . short } ) ;
4141 await idpLink . click ( ) ;
@@ -58,17 +58,21 @@ setup('authenticate to OpenShift Cluster', async ({ page, baseURL }) => {
5858 await passwordInput . fill ( process . env . CLUSTER_PASSWORD ) ;
5959 await page . getByRole ( 'button' , { name : / L o g i n / i } ) . click ( ) ;
6060
61- //handle the OpenShift 4.x Welcome Tour modal if it appears
61+ //handle the OpenShift 4.x Welcome Tour modal if it appears
6262 try {
6363 const skipTourButton = page . getByRole ( 'button' , { name : / s k i p t o u r / i } ) ;
6464 //wait up to 5 seconds for the modal to pop up
6565 await skipTourButton . waitFor ( { state : 'visible' , timeout : TIMEOUTS . short } ) ;
6666 await skipTourButton . click ( ) ;
6767 console . log ( 'Dismissed the OpenShift Welcome Tour modal.' ) ;
68- } catch ( error ) {
69- //if it doesn't appear within 5 seconds, it's an older cluster or already dismissed
70- //safely ignore the error and move on
71- console . debug ( 'welcome tour modal did not appear, continuing...' ) ;
68+ } catch ( error ) { r
69+ if ( error instanceof Error && error . name === 'TimeoutError' ) {
70+ //safely ignore the timeout and move on
71+ console . log ( 'welcome tour modal did not appear, continuing...' ) ;
72+ } else {
73+ //throw any other unexpected errors (like browser crashes or network drops)
74+ throw error ;
75+ }
7276 }
7377
7478 //save the auth state
0 commit comments