Fixes for PCP v3.0.8

This commit is contained in:
Misha Utkin 2025-08-19 21:51:23 +02:00
parent 28cac62100
commit 7435029737
No known key found for this signature in database
GPG key ID: 0675AD83BAE10581
17 changed files with 302 additions and 233 deletions

View file

@ -15,7 +15,7 @@ export default defineConfig( {
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !! process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
retries: process.env.CI ? 2 : 1,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
@ -36,7 +36,7 @@ export default defineConfig( {
]
: [
[ 'list' ],
// [ 'html', { outputFolder: 'playwright-report' } ],
[ 'html', { outputFolder: 'playwright-report' } ],
[
'@inpsyde/playwright-utils/build/integration/jira/xray-reporter.js',
{

View file

@ -20,6 +20,7 @@ export const storeConfigClassic = {
export const storeConfigGermany = {
...storeConfigDefault,
settings: shopSettings.germany, // WC general settings
customer: customers.germany,
};

View file

@ -32,9 +32,10 @@ test.describe( 'Merchant Setup', () => {
await expect( connection.getHelpLink() ).toBeVisible();
await expect( connection.enablePayPalPaymentsCheckbox() ).toBeVisible();
await expect( connection.acceptCardsCheckbox() ).toBeVisible();
await expect(
connection.onboardPayUponInvoiceCheckbox()
).toBeVisible();
// // Only for german merchant:
// await expect(
// connection.onboardPayUponInvoiceCheckbox()
// ).toBeVisible();
await expect( connection.activatePayPalButton() ).toBeVisible();
await expect(
connection.testPaymentsWithPayPalSandboxButton()

View file

@ -31,8 +31,11 @@ test.describe( 'Pay Later', async () => {
} );
test.describe( 'Display on frontend', () => {
test.beforeAll( async ( { payLater } ) => {
test.beforeAll( async ( { payLater, standardPayments } ) => {
await payLater.setup( { enableGateway: true } );
await standardPayments.visit();
await standardPayments.disableAlternativePaymentMethods( [ 'Venmo' ] );
await standardPayments.saveChanges();
} );
test.beforeEach( async ( { utils } ) => {

View file

@ -40,6 +40,8 @@ test.describe( 'Frontend UI', () => {
await classicCheckout.selectShippingMethod(
tested.shipping.settings.title
);
await expect( classicCheckout.ppui.payPalGateway() ).toBeVisible();
await classicCheckout.ppui.payPalGateway().click();
await expect( classicCheckout.ppui.payPalButton() ).toBeVisible();
let payPalPopup = await classicCheckout.ppui.openPayPalPupup();
@ -329,10 +331,6 @@ test.describe( 'Frontend UI', () => {
await utils.advancedCardProcessing.setup( { enableGateway: true } );
await classicPayForOrder.visit( order.id, order.order_key );
await expect(
classicPayForOrder.ppui.payPalButton()
).toBeVisible();
await classicPayForOrder.ppui.acdcGateway().click();
await classicPayForOrder.ppui
.cardNumberInput()

View file

@ -69,7 +69,7 @@ export const payLaterClassicCheckoutIntentAuthorized = [
export const payLaterClassicCheckoutHorizontalButton = [
{
title: 'PCP-1200 | Transaction - Classic checkout - Pay Later - Horizontal button layout', // TODO: doesn`t make sense??
title: 'PCP-1200 | Transaction - Classic checkout - Pay Later - Horizontal button layout @Critical',
...orders.default,
payment: payLater,
},

View file

@ -22,6 +22,7 @@ const germanOrderData: WooCommerce.ShopOrder = {
export const payUponInvoiceClassicCheckoutGermany = [
{
// FAIL: PayPal order status Expected: "PENDING_APPROVAL", Received: "COMPLETED"
title: 'PCP-1216 | Transaction - Germany - Classic checkout - Pay upon Invoice - Default order @Critical',
...orders.default,
...germanOrderData,

View file

@ -9,6 +9,7 @@ import {
payUponInvoice,
pcpConfigGermany,
storeConfigClassic,
storeConfigGermany,
taxSettings,
} from '../../resources';
import {
@ -19,7 +20,10 @@ import { transactionsOnClassicCheckout } from './_test-scenarios';
test.beforeAll( async ( { utils } ) => {
test.setTimeout( 2 * 60 * 1000 );
await utils.configureStore( storeConfigClassic );
await utils.configureStore( {
...storeConfigGermany,
classicPages: true,
} );
await utils.configurePcp( pcpConfigGermany );
await utils.pcpPaymentMethodIsEnabled( payUponInvoice.method );
} );

View file

@ -68,7 +68,7 @@ import {
standardCardButtonClassicCheckoutIntentAuthorized,
} from './_test-data/standard-card-button';
test.beforeAll( async ( { utils } ) => {
test.beforeAll( async ( { utils, standardPayments } ) => {
test.setTimeout( 3 * 60 * 1000 );
await utils.configureStore( {
...storeConfigUsa,
@ -78,7 +78,9 @@ test.beforeAll( async ( { utils } ) => {
await utils.pcpPaymentMethodIsEnabled( payPal.method );
await utils.pcpPaymentMethodIsEnabled( payLater.method );
await utils.pcpPaymentMethodIsEnabled( acdc.method );
// await utils.pcpPaymentMethodIsEnabled( venmo.method );
await standardPayments.setup( {
disableAlternativePaymentMethods: [ 'Venmo' ],
} );
} );
transactionsOnClassicCart( payPalClassicCart );
@ -91,9 +93,21 @@ transactionsOnClassicCheckout( acdcClassicCheckout );
transactionsOnClassicProduct( payPalClassicProduct );
transactionsOnClassicProduct( payLaterClassicProduct );
// transactionsOnClassicCart( venmoClassicCartUsa );
// transactionsOnClassicCheckout( venmoClassicCheckoutUsa );
// transactionsOnClassicProduct( venmoClassicProductUsa );
// test.describe( 'Venmo', () => {
// test.beforeAll( async ( { utils } ) => {
// await utils.pcpPaymentMethodIsEnabled( venmo.method );
// } );
// transactionsOnClassicCart( venmoClassicCartUsa );
// transactionsOnClassicCheckout( venmoClassicCheckoutUsa );
// transactionsOnClassicProduct( venmoClassicProductUsa );
// test.afterAll( async ( { standardPayments } ) => {
// await standardPayments.setup( {
// disableAlternativePaymentMethods: [ 'Venmo' ],
// } );
// } );
// } );
test.describe( 'ACDC 3DS', () => {
test.beforeAll( async ( { utils } ) => {

View file

@ -46,13 +46,16 @@ import {
} from './_test-data/pay-later';
import { acdcPayByLink } from './_test-data/acdc';
test.beforeAll( async ( { utils } ) => {
test.beforeAll( async ( { utils, standardPayments } ) => {
test.setTimeout( 3 * 60 * 1000 );
await utils.configureStore( storeConfigUsa );
await utils.configurePcp( pcpConfigUsa );
await utils.pcpPaymentMethodIsEnabled( payPal.method );
await utils.pcpPaymentMethodIsEnabled( payLater.method );
await utils.pcpPaymentMethodIsEnabled( acdc.method );
await standardPayments.setup( {
disableAlternativePaymentMethods: [ 'Venmo' ],
} );
} );
transactionsOnCart( payPalCart );

View file

@ -52,10 +52,10 @@ export const testRefund = ( tests ) => {
).toBeVisible();
await expect(
wooCommerceOrderEdit.totalAmountAlreadyRefunded()
).toHaveText( `-${ formatMoney( 0 ) }` );
).toHaveText( `-${ formatMoney( 0, tested.currency ) }` );
await expect(
wooCommerceOrderEdit.totalAvailableToRefund()
).toHaveText( formatMoney( Number( refundAvailable ) ) );
).toHaveText( formatMoney( Number( refundAvailable ), tested.currency ) );
await wooCommerceOrderEdit.makePayPalRefund( refundAmount );
await wooCommerceOrderEdit.assertUrl( order.id );
@ -63,7 +63,7 @@ export const testRefund = ( tests ) => {
wooCommerceOrderEdit.refundNumber()
).toContainText( `Refund #` );
await expect( wooCommerceOrderEdit.refundAmount() ).toHaveText(
`-${ formatMoney( Number( refundAmount ) ) }`
`-${ formatMoney( Number( refundAmount ), tested.currency ) }`
);
order = await wooCommerceApi.getOrder( order.id );
@ -121,6 +121,7 @@ export const testRefund = ( tests ) => {
payPalPayment.seller_receivable_breakdown.paypal_fee
.value
),
currency: tested.currency,
} );
}
);

View file

@ -1,227 +1,227 @@
/**
* Internal dependencies
*/
import { test as setup } from '../../utils';
import {
shopSettings,
shippingZones,
taxSettings,
products,
coupons,
customers,
wpDebuggingPlugin,
disableNoncePlugin,
subscriptionsPlugin,
disableWcSetupWizard,
disableNewUi,
} from '../../resources';
/**
* External dependencies
*/
import { updateDotenv } from '@inpsyde/playwright-utils/build';
// /**
// * Internal dependencies
// */
// import { test as setup } from '../../utils';
// import {
// shopSettings,
// shippingZones,
// taxSettings,
// products,
// coupons,
// customers,
// wpDebuggingPlugin,
// disableNoncePlugin,
// subscriptionsPlugin,
// disableWcSetupWizard,
// disableNewUi,
// } from '../../resources';
// /**
// * External dependencies
// */
// import { updateDotenv } from '@inpsyde/playwright-utils/build';
setup( 'Setup Permalinks', async ( { requestUtils } ) => {
await requestUtils.setPermalinks( '/%postname%/' );
} );
// setup( 'Setup Permalinks', async ( { requestUtils } ) => {
// await requestUtils.setPermalinks( '/%postname%/' );
// } );
setup(
'Setup Disable Nonce plugin (active)',
async ( { requestUtils, plugins } ) => {
if (
! ( await requestUtils.isPluginInstalled(
disableNoncePlugin.slug
) )
) {
await plugins.installPluginFromFile(
disableNoncePlugin.zipFilePath
);
}
await requestUtils.activatePlugin( disableNoncePlugin.slug );
}
);
// setup(
// 'Setup Disable Nonce plugin (active)',
// async ( { requestUtils, plugins } ) => {
// if (
// ! ( await requestUtils.isPluginInstalled(
// disableNoncePlugin.slug
// ) )
// ) {
// await plugins.installPluginFromFile(
// disableNoncePlugin.zipFilePath
// );
// }
// await requestUtils.activatePlugin( disableNoncePlugin.slug );
// }
// );
setup( 'Setup WP Debugging plugin (active)', async ( { requestUtils } ) => {
if (
! ( await requestUtils.isPluginInstalled( wpDebuggingPlugin.slug ) )
) {
await requestUtils.installPlugin( wpDebuggingPlugin.slug );
}
await requestUtils.deactivatePlugin( wpDebuggingPlugin.slug );
} );
// setup( 'Setup WP Debugging plugin (active)', async ( { requestUtils } ) => {
// if (
// ! ( await requestUtils.isPluginInstalled( wpDebuggingPlugin.slug ) )
// ) {
// await requestUtils.installPlugin( wpDebuggingPlugin.slug );
// }
// await requestUtils.deactivatePlugin( wpDebuggingPlugin.slug );
// } );
setup(
'Setup Disable WooCommerce Setup Wizard Plugin (active)',
async ( { requestUtils, plugins } ) => {
if (
! ( await requestUtils.isPluginInstalled(
disableWcSetupWizard.slug
) )
) {
await plugins.installPluginFromFile(
disableWcSetupWizard.zipFilePath
);
}
await requestUtils.activatePlugin( disableWcSetupWizard.slug );
}
);
// setup(
// 'Setup Disable WooCommerce Setup Wizard Plugin (active)',
// async ( { requestUtils, plugins } ) => {
// if (
// ! ( await requestUtils.isPluginInstalled(
// disableWcSetupWizard.slug
// ) )
// ) {
// await plugins.installPluginFromFile(
// disableWcSetupWizard.zipFilePath
// );
// }
// await requestUtils.activatePlugin( disableWcSetupWizard.slug );
// }
// );
setup( 'Setup WooCommerce plugin (active)', async ( { requestUtils } ) => {
if ( ! ( await requestUtils.isPluginInstalled( 'woocommerce' ) ) ) {
await requestUtils.installPlugin( 'woocommerce' );
}
await requestUtils.activatePlugin( 'woocommerce' );
} );
// setup( 'Setup WooCommerce plugin (active)', async ( { requestUtils } ) => {
// if ( ! ( await requestUtils.isPluginInstalled( 'woocommerce' ) ) ) {
// await requestUtils.installPlugin( 'woocommerce' );
// }
// await requestUtils.activatePlugin( 'woocommerce' );
// } );
setup(
'Setup WC Subscriptions plugin (inactive)',
async ( { requestUtils, plugins } ) => {
if (
! ( await requestUtils.isPluginInstalled(
subscriptionsPlugin.slug
) )
) {
await plugins.installPluginFromFile(
subscriptionsPlugin.zipFilePath
);
}
await requestUtils.deactivatePlugin( subscriptionsPlugin.slug );
}
);
// setup(
// 'Setup WC Subscriptions plugin (inactive)',
// async ( { requestUtils, plugins } ) => {
// if (
// ! ( await requestUtils.isPluginInstalled(
// subscriptionsPlugin.slug
// ) )
// ) {
// await plugins.installPluginFromFile(
// subscriptionsPlugin.zipFilePath
// );
// }
// await requestUtils.deactivatePlugin( subscriptionsPlugin.slug );
// }
// );
setup( 'Setup theme', async ( { requestUtils } ) => {
const slug = 'storefront';
if ( ! ( await requestUtils.isThemeInstalled( slug ) ) ) {
await requestUtils.installTheme( slug );
}
await requestUtils.activateTheme( slug );
} );
// setup( 'Setup theme', async ( { requestUtils } ) => {
// const slug = 'storefront';
// if ( ! ( await requestUtils.isThemeInstalled( slug ) ) ) {
// await requestUtils.installTheme( slug );
// }
// await requestUtils.activateTheme( slug );
// } );
setup(
'Setup WooCommerce Live site visibility',
async ( { wooCommerceUtils } ) => {
await wooCommerceUtils.setSiteVisibility();
}
);
// setup(
// 'Setup WooCommerce Live site visibility',
// async ( { wooCommerceUtils } ) => {
// await wooCommerceUtils.setSiteVisibility();
// }
// );
setup( 'Setup WooCommerce API keys', async ( { wooCommerceUtils } ) => {
if ( ! ( await wooCommerceUtils.apiKeysExist() ) ) {
const apiKeys = await wooCommerceUtils.createApiKeys();
if ( ! process.env.CI ) {
await updateDotenv( './.env', apiKeys );
}
for ( const [ key, value ] of Object.entries( apiKeys ) ) {
process.env[ key ] = value;
}
}
} );
// setup( 'Setup WooCommerce API keys', async ( { wooCommerceUtils } ) => {
// if ( ! ( await wooCommerceUtils.apiKeysExist() ) ) {
// const apiKeys = await wooCommerceUtils.createApiKeys();
// if ( ! process.env.CI ) {
// await updateDotenv( './.env', apiKeys );
// }
// for ( const [ key, value ] of Object.entries( apiKeys ) ) {
// process.env[ key ] = value;
// }
// }
// } );
setup( 'Setup Block and Classic pages', async ( { wooCommerceUtils } ) => {
await wooCommerceUtils.publishBlockCartPage();
await wooCommerceUtils.publishBlockCheckoutPage();
await wooCommerceUtils.publishClassicCartPage();
await wooCommerceUtils.publishClassicCheckoutPage();
} );
// setup( 'Setup Block and Classic pages', async ( { wooCommerceUtils } ) => {
// await wooCommerceUtils.publishBlockCartPage();
// await wooCommerceUtils.publishBlockCheckoutPage();
// await wooCommerceUtils.publishClassicCartPage();
// await wooCommerceUtils.publishClassicCheckoutPage();
// } );
setup( 'Setup WooCommerce email settings', async ( { wooCommerceApi } ) => {
const disabled = { enabled: 'no' };
await wooCommerceApi.updateEmailSubSettings( 'email_new_order', disabled );
await wooCommerceApi.updateEmailSubSettings(
'email_cancelled_order',
disabled
);
await wooCommerceApi.updateEmailSubSettings(
'email_failed_order',
disabled
);
await wooCommerceApi.updateEmailSubSettings(
'email_customer_on_hold_order',
disabled
);
await wooCommerceApi.updateEmailSubSettings(
'email_customer_processing_order',
disabled
);
await wooCommerceApi.updateEmailSubSettings(
'email_customer_completed_order',
disabled
);
await wooCommerceApi.updateEmailSubSettings(
'email_customer_refunded_order',
disabled
);
await wooCommerceApi.updateEmailSubSettings(
'email_customer_note',
disabled
);
await wooCommerceApi.updateEmailSubSettings(
'email_customer_reset_password',
disabled
);
await wooCommerceApi.updateEmailSubSettings(
'email_customer_new_account',
disabled
);
} );
// setup( 'Setup WooCommerce email settings', async ( { wooCommerceApi } ) => {
// const disabled = { enabled: 'no' };
// await wooCommerceApi.updateEmailSubSettings( 'email_new_order', disabled );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_cancelled_order',
// disabled
// );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_failed_order',
// disabled
// );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_customer_on_hold_order',
// disabled
// );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_customer_processing_order',
// disabled
// );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_customer_completed_order',
// disabled
// );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_customer_refunded_order',
// disabled
// );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_customer_note',
// disabled
// );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_customer_reset_password',
// disabled
// );
// await wooCommerceApi.updateEmailSubSettings(
// 'email_customer_new_account',
// disabled
// );
// } );
setup( 'Setup WooCommerce general settings', async ( { wooCommerceApi } ) => {
await wooCommerceApi.updateGeneralSettings( shopSettings.germany.general );
} );
// setup( 'Setup WooCommerce general settings', async ( { wooCommerceApi } ) => {
// await wooCommerceApi.updateGeneralSettings( shopSettings.germany.general );
// } );
setup( 'Setup WooCommerce shipping', async ( { wooCommerceUtils } ) => {
await wooCommerceUtils.configureShippingZone( shippingZones.worldwide );
} );
// setup( 'Setup WooCommerce shipping', async ( { wooCommerceUtils } ) => {
// await wooCommerceUtils.configureShippingZone( shippingZones.worldwide );
// } );
setup( 'Setup WooCommerce taxes (included)', async ( { wooCommerceUtils } ) => {
await wooCommerceUtils.setTaxes( taxSettings.including );
} );
// setup( 'Setup WooCommerce taxes (included)', async ( { wooCommerceUtils } ) => {
// await wooCommerceUtils.setTaxes( taxSettings.including );
// } );
setup( 'Setup Registered Customer', async ( { wooCommerceUtils } ) => {
await wooCommerceUtils.createCustomer( customers.germany );
} );
// setup( 'Setup Registered Customer', async ( { wooCommerceUtils } ) => {
// await wooCommerceUtils.createCustomer( customers.germany );
// } );
setup( 'Setup Delete Previous Orders', async ( { wooCommerceApi } ) => {
await wooCommerceApi.deleteAllOrders();
} );
// setup( 'Setup Delete Previous Orders', async ( { wooCommerceApi } ) => {
// await wooCommerceApi.deleteAllOrders();
// } );
setup( 'Setup coupons', async ( { wooCommerceUtils } ) => {
// create test coupons
const couponItems = {};
const couponEntries = Object.entries( coupons );
await Promise.all(
couponEntries.map( async ( [ key, coupon ] ) => {
const createdCoupon = await wooCommerceUtils.createCoupon( coupon );
couponItems[ coupon.code ] = { id: createdCoupon.id };
} )
);
// store created coupons as CART_ITEMS env var
process.env.COUPONS = JSON.stringify( couponItems );
} );
// setup( 'Setup coupons', async ( { wooCommerceUtils } ) => {
// // create test coupons
// const couponItems = {};
// const couponEntries = Object.entries( coupons );
// await Promise.all(
// couponEntries.map( async ( [ key, coupon ] ) => {
// const createdCoupon = await wooCommerceUtils.createCoupon( coupon );
// couponItems[ coupon.code ] = { id: createdCoupon.id };
// } )
// );
// // store created coupons as CART_ITEMS env var
// process.env.COUPONS = JSON.stringify( couponItems );
// } );
setup( 'Setup products', async ( { wooCommerceUtils } ) => {
// create test products
const cartItems = {};
const productEntries = Object.entries( products );
await Promise.all(
productEntries.map( async ( [ key, product ] ) => {
// check if not subscription product - requires Supscriptions plugin
if ( ! product.slug.includes( 'subscription' ) ) {
const createdProduct = await wooCommerceUtils.createProduct(
product
);
cartItems[ product.slug ] = { id: createdProduct.id };
}
} )
);
// store created products as CART_ITEMS env var
process.env.PRODUCTS = JSON.stringify( cartItems );
} );
// setup( 'Setup products', async ( { wooCommerceUtils } ) => {
// // create test products
// const cartItems = {};
// const productEntries = Object.entries( products );
// await Promise.all(
// productEntries.map( async ( [ key, product ] ) => {
// // check if not subscription product - requires Supscriptions plugin
// if ( ! product.slug.includes( 'subscription' ) ) {
// const createdProduct = await wooCommerceUtils.createProduct(
// product
// );
// cartItems[ product.slug ] = { id: createdProduct.id };
// }
// } )
// );
// // store created products as CART_ITEMS env var
// process.env.PRODUCTS = JSON.stringify( cartItems );
// } );
setup(
'Setup Disable new UI plugin (active)',
async ( { requestUtils, plugins } ) => {
if ( ! ( await requestUtils.isPluginInstalled( disableNewUi.slug ) ) ) {
await plugins.installPluginFromFile( disableNewUi.zipFilePath );
}
await requestUtils.activatePlugin( disableNewUi.slug );
}
);
// setup(
// 'Setup Disable new UI plugin (active)',
// async ( { requestUtils, plugins } ) => {
// if ( ! ( await requestUtils.isPluginInstalled( disableNewUi.slug ) ) ) {
// await plugins.installPluginFromFile( disableNewUi.zipFilePath );
// }
// await requestUtils.activatePlugin( disableNewUi.slug );
// }
// );

View file

@ -157,6 +157,7 @@ export class Connection extends PcpSettingsPage {
}
await this.toggleToManualCredentialInputButton().click();
await this.page.waitForTimeout( 500 );
await this.sandboxCheckbox().check();
await this.sandboxEmailAddressInput().fill( merchant.email );
await this.sandboxMerchantIdInput().fill( merchant.account_id );

View file

@ -347,6 +347,18 @@ export class StandardPayments extends PcpSettingsPage {
await this.sendCheckoutBillingDataCombobox().click();
await this.dropdownOption( data.sendCheckoutBillingData ).click();
}
if ( data.disableAlternativePaymentMethods?.length ) {
await this.disableAlternativePaymentMethods(
data.disableAlternativePaymentMethods
);
}
if ( data.enableAlternativePaymentMethods?.length ) {
await this.enableAlternativePaymentMethods(
data.enableAlternativePaymentMethods
);
}
// Add other settings here
await this.saveChanges();

View file

@ -29,8 +29,9 @@ export class Cart extends CartBase {
}
}
// Is blocked for block cart by WooCommerce
// Select shipping or initial shipment (for subscriptions) option:
await this.selectShippingMethod( tested.shipping.settings.title );
// await this.selectShippingMethod( tested.shipping.settings.title );
// Make payment with tested method
await this.ppui.makePayment( {

View file

@ -412,11 +412,14 @@ export class PayPalUI {
let popup: PayPalPopup;
switch ( data.payment.method ) {
case 'PayPal':
if( await this.payPalGateway().isVisible() ) {
await this.payPalGateway().click();
}
// pay with vaulted account
if ( data.payment.isVaulted ) {
await this.completePayPalVaultedPayment(
data.payment.payPalAccount
);
await expect( this.payPalButton() ).toBeVisible();
await this.assertVaultedPaymentMethodIsDisplayed( data.payment );
await this.payPalButton().click();
break;
}
// pay with account other than vaulted
@ -433,6 +436,9 @@ export class PayPalUI {
break;
case 'PayLater':
if( await this.payPalGateway().isVisible() ) {
await this.payPalGateway().click();
}
popup = await this.openPayLaterPopup();
await popup.completePayLaterPayment(
data.payment.payPalAccount
@ -804,6 +810,26 @@ export class PayPalUI {
// Assertions
/**
* Asserts the saved payment method is visible
*
* @param payment
*/
assertVaultedPaymentMethodIsDisplayed = async ( payment ) => {
switch ( payment.gateway.shortcut ) {
case 'paypal':
// await expect( this.payPalButton() ).toContainText( 'Pay Now' );
await expect( this.payPalButtonMoreOptions() ).toBeVisible();
break;
// case 'acdc':
// await expect(
// this.acdcSavedCard( payment.card )
// ).toBeVisible();
// break;
}
};
assertPayPalButtonVisibility = async ( isVisible: boolean ) => {
await expect( this.payPalButton() ).toBeVisible( {
visible: isVisible,

View file

@ -241,6 +241,9 @@ export class Utils {
case 'Venmo':
await this.activateWpDebuggingPlugin();
await this.standardPayments.setup( {
enableAlternativePaymentMethods: [ 'Venmo' ],
} );
break;
case 'ACDC':