Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix selectors in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Mar 23, 2022
1 parent 85c1064 commit 118172f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"title": "Best Selling Products Block",
"pageContent": "<!-- wp:woocommerce/product-best-sellers /-->"
}
{"title":"Best Selling Products Block","pageContent":"<!-- wp:woocommerce/product-best-sellers /-->"}
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"title": "Featured Category Block",
"pageContent": "<!-- wp:woocommerce/featured-category /-->"
}
{"title":"Featured Category Block","pageContent":"<!-- wp:woocommerce/featured-category /-->"}
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"title": "Hand-picked Products Block",
"pageContent": "<!-- wp:woocommerce/handpicked-products /-->"
}
{"title":"Hand-picked Products Block","pageContent":"<!-- wp:woocommerce/handpicked-products /-->"}
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"title": "Newest Products Block",
"pageContent": "<!-- wp:woocommerce/product-new /-->"
}
{"title":"Newest Products Block","pageContent":"<!-- wp:woocommerce/product-new /-->"}
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"title": "Product Categories List Block",
"pageContent": "<!-- wp:woocommerce/product-categories /-->"
}
{"title":"Product Categories List Block","pageContent":"<!-- wp:woocommerce/product-categories /-->"}
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"title": "Top Rated Products Block",
"pageContent": "<!-- wp:woocommerce/product-top-rated /-->"
}
{"title":"Top Rated Products Block","pageContent":"<!-- wp:woocommerce/product-top-rated /-->"}
4 changes: 2 additions & 2 deletions tests/e2e/specs/backend/cart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ describe( `${ block.name } Block`, () => {
beforeEach( async () => {
await openDocumentSettingsSidebar();
await selectBlockByName(
'woocommerce/cart-order-summary-block'
'woocommerce/cart-order-summary-shipping-block'
);
} );

it( 'can toggle Shipping calculator', async () => {
const selector = `${ block.class } .wc-block-components-totals-shipping__change-address-button`;
const selector = ` .wc-block-components-totals-shipping__change-address-button`;
const toggleLabel = await findLabelWithText(
'Shipping calculator'
);
Expand Down
22 changes: 10 additions & 12 deletions tests/utils/taxes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,16 @@ export async function getTaxesFromCurrentPage(): Promise<
value: string;
} >
> {
return await page.$$eval(
'.wc-block-components-totals-taxes .wc-block-components-totals-item',
( nodes ) =>
nodes.map( ( node ) => {
const label = node.querySelector(
'.wc-block-components-totals-item__label'
)?.innerHTML;
const value = node.querySelector(
'.wc-block-components-totals-item__value'
)?.innerHTML;
return { label, value };
} )
return await page.$$eval( '.wc-block-components-totals-taxes', ( nodes ) =>
nodes.map( ( node ) => {
const label = node.querySelector(
'.wc-block-components-totals-item__label'
)?.innerHTML;
const value = node.querySelector(
'.wc-block-components-totals-item__value'
)?.innerHTML;
return { label, value };
} )
);
}

Expand Down

0 comments on commit 118172f

Please sign in to comment.