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