mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-04-27 01:22:18 +08:00
40 lines
977 B
TypeScript
40 lines
977 B
TypeScript
/**
|
|
* External dependencies
|
|
*/
|
|
import {
|
|
WooCommerceSubscriptionEdit as WooCommerceSubscriptionEditBase,
|
|
expect,
|
|
} from '@inpsyde/playwright-utils/build';
|
|
|
|
export class WooCommerceSubscriptionEdit extends WooCommerceSubscriptionEditBase {
|
|
// Locators
|
|
transactionIdKey = () =>
|
|
this.page.locator(
|
|
'input[value="ppcp_previous_transaction_reference"]'
|
|
);
|
|
transactionIdRow = () =>
|
|
this.page.locator( '#the-list tr', { has: this.transactionIdKey() } );
|
|
transactionIdTextarea = () => this.transactionIdRow().getByLabel( 'Value' );
|
|
|
|
// Actions
|
|
|
|
// Assertions
|
|
|
|
/**
|
|
* Asserts data on subscription page
|
|
*
|
|
* @param subscriptionId
|
|
* @param data
|
|
*/
|
|
assertSubscriptionDetails = async ( data ) => {
|
|
const statusLabels = {
|
|
active: 'Active',
|
|
};
|
|
const status = statusLabels[ data.subscription.status ];
|
|
|
|
await expect( this.customerCombobox() ).toContainText(
|
|
data.customer.email
|
|
);
|
|
await expect( this.statusCombobox() ).toHaveText( status );
|
|
};
|
|
}
|