DigitalConsumer.ISS/playwright-tests/pages/AfterpayPage.ts
2026-03-02 11:35:37 -05:00

32 lines
No EOL
1,010 B
TypeScript

import { Locator, Page } from "@playwright/test";
import { BasePage } from "./BasePage";
import { IPaymentDetails } from "@business-logic/types/CustomerDetails";
export class AfterpayPage extends BasePage {
readonly page: Page;
readonly passwordTextBox: Locator;
readonly submitButton: Locator;
readonly confirmButton: Locator;
constructor(page: Page) {
super(page);
this.page = page;
this.passwordTextBox = page.getByTestId('login-password-input');
this.submitButton = page.getByRole('button', { name: 'Continue' });
this.confirmButton = page.getByRole('button', { name: 'Confirm' });
}
async login(password: string) {
await this.passwordTextBox.click();
await this.passwordTextBox.fill(password);
await this.submitButton.click();
}
async executeAfterpayPayment(paymentDetails: IPaymentDetails) {
await this.login(paymentDetails.password!);
await this.confirmButton.click();
}
}