Skip to content

Commit

Permalink
Fix e2e tests on WC 7.7 (#7893)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarcosta99 authored Dec 15, 2023
1 parent 1dbd05e commit cc42940
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog/dev-fix-e2e-tests-on-wc-7-7
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Fix e2e tests on WC 7.7.


Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe( 'Shopper Multi-Currency widget', () => {
await setupTest();
await page.waitForSelector( '.widget select[name=currency]', {
visible: true,
timeout: 5000,
} );
await page.select( '.widget select[name=currency]', 'EUR' );
await expect( page.url() ).toContain(
Expand All @@ -105,6 +106,7 @@ describe( 'Shopper Multi-Currency widget', () => {
);
// Change it back to USD for the other tests.
await page.select( '.widget select[name=currency]', 'USD' );
await page.reload( { waitUntil: 'networkidle0' } );
} );
}
);
Expand Down Expand Up @@ -178,5 +180,6 @@ describe( 'Shopper Multi-Currency widget', () => {
'.widget select[name=currency]'
);
expect( currencySwitcher ).toBeNull();
await merchant.logout();
} );
} );
8 changes: 6 additions & 2 deletions tests/e2e/utils/flows.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,11 @@ export const merchantWCP = {
searchInput.type( 'switcher', { delay: 20 } );

await page.waitForSelector(
'button.components-button[role="option"]'
'button.components-button[role="option"]',
{
visible: true,
timeout: 5000,
}
);
await page.click( 'button.components-button[role="option"]' );
await page.waitFor( 2000 );
Expand All @@ -699,7 +703,7 @@ export const merchantWCP = {
await merchant.openNewOrder();
await page.click( 'button.add-line-item' );
await page.click( 'button.add-order-item' );
await page.click( 'select.wc-product-search' );
await page.click( 'select[name="item_id"]' );
await page.type(
'.select2-search--dropdown > input',
config.get( 'products.simple.name' ),
Expand Down

0 comments on commit cc42940

Please sign in to comment.