@@ -41,13 +41,21 @@ test.describe("Eligibility", () => {
4141 test ( "Not Eligible - InfoText action content" , async ( { page } ) => {
4242 await page . goto ( RSV_PAGE_URL ) ;
4343
44- const infoTextHeading = page . getByRole ( "heading" , {
45- level : 2 ,
46- name : elidCopyForEnvironment . user15 . infoTextHeading ,
47- } ) ;
48- const infoTextParagraph = page
49- . locator ( `h2:has-text("${ elidCopyForEnvironment . user15 . infoTextHeading } ") + p` )
50- . first ( ) ;
44+ let infoTextHeading , infoTextParagraph ;
45+
46+ if ( environment === "preprod" ) {
47+ infoTextHeading = page . getByRole ( "heading" , {
48+ level : 3 ,
49+ name : elidCopyForEnvironment . user15 . infoTextHeading ,
50+ } ) ;
51+ infoTextParagraph = page . locator ( `h3:has-text("${ elidCopyForEnvironment . user15 . infoTextHeading } ") + p` ) . first ( ) ;
52+ } else {
53+ infoTextHeading = page . getByRole ( "heading" , {
54+ level : 2 ,
55+ name : elidCopyForEnvironment . user15 . infoTextHeading ,
56+ } ) ;
57+ infoTextParagraph = page . locator ( `h2:has-text("${ elidCopyForEnvironment . user15 . infoTextHeading } ") + p` ) . first ( ) ;
58+ }
5159 const tagName = await infoTextParagraph . evaluate ( ( element ) => element . tagName ) ;
5260
5361 await expect ( infoTextHeading ) . toBeVisible ( ) ;
@@ -76,8 +84,14 @@ test.describe("Eligibility", () => {
7684 test ( "Actionable - InfoText action content" , async ( { page } ) => {
7785 await page . goto ( RSV_PAGE_URL ) ;
7886
79- const infoTextHeading = page . getByRole ( "heading" , { level : 2 , name : "Getting the vaccine" } ) ;
80- const infoTextParagraph = page . locator ( 'h2:has-text("Getting the vaccine") + p' ) . first ( ) ;
87+ let infoTextHeading , infoTextParagraph ;
88+ if ( environment === "preprod" ) {
89+ infoTextHeading = page . getByRole ( "heading" , { level : 3 , name : "Getting the vaccine" } ) ;
90+ infoTextParagraph = page . locator ( 'h3:has-text("Getting the vaccine") + p' ) . first ( ) ;
91+ } else {
92+ infoTextHeading = page . getByRole ( "heading" , { level : 2 , name : "Getting the vaccine" } ) ;
93+ infoTextParagraph = page . locator ( 'h2:has-text("Getting the vaccine") + p' ) . first ( ) ;
94+ }
8195 const tagName = await infoTextParagraph . evaluate ( ( element ) => element . tagName ) ;
8296
8397 await expect ( infoTextHeading ) . toBeVisible ( ) ;
@@ -114,7 +128,9 @@ test.describe("Eligibility", () => {
114128 await expect ( cardHeading ) . toBeVisible ( ) ;
115129 await expect ( cardHeading ) . toHaveClass ( "nhsuk-heading-m nhsuk-card__heading" ) ;
116130 await expect ( cardParagraph ) . toBeVisible ( ) ;
117- await expect ( cardParagraph ) . toHaveText ( elidCopyForEnvironment . user05 . cardParagraphText ) ;
131+ await expect ( cardParagraph ) . toHaveText (
132+ "To change or cancel your appointment, contact the provider you booked with." ,
133+ ) ;
118134 await expect ( cardParagraph ) . toHaveClass ( "nhsuk-card__description" ) ;
119135 } ) ;
120136 } ) ;
0 commit comments