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

Commit

Permalink
Filter Products by Price test: wait for submit button to appear befor…
Browse files Browse the repository at this point in the history
…e saving the post (II)
  • Loading branch information
Aljullu committed Mar 31, 2023
1 parent c74ee4b commit 6e78a9b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/e2e/specs/shopper/filter-products-by-price.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const block = {
queryProductsList: '.wp-block-post-template > li',
classicProductsList: '.products.columns-3 > li',
submitButton: '.wc-block-components-filter-submit-button',
XPathSubmitButton:
"//button[contains(@class,'wc-block-components-filter-submit-button')]",
},
},
urlSearchParamWhenFilterIsApplied: '?max_price=2',
Expand Down Expand Up @@ -197,6 +199,9 @@ describe( `${ block.name } Block`, () => {
block.selectors.editor.filterButtonToggle
);
await filterButtonToggle.click();

await page.waitForXPath( selectors.frontend.XPathSubmitButton );

await saveTemplate();
await goToShopPage();

Expand Down Expand Up @@ -309,7 +314,7 @@ describe( `${ block.name } Block`, () => {
);
await filterButtonToggle.click();

await page.waitForXPath( selectors.frontend.submitButton );
await page.waitForXPath( selectors.frontend.XPathSubmitButton );

await saveOrPublish();
await page.goto( frontedPageUrl );
Expand Down

0 comments on commit 6e78a9b

Please sign in to comment.