Handle new paypal payment flow

This commit is contained in:
maguire-arman 2025-05-29 15:02:26 -04:00
parent 05e5060a5a
commit 4e8c24d08b

View file

@ -11,6 +11,7 @@ export class PaypalPage extends BasePage {
readonly passwordTextBox: Locator;
readonly paypalLoginButton: Locator;
readonly completePurchaseButton: Locator;
readonly payWithRadioButton: Locator;
readonly payButton: Locator;
constructor(page: Page) {
@ -23,6 +24,7 @@ export class PaypalPage extends BasePage {
this.passwordTextBox = page.getByPlaceholder('Password');
this.paypalLoginButton = page.getByRole('button', { name: 'Log In', exact: true });
this.completePurchaseButton = page.getByTestId('submit-button-initial')
this.payWithRadioButton = page.locator('.py-4').first();
this.payButton = page.getByRole('button', { name: 'Pay $' });
}
@ -42,6 +44,7 @@ export class PaypalPage extends BasePage {
await this.usePasswordInsteadButton.click();
await this.passwordTextBox.fill(paymentDetails.password!);
await this.paypalLoginButton.click();
await this.payWithRadioButton.click();
await this.payButton.click();
}
}