@@ -77,18 +77,33 @@ export const login = async (browser: Browser, nhsLoginUsername: string): Promise
7777 await page . waitForURL ( user . vaccinationsHubUrl , { timeout : 60000 , waitUntil : "domcontentloaded" } ) ;
7878 return page ;
7979 } else {
80+ await page . waitForURL ( / \/ ( t e r m s - a n d - c o n d i t i o n s \? r e d i r e c t _ t o = i n d e x | p a s s k e y \/ s e t u p - p a s s k e y | p a t i e n t \/ w h a t s - n e w ) $ / , {
81+ timeout : 30000 ,
82+ } ) ;
83+ if ( new URL ( page . url ( ) ) . pathname === "/passkey/setup-passkey" ) {
84+ await page . getByRole ( "link" , { name : "Skip passkey setup and continue to NHS App" } ) . click ( ) ;
85+ }
86+
87+ await page . waitForURL ( / \/ ( t e r m s - a n d - c o n d i t i o n s \? r e d i r e c t _ t o = i n d e x | p a t i e n t \/ | p a t i e n t \/ w h a t s - n e w ) $ / , {
88+ timeout : 30000 ,
89+ } ) ;
90+ if ( new URL ( page . url ( ) ) . pathname === "/patient/whats-new" ) {
91+ await page . getByRole ( "button" , { name : "Continue" } ) . click ( ) ;
92+ }
93+
8094 await page . waitForURL ( / \/ ( t e r m s - a n d - c o n d i t i o n s \? r e d i r e c t _ t o = i n d e x | p a t i e n t \/ ) $ / , { timeout : 30000 } ) ;
8195 if ( new URL ( page . url ( ) ) . pathname === "/terms-and-conditions" ) {
8296 await page . locator ( "#termsAndConditions-agree_checkbox" ) . setChecked ( true ) ;
8397 await page . getByRole ( "button" , { name : "Continue" } ) . click ( ) ;
8498 }
8599
86100 await page . waitForURL ( "**/patient/" , { timeout : 30000 } ) ;
87- await page . getByRole ( "heading" , { name : "Services" } ) . locator ( ".." ) . getByRole ( "link" , { name : "View all " } ) . click ( ) ;
88- await page . waitForURL ( "**/patient/services " , { timeout : 30000 } ) ;
101+ await page . locator ( 'li[data-qa="vaccination-panel-link"]' ) . getByRole ( "link" , { name : "Vaccinations " } ) . click ( ) ;
102+ await page . waitForURL ( "**/patient/vaccinations " , { timeout : 30000 } ) ;
89103
90104 const newTabPromise = page . context ( ) . waitForEvent ( "page" ) ;
91- await page . getByRole ( "link" , { name : "Check and book an RSV vaccination" } ) . click ( ) ;
105+ await page . getByRole ( "link" , { name : "Check and book vaccinations" } ) . click ( ) ;
106+
92107 const newTabPage = await newTabPromise ;
93108
94109 await newTabPage . waitForURL ( user . vaccinationsHubUrl , { timeout : 60000 , waitUntil : "networkidle" } ) ;
0 commit comments