woocommerce-paypal-payments/tests/qa/utils/frontend/apm-hosted-checkout.ts
2026-07-15 12:57:35 +02:00

30 lines
640 B
TypeScript

/**
* External dependencies
*/
import { expect, Page } from '@playwright/test';
export class ApmHostedCheckout {
page: Page;
url = 'https://www.sandbox.paypal.com/apmsim/';
constructor( page: Page ) {
this.page = page;
}
// Locators
testSuccessfulPaymentButton = () =>
this.page.getByRole( 'button', { name: 'Test Successful Payment' } );
testExpiredPaymentButton = () =>
this.page.getByRole( 'button', { name: 'Test Expired Payment' } );
// Actions
// Assertions
assertUrl = async () => {
await expect(
this.page,
'Assert APM hosted checkout page URL'
).toHaveURL( new RegExp( `^${ this.url }` ) );
};
}