Skip to content

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
chihsuan committed Mar 15, 2023
1 parent e453c90 commit 218e45d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 4 additions & 0 deletions packages/js/admin-e2e-tests/changelog/remove-wcpay-accordion
@@ -0,0 +1,4 @@
Significance: patch
Type: update

Update showOtherPaymentMethods() to test latest payment task properly
6 changes: 0 additions & 6 deletions packages/js/admin-e2e-tests/src/pages/PaymentsSetup.ts
Expand Up @@ -31,12 +31,6 @@ export class PaymentsSetup extends BasePage {
}

async showOtherPaymentMethods(): Promise< void > {
const selector = '.woocommerce-task-payments button.toggle-button';
await this.page.waitForSelector( selector );
const toggleButton = await this.page.$(
`${ selector }[aria-expanded=false]`
);
await toggleButton?.click();
await waitForElementByText( 'h2', 'Offline payment methods' );
}

Expand Down
Expand Up @@ -113,9 +113,6 @@ test.describe( 'Payment setup task', () => {
.catch( () => {} );
await page.waitForLoadState( 'networkidle' );

// purposely no await again
page.click( 'button.toggle-button' );

// enable COD payment option
await page.click(
'div.woocommerce-task-payment-cod > div.woocommerce-task-payment__footer > button'
Expand Down

0 comments on commit 218e45d

Please sign in to comment.