woocommerce-paypal-payments/tests/qa-legacy-ui/utils/frontend/product.ts
Misha Utkin 9f1445265d
Migrate tests for legacy UI
- Tests migration
- Tests correction
- Folder structure and file naming fixes
2025-04-30 06:48:12 +02:00

39 lines
697 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( {
merchant: tested.merchant,
payment: tested.payment,
} );
};
// Assertions
}