mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Visual test- Enable manually connection
Visual test for enabling manual connection added
This commit is contained in:
parent
66d38f6f28
commit
ce14200370
3 changed files with 34 additions and 8 deletions
|
@ -36,20 +36,24 @@ export class PcpOnboarding extends PcpAdminPage {
|
|||
this.page.locator( 'input[type="checkbox"][value="physical"]' );
|
||||
|
||||
enableOptionalPaymentMethodsRadio = () =>
|
||||
this.page.locator(
|
||||
'input.ppcp-r__radio-value[value="true"]'
|
||||
);
|
||||
this.page.locator( 'input.ppcp-r__radio-value[value="true"]' );
|
||||
disableOptionalPaymentMethodsRadio = () =>
|
||||
this.page.locator(
|
||||
'input.ppcp-r__radio-value[value="false"]'
|
||||
);
|
||||
this.page.locator( 'input.ppcp-r__radio-value[value="false"]' );
|
||||
|
||||
connectToPayPalButton = () =>
|
||||
this.page.getByRole( 'button', { name: 'Connect to PayPal' } );
|
||||
|
||||
enableManuallyConnectLabel = () =>
|
||||
this.page.getByText( 'Manually Connect' );
|
||||
|
||||
enableManuallyConnectToggle = () =>
|
||||
this.page.locator( '.components-form-toggle' ).nth( 1 );
|
||||
|
||||
// Actions
|
||||
isCurrentStep = async ( title: Pcp.Admin.Onboarding.StepTitle ) => {
|
||||
await this.page.waitForFunction(() => !!document.querySelector('button.is-title'));
|
||||
await this.page.waitForFunction(
|
||||
() => !! document.querySelector( 'button.is-title' )
|
||||
);
|
||||
return await this.pageTitle( String( title ) ).isVisible();
|
||||
};
|
||||
|
||||
|
@ -75,5 +79,15 @@ export class PcpOnboarding extends PcpAdminPage {
|
|||
}
|
||||
};
|
||||
|
||||
disableManuallyConnect = async () => {
|
||||
const isChecked = await this.enableManuallyConnectToggle().getAttribute(
|
||||
'class'
|
||||
);
|
||||
const isToggleChecked = isChecked.includes( 'is-checked' );
|
||||
if ( isToggleChecked ) {
|
||||
await this.enableManuallyConnectLabel().click();
|
||||
}
|
||||
};
|
||||
|
||||
// Assertions
|
||||
}
|
||||
|
|
|
@ -489,7 +489,9 @@ export class PayPalUI {
|
|||
openPayPalPupup = async ( dataFundingSource: string = 'paypal' ) => {
|
||||
const popupPromise = this.page.waitForEvent( 'popup' );
|
||||
|
||||
await expect( this.fundingSourceButton( dataFundingSource ) ).toBeVisible();
|
||||
await expect(
|
||||
this.fundingSourceButton( dataFundingSource )
|
||||
).toBeVisible();
|
||||
await this.fundingSourceButton( dataFundingSource ).click();
|
||||
|
||||
const popup = await popupPromise;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue