From 62bae320ea6089834f45ae711b4e08151b03f52c Mon Sep 17 00:00:00 2001 From: JennyNou Date: Mon, 15 Sep 2025 10:23:08 -0400 Subject: [PATCH] Added locator and logic for sms opt in box on contact details page --- playwright-tests/pages/ContactDetailsPage.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/playwright-tests/pages/ContactDetailsPage.ts b/playwright-tests/pages/ContactDetailsPage.ts index 543ffe1b2..171166190 100644 --- a/playwright-tests/pages/ContactDetailsPage.ts +++ b/playwright-tests/pages/ContactDetailsPage.ts @@ -14,7 +14,7 @@ export class ContactDetailsPage extends BasePage { readonly lastNameTextBox: Locator; readonly emailAddressTextBox: Locator; readonly phoneNumberTextBox: Locator; - readonly notesTextBox: Locator; + readonly textOptInBox: Locator; constructor(page: Page) { super(page); @@ -25,7 +25,7 @@ export class ContactDetailsPage extends BasePage { this.lastNameTextBox = this.page.getByRole('textbox', { name: 'Last name' }); this.emailAddressTextBox = this.page.getByRole('textbox', { name: 'Email address' }); this.phoneNumberTextBox = this.page.getByRole('textbox', { name: 'Phone number' }); - this.notesTextBox = this.page.getByRole('textbox', { name: 'Notes' }); + this.textOptInBox = this.page.getByRole('checkbox', { name: 'Text me updates about my appointment*' }); } @@ -36,10 +36,8 @@ export class ContactDetailsPage extends BasePage { await this.phoneNumberTextBox.fill(customerDetails.phoneNumber); } - async fillNotes(notes?: string) { - if (notes) { - await this.notesTextBox.fill(notes); - } + async checkTextMeUpdates(customerDetails: ICustomerDetails) { + await this.textOptInBox.check(); } @step("ContactDetailsPage >> Enter contact details: ") @@ -48,6 +46,11 @@ export class ContactDetailsPage extends BasePage { await this.validateProgressBar(ProgressBarPercentages.ContactDetailsPage); await this.enterContactDetails(customerDetails!); + + if (testData.isOptedInForTextMessages) { + await this.checkTextMeUpdates(customerDetails!); + } + await this.nextPage(); } } \ No newline at end of file