mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-07-30 02:17:46 +08:00
30 lines
640 B
TypeScript
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 }` ) );
|
|
};
|
|
}
|