woocommerce-paypal-payments/tests/qa/utils/frontend/product.ts
Sedat a956444602
Initial commit for QA folder
POM files created.
Visual tests moved to PCP repo.
Irrelevant files removed.
2025-02-05 16:40:30 +03: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
}