mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-28 03:09:16 +08:00
36 lines
640 B
TypeScript
36 lines
640 B
TypeScript
/**
|
|
* External dependencies
|
|
*/
|
|
import {
|
|
Product as ProductBase,
|
|
expect,
|
|
} from '@inpsyde/playwright-utils/build';
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
import { PayPalUI } from './paypal-ui';
|
|
|
|
export class Product extends ProductBase {
|
|
ppui: PayPalUI;
|
|
|
|
constructor( { page, ppui } ) {
|
|
super( { page } );
|
|
this.ppui = ppui;
|
|
}
|
|
|
|
// Locators
|
|
|
|
// Actions
|
|
|
|
addToCart = async ( productSlug: string ) => {
|
|
await this.visit( productSlug );
|
|
await this.addToCartButton().click();
|
|
};
|
|
|
|
makeOrder = async ( tested ) => {
|
|
await this.visit( tested.products[ 0 ].slug );
|
|
await this.ppui.makeClassicPayment( tested );
|
|
};
|
|
|
|
// Assertions
|
|
}
|