@@ -86,25 +86,34 @@ export const login = async (browser: Browser, nhsLoginUsername: string): Promise
8686 await page . waitForURL ( user . vaccinationsHubUrl , { timeout : 60000 , waitUntil : "domcontentloaded" } ) ;
8787 return page ;
8888 } else {
89- 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 \/ ) $ / , {
89+ 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 ) $ / , {
9090 timeout : 30000 ,
9191 } ) ;
9292 if ( new URL ( page . url ( ) ) . pathname === "/passkey/setup-passkey" ) {
9393 await page . getByRole ( "link" , { name : "Skip passkey setup and continue to NHS App" } ) . click ( ) ;
9494 }
9595
96+ 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 ) $ / , {
97+ timeout : 30000 ,
98+ } ) ;
99+ if ( new URL ( page . url ( ) ) . pathname === "/patient/whats-new" ) {
100+ await page . getByRole ( "button" , { name : "Continue" } ) . click ( ) ;
101+ }
102+
96103 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 } ) ;
97104 if ( new URL ( page . url ( ) ) . pathname === "/terms-and-conditions" ) {
98105 await page . locator ( "#termsAndConditions-agree_checkbox" ) . setChecked ( true ) ;
99106 await page . getByRole ( "button" , { name : "Continue" } ) . click ( ) ;
100107 }
101108
102109 await page . waitForURL ( "**/patient/" , { timeout : 30000 } ) ;
103- await page . getByRole ( "heading" , { name : "Services" } ) . locator ( ".." ) . getByRole ( "link" , { name : "View all " } ) . click ( ) ;
104- await page . waitForURL ( "**/patient/services " , { timeout : 30000 } ) ;
110+ await page . locator ( 'li[data-qa="vaccination-panel-link"]' ) . getByRole ( "link" , { name : "Vaccinations " } ) . click ( ) ;
111+ await page . waitForURL ( "**/patient/vaccinations " , { timeout : 30000 } ) ;
105112
106113 const newTabPromise = page . context ( ) . waitForEvent ( "page" ) ;
107- await page . getByRole ( "link" , { name : "Check and book an RSV vaccination" } ) . click ( ) ;
114+
115+ await page . getByRole ( "link" , { name : "Check and book vaccinations" } ) . click ( ) ;
116+
108117 const newTabPage = await newTabPromise ;
109118
110119 await newTabPage . waitForURL ( user . vaccinationsHubUrl , { timeout : 60000 , waitUntil : "networkidle" } ) ;
0 commit comments