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

Add e2e tests for attributes count #9500

Merged
merged 10 commits into from
Jun 1, 2023
Merged

Conversation

roykho
Copy link
Member

@roykho roykho commented May 17, 2023

Closes #8873

This does not cover all the tests required from above mentioned issue. It is a starter to gauge if we're going in the right direction as Playwright was just recently added. Open to any suggestions if there are better approaches.

Note that I had to use some hacky solution to get around the generation of the attributes lookup table.

Tests covered:

  • Only one attribute filter
  • Two different attribute filters
  • One attribute filter used alongside the price filter

Testing

Automated Tests

  • Changes in this PR are covered by Automated Tests.
    • Unit tests
    • E2E tests

User Facing Testing

  1. npm run env:start
  2. npx playwright install
  3. npm run test:e2e-pw ./tests/e2e-pw/tests/attributes-filter/filter-products-by-attributes-count.block_theme.spec.ts
  4. Ensure the tests passes.
  • Do not include in the Testing Notes

WooCommerce Visibility

  • WooCommerce Core
  • Feature plugin
  • Experimental

Performance Impact

Changelog

Add e2e tests for attributes count

@roykho roykho added skip-changelog PRs that you don't want to appear in the changelog. category: tests labels May 17, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2023

The release ZIP for this PR is accessible via:

https://wcblocks.wpcomstaging.com/wp-content/uploads/woocommerce-gutenberg-products-block-9500.zip

Script Dependencies Report

There is no changed script dependency between this branch and trunk.

This comment was automatically generated by the ./github/compare-assets action.

TypeScript Errors Report

  • Files with errors: 467
  • Total errors: 2254

🎉 🎉 This PR does not introduce new TS errors.

comments-aggregator

@roykho roykho force-pushed the add/e2e-tests-attributes-count branch from 7acd251 to 7f4e47f Compare May 17, 2023 20:29
@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2023

Size Change: +8.65 kB (+1%)

Total Size: 1.1 MB

Filename Size Change
build/active-filters-frontend.js 8.65 kB +76 B (+1%)
build/active-filters-wrapper-frontend.js 7.61 kB -13 B (0%)
build/active-filters.js 7.47 kB -2 B (0%)
build/all-products-frontend.js 12 kB +54 B (0%)
build/all-products.js 40 kB +88 B (0%)
build/all-reviews.js 7.85 kB +81 B (+1%)
build/attribute-filter-wrapper--stock-filter-wrapper-frontend.js 4.04 kB -12 B (0%)
build/attribute-filter-wrapper-frontend.js 4.29 kB +2 B (0%)
build/attribute-filter.js 13.2 kB +51 B (0%)
build/blocks-checkout.js 35.1 kB +7 B (0%)
build/breadcrumbs.js 2.13 kB +87 B (+4%)
build/cart-blocks/cart-cross-sells-frontend.js 254 B +1 B (0%)
build/cart-blocks/cart-cross-sells-products--product-price-frontend.js 2.92 kB -18 B (-1%)
build/cart-blocks/cart-cross-sells-products-frontend.js 3.71 kB +5 B (0%)
build/cart-blocks/cart-express-payment--checkout-blocks/express-payment-frontend.js 5.17 kB +5 B (0%)
build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js 5.51 kB +5 B (0%)
build/cart-blocks/order-summary-discount-frontend.js 2.13 kB +1 B (0%)
build/cart-blocks/order-summary-fee-frontend.js 273 B +1 B (0%)
build/cart-blocks/order-summary-shipping-frontend.js 17.1 kB +6 B (0%)
build/cart-blocks/order-summary-subtotal-frontend.js 274 B +1 B (0%)
build/cart-blocks/order-summary-taxes-frontend.js 435 B +1 B (0%)
build/cart-blocks/proceed-to-checkout-frontend.js 1.38 kB +2 B (0%)
build/cart-frontend.js 29.9 kB +36 B (0%)
build/cart.js 45.1 kB +7 B (0%)
build/catalog-sorting.js 1.7 kB +3 B (0%)
build/checkout-blocks/actions-frontend.js 1.85 kB -2 B (0%)
build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js 4.7 kB -1 B (0%)
build/checkout-blocks/billing-address-frontend.js 1.19 kB +3 B (0%)
build/checkout-blocks/express-payment-frontend.js 1.14 kB +2 B (0%)
build/checkout-blocks/order-summary-cart-items-frontend.js 3.68 kB -1 B (0%)
build/checkout-blocks/order-summary-discount-frontend.js 2.29 kB +1 B (0%)
build/checkout-blocks/order-summary-fee-frontend.js 277 B +2 B (+1%)
build/checkout-blocks/order-summary-frontend.js 1.27 kB -1 B (0%)
build/checkout-blocks/order-summary-shipping-frontend.js 17 kB +2 B (0%)
build/checkout-blocks/order-summary-subtotal-frontend.js 274 B +1 B (0%)
build/checkout-blocks/order-summary-taxes-frontend.js 436 B +2 B (0%)
build/checkout-blocks/payment-frontend.js 8.28 kB -6 B (0%)
build/checkout-blocks/pickup-options-frontend.js 4.85 kB +2 B (0%)
build/checkout-blocks/shipping-address-frontend.js 1.17 kB +2 B (0%)
build/checkout-blocks/shipping-methods-frontend.js 6.4 kB -2 B (0%)
build/checkout-blocks/terms-frontend.js 1.56 kB -1 B (0%)
build/checkout-frontend.js 32 kB +23 B (0%)
build/checkout.js 46.4 kB -4 B (0%)
build/customer-account.js 3.18 kB -2 B (0%)
build/featured-category.js 15.1 kB +90 B (+1%)
build/featured-product.js 15.3 kB +129 B (+1%)
build/filter-wrapper-frontend.js 14.3 kB +77 B (+1%)
build/filter-wrapper.js 2.4 kB +1 B (0%)
build/handpicked-products.js 8.04 kB +43 B (+1%)
build/legacy-template.js 6.46 kB +84 B (+1%)
build/mini-cart-component-frontend.js 28.5 kB +132 B (0%)
build/mini-cart-contents-block/cart-button-frontend.js 1.73 kB -8 B (0%)
build/mini-cart-contents-block/checkout-button-frontend.js 1.73 kB -6 B (0%)
build/mini-cart-contents-block/empty-cart-frontend.js 362 B +2 B (+1%)
build/mini-cart-contents-block/footer-frontend.js 4.09 kB -10 B (0%)
build/mini-cart-contents-block/products-table-frontend.js 593 B -1 B (0%)
build/mini-cart-contents-block/shopping-button-frontend.js 526 B -2 B (0%)
build/mini-cart-contents-block/title-frontend.js 1.9 kB -8 B (0%)
build/mini-cart-contents-block/title-items-counter-frontend.js 1.59 kB -11 B (-1%)
build/mini-cart-contents-block/title-label-frontend.js 1.53 kB -9 B (-1%)
build/mini-cart-contents.js 18 kB +48 B (0%)
build/mini-cart-frontend.js 2.66 kB +1 B (0%)
build/mini-cart.js 4.43 kB +82 B (+2%)
build/price-filter-wrapper-frontend.js 6.75 kB -3 B (0%)
build/price-filter.js 8.55 kB +71 B (+1%)
build/product-add-to-cart--product-button--product-image--product-price--product-rating--product-sale-bad--49d3ecb2.js 250 B -1 B (0%)
build/product-add-to-cart-frontend.js 6.52 kB +6 B (0%)
build/product-add-to-cart.js 8.84 kB -24 B (0%)
build/product-best-sellers.js 8.35 kB +11 B (0%)
build/product-button--product-image--product-price--product-rating--product-sale-badge--product-sku--prod--5bce0384.js 954 B -9 B (-1%)
build/product-button-frontend.js 2.65 kB -3 B (0%)
build/product-button.js 3.97 kB -45 B (-1%)
build/product-categories.js 2.71 kB +341 B (+14%) ⚠️
build/product-category.js 9.36 kB +13 B (0%)
build/product-collection.js 9.89 kB +6.17 kB (+166%) 🆘
build/product-image-frontend.js 2.62 kB -12 B (0%)
build/product-image.js 4.14 kB -45 B (-1%)
build/product-new.js 8.65 kB +310 B (+4%)
build/product-on-sale.js 8.68 kB +6 B (0%)
build/product-price.js 1.69 kB +3 B (0%)
build/product-query.js 11.8 kB +65 B (+1%)
build/product-rating-frontend.js 2.27 kB -8 B (0%)
build/product-rating.js 971 B -1 B (0%)
build/product-results-count.js 1.66 kB -2 B (0%)
build/product-sale-badge-frontend.js 1.79 kB -12 B (-1%)
build/product-sale-badge.js 665 B -1 B (0%)
build/product-search.js 2.63 kB -1 B (0%)
build/product-sku-frontend.js 1.84 kB +2 B (0%)
build/product-sku.js 536 B +1 B (0%)
build/product-stock-indicator-frontend.js 2.03 kB +6 B (0%)
build/product-stock-indicator.js 730 B -1 B (0%)
build/product-summary-frontend.js 2.19 kB -6 B (0%)
build/product-tag.js 9.01 kB +42 B (0%)
build/product-template.js 3.35 kB +82 B (+3%)
build/product-title-frontend.js 2.21 kB -8 B (0%)
build/product-title.js 3.66 kB -30 B (-1%)
build/product-top-rated.js 8.91 kB +330 B (+4%)
build/products-by-attribute.js 9.75 kB +54 B (+1%)
build/rating-filter-frontend.js 21.4 kB +88 B (0%)
build/rating-filter-wrapper-frontend.js 6.2 kB -12 B (0%)
build/rating-filter.js 6.89 kB +7 B (0%)
build/reviews-by-category.js 12.1 kB -1 B (0%)
build/reviews-by-product.js 13.3 kB +41 B (0%)
build/reviews-frontend.js 7.18 kB +69 B (+1%)
build/single-product.js 11.1 kB +49 B (0%)
build/stock-filter.js 7.61 kB +2 B (0%)
build/store-notices.js 1.69 kB -2 B (0%)
build/vendors--attribute-filter-wrapper--stock-filter-wrapper-frontend.js 5.11 kB +3 B (0%)
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6-frontend.js 19.4 kB -1 B (0%)
build/vendors--rating-filter-wrapper-frontend.js 5.11 kB +3 B (0%)
build/wc-blocks-data.js 22.4 kB -162 B (-1%)
build/wc-blocks-registry.js 3.15 kB +1 B (0%)
build/wc-blocks-style-rtl.css 27.9 kB +48 B (0%)
build/wc-blocks-style.css 27.8 kB +49 B (0%)
build/wc-blocks-vendors.js 65 kB -21 B (0%)
build/wc-blocks.js 3.7 kB -2 B (0%)
build/wc-shipping-method-pickup-location.js 30.4 kB +62 B (0%)
ℹ️ View Unchanged
Filename Size
build/cart-blocks/cart-accepted-payment-methods-frontend.js 1.39 kB
build/cart-blocks/cart-express-payment-frontend.js 720 B
build/cart-blocks/cart-items-frontend.js 301 B
build/cart-blocks/cart-line-items-frontend.js 1.06 kB
build/cart-blocks/cart-order-summary-frontend.js 1.27 kB
build/cart-blocks/cart-totals-frontend.js 308 B
build/cart-blocks/empty-cart-frontend.js 346 B
build/cart-blocks/filled-cart-frontend.js 656 B
build/cart-blocks/order-summary-coupon-form-frontend.js 1.63 kB
build/cart-blocks/order-summary-heading-frontend.js 333 B
build/checkout-blocks/contact-information-frontend.js 2.04 kB
build/checkout-blocks/fields-frontend.js 332 B
build/checkout-blocks/order-note-frontend.js 1.14 kB
build/checkout-blocks/order-summary-coupon-form-frontend.js 1.79 kB
build/checkout-blocks/shipping-method-frontend.js 2.63 kB
build/checkout-blocks/totals-frontend.js 361 B
build/general-style-rtl.css 1.31 kB
build/general-style.css 1.31 kB
build/mini-cart-contents-block/filled-cart-frontend.js 267 B
build/mini-cart-contents-block/items-frontend.js 237 B
build/price-format.js 1.19 kB
build/product-add-to-cart--product-button--product-image--product-rating--product-title.js 151 B
build/product-price-frontend.js 203 B
build/product-summary.js 904 B
build/stock-filter-wrapper-frontend.js 2.98 kB
build/vendors--attribute-filter-wrapper--cart-blocks/order-summary-coupon-form--cart-blocks/order-summary--48e1e4bb-frontend.js 6.82 kB
build/vendors--attribute-filter-wrapper--cart-blocks/order-summary-shipping--checkout-blocks/billing-addr--d9f38f9d-frontend.js 4.21 kB
build/vendors--cart-blocks/cart-cross-sells-products--cart-blocks/cart-line-items--cart-blocks/cart-order--3c5fe802-frontend.js 5.26 kB
build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js 3.57 kB
build/vendors--checkout-blocks/pickup-options--checkout-blocks/shipping-methods-frontend.js 8.25 kB
build/vendors--checkout-blocks/shipping-method-frontend.js 12.5 kB
build/vendors--price-filter-wrapper-frontend.js 2.2 kB
build/vendors--product-add-to-cart-frontend.js 7.26 kB
build/wc-blocks-editor-style-rtl.css 5.96 kB
build/wc-blocks-editor-style.css 5.96 kB
build/wc-blocks-google-analytics.js 1.56 kB
build/wc-blocks-middleware.js 933 B
build/wc-blocks-shared-context.js 1.52 kB
build/wc-blocks-shared-hocs.js 1.75 kB
build/wc-blocks-vendors-style-rtl.css 1.96 kB
build/wc-blocks-vendors-style.css 1.96 kB
build/wc-payment-method-bacs.js 816 B
build/wc-payment-method-cheque.js 811 B
build/wc-payment-method-cod.js 909 B
build/wc-payment-method-paypal.js 837 B
build/wc-settings.js 2.6 kB
build/woo-directives-runtime.js 2.73 kB
build/woo-directives-vendors.js 7.91 kB

compressed-size-action

@roykho roykho requested review from gigitux and nefeline May 17, 2023 20:41
@roykho roykho marked this pull request as ready for review May 24, 2023 15:35
@woocommercebot woocommercebot requested a review from a team May 24, 2023 15:36
@roykho roykho requested review from gigitux and nefeline and removed request for gigitux and nefeline May 24, 2023 16:12
Copy link
Contributor

@nefeline nefeline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 🎉 !

I ran the tests locally, and they are all passing, but I have a few notes:

  • What do you think about updating the name/description for those tests to something shorter so the entire content can be read (note the ellipsis at the beginning of each line)?
  • I'm getting a Failed to load resource: the server responded with a status of 500 (Internal Server Error) for each one of the tests: are you getting the same?
Screenshot 2023-05-25 at 23 00 44

'.regenerate_product_attributes_lookup_table input'
);

await page.click( '.regenerate_product_attributes_lookup_table input' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of regenerating the product attributes lookup table at this point, how about enabling lookup direct updates? That's what we did in our pre-existing e2e tests to circumvent the same problem of not having this table populated.

This setting ensures that the lookup table is immediately populated whenever a new product is created instead of scheduling an action to do so async.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there isn't a way to fix this issue in another way, I would prefer to have this step at the setup level.

@roykho
Copy link
Member Author

roykho commented May 25, 2023

@nefeline

What do you think about updating the name/description for those tests to something shorter so the entire content can be read (note the ellipsis at the beginning of each line)?

Do you have any suggestions so that it is descriptive enough otherwise if we have a fail somewhere, all the descriptions would be the same and you would have to count to know which failed. I had previously thought about 'Filter by Attributes Block - with All products Block 1...2...3'. But it decided against it.

I'm getting a Failed to load resource: the server responded with a status of 500 (Internal Server Error) for each one of the tests: are you getting the same?

No, I am not seeing those 500 errors (sometimes 404s but that happens on other tests too). Are you able to see the PHP logs? Also did you try it with a fresh env? Like npm run env:restart? Sometimes it also helps to run npm run env:stop and then wp-env destroy. Go to your Docker and remove related containers and images and start from fresh.

Instead of regenerating the product attributes lookup table at this point, how about enabling lookup direct updates? That's what we did in our pre-existing e2e tests to circumvent the same problem of not having this table populated.

Yes I'v already tried that but it doesn't work. I believe it is because when you import with CSV via the WP importer, that setting is not triggered. I am not sure how the non PW testings are importing the products to know why it works over there.

@roykho
Copy link
Member Author

roykho commented May 26, 2023

I think I know why you're seeing the 500s and/or 400s. It is because the Filter by Attributes Block page wasn't created. The reason why it isn't created successfully is because during import, the product attributes were not created. You can check by going to http://localhost:8889/wp-admin/edit.php?post_type=product&page=product_attributes after you have run npm run env:start. If it's empty, that is the reason.

Though I am not sure yet why the attributes are not being generated all of a sudden. When I submitted the PR, it was working fine. I am not sure if something changed with the environment like WP version or something else. If I manually create the attributes and page. The tests work fine as shown here:

Rujyn1.png

Note that even with trunk, the attributes are not being generated either...I have to investigate. Something must of change between the time I submitted the PR and now.

@roykho
Copy link
Member Author

roykho commented May 26, 2023

After some more digging, I found that if you import via the admin UI, it works as expected to create all the product attributes. But when it is imported via the CLI (as configured in the env), it fails to create the product attributes. I don't yet know why though 🤷

@roykho
Copy link
Member Author

roykho commented May 29, 2023

@nefeline - ok I think I fixed it. It was because the CLI command didn't use the wp cli wrapper. If you don't mind taking a look at this again.

Copy link
Contributor

@nefeline nefeline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any suggestions so that it is descriptive enough otherwise if we have a fail somewhere, all the descriptions would be the same and you would have to count to know which failed. I had previously thought about 'Filter by Attributes Block - with All products Block 1...2...3'. But it decided against it.

Gotcha! Well, I don't have any strong preferences/suggestions here. If you think there's no way to re-write these phrases without losing their meaning, we can keep them as-is. An example I thought of was:

should count the products correctly based on the filter (color=blue|query_type_color=or)

as a replacement for:

should show the correct count number of products based on the filter (color=blue|query_type_color=or)

But that's just a minor/optional suggestion to improve readability while the tests are running.

I think I know why you're seeing the 500s and/or 400s. It is because the Filter by Attributes Block page wasn't created. The reason why it isn't created successfully is because during import, the product attributes were not created. You can check by going to http://localhost:8889/wp-admin/edit.php?post_type=product&page=product_attributes after you have run npm run env:start. If it's empty, that is the reason.
Though I am not sure yet why the attributes are not being generated all of a sudden. When I submitted the PR, it was working fine. I am not sure if something changed with the environment like WP version or something else. If I manually create the attributes and page. The tests work fine as shown here
ok I think I fixed it. It was because the CLI command didn't use the wp cli wrapper. If you don't mind taking a look at this again.

Awesome 🕵️ work! I can confirm all tests are now passing without any server errors:

Screenshot 2023-05-29 at 18 19 16

Yes I'v already tried that but it doesn't work. I believe it is because when you import with CSV via the WP importer, that setting is not triggered. I am not sure how the non PW testings are importing the products to know why it works over there.

In this particular case, I believe generating the attribute as soon as the products are created is the ideal path and also faster than having them regenerated later on (after the products were already imported), but unfortunately, I don't have much experience with PW, so I can't think of any immediate solution at the top of my head, but tagging @gigitux and @nielslange (considering your work on pdToLP-wu-p2) in case you have any ideas.

I'm pre-approving the PR as the tests are now passing, but I believe ideally we should optimize the way the meta-lookup table is populated at some point so the tests can run a bit faster.

@nielslange nielslange self-requested a review May 30, 2023 05:28
Copy link
Member

@nielslange nielslange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #9500 (comment) case, I believe generating the attribute as soon as the products are created is the ideal path and also faster than having them regenerated later on (after the products were already imported), but unfortunately, I don't have much experience with PW, so I can't think of any immediate solution at the top of my head, but tagging @gigitux and @nielslange (considering your work on pdToLP-wu-p2) in case you have any ideas.

@nefeline and @roykho Isn't this part work as expected:

wp-env run tests-cli "wp wc tool run regenerate_product_lookup_tables --user=1"


As for the testing names, below I listed a few suggestions. To increase the readability, I listed them in pairs. Each first snippet shows the current name, each second snippet shows my suggestion.

Filter by Attributes Block - with All products Block
Filter by Attributes Block

should show the correct count number of products based on the filter (color=blue|query_type_color=or)
shows correct product count for: color=blue, query_type_color=or

should show the correct count number of products based on the filter (color=blue,gray|query_type_color=or)
shows correct product count for: color=blue,gray, query_type_color=or

should show the correct count number of products based on the filter (color=blue|query_type_color=or|min_price=15|max_price=40)
shows correct product count for: color=blue, query_type_color=or, min_price=15, max_price=40

That said, I also reviewed the PR and the E2E tests work as expected. Therefore, I'm also approving this PR. Thanks for working on this, @roykho. 🙌

Copy link
Contributor

@gigitux gigitux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on E2E tests. I left some feedback!

tests/e2e-pw/bin/test-env-setup.sh Outdated Show resolved Hide resolved
'.regenerate_product_attributes_lookup_table input'
);

await page.click( '.regenerate_product_attributes_lookup_table input' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there isn't a way to fix this issue in another way, I would prefer to have this step at the setup level.

.wp-env.json Outdated Show resolved Hide resolved
@nefeline
Copy link
Contributor

Regarding:

@nefeline and @roykho Isn't this part work as expected:

There's a difference between populating the lookup table at the same time new products are created versus regenerating the lookup tables later on via a separate task. This is an extra step we didn't have to run while working on Puppeteer, but now we do it on Playright.

If folks don't have any ideas to solve this at the top of their head, my recommendation is to create a separate issue so we can investigate later on, as performance will certainly be impacted.

@roykho
Copy link
Member Author

roykho commented May 30, 2023

@nefeline and @roykho Isn't this part work as expected:

So I believe this does not include wp_wc_product_attributes_lookup table. That's why they are separate buttons in the status->tools section.

@roykho
Copy link
Member Author

roykho commented May 30, 2023

@nefeline @nielslange @gigitux

Thanks for the feedbacks! I've updated the PR to address as much as possible. Here are the notable changes from the original PR.

  • I refactor the use of generic page.$ and page.$$ to use PW locators instead.
  • I removed the added post creation of Filter by Attributes Block because I realize we could just use the existing Active Filters Block post.
  • I removed the WP_DEBUG statement as normally this is not needed during automated testing.
  • I shorten the test titles a bit. They are still long but much shorter.
  • I utilize the method @nielslange mentioned to activate the Blocks plugin in .wp-env.json.

With that, if ya'll don't mind giving it another look. Thanks!

@nefeline
Copy link
Contributor

nefeline commented May 30, 2023

Thanks for addressing the feedback and for shortening the tests description as suggested. 🙏

My only remaining concern is still related to #9500 (comment) : since none of us involved in this discussion had any ideas/suggestions to update this configuration at the top of our heads, my recommendation is to create an issue so we can investigate later on (during a cooldown).

All tests are passing, but I'm deferring the approval to Luigi & Niels since they requested additional changes regarding the tests setup 👍 .

@roykho
Copy link
Member Author

roykho commented May 30, 2023

@nefeline - created a separate issue woocommerce/woocommerce#42355

Copy link
Contributor

@gigitux gigitux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback! I'm not sure that prepareAttributes function runs in the right place. What do you think?

@gigitux
Copy link
Contributor

gigitux commented May 31, 2023

@nefeline - created a separate issue woocommerce/woocommerce#42355

Thanks! I added this issue into the scope of woocommerce/woocommerce#42413 🚀

@roykho roykho requested a review from gigitux May 31, 2023 18:04
@nielslange nielslange self-requested a review June 1, 2023 05:10
Copy link
Member

@nielslange nielslange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing all changes, @roykho. I left a comment on a potential future improvement, but that's out of the scope for this PR.

tests/e2e-pw/global-setup.ts Show resolved Hide resolved
@roykho roykho merged commit b190d23 into trunk Jun 1, 2023
@roykho roykho deleted the add/e2e-tests-attributes-count branch June 1, 2023 14:14
hritikchaudhary pushed a commit to hritikchaudhary/woocommerce-blocks that referenced this pull request Jun 1, 2023
* Add e2e tests for attributes count

* Add test with pricing filter and turn on debug to prevent cache

* Prevent tests from passing if test page is not loaded

* Use WP wrapper to call WC CLI

* Refactor to use more of PW methods

* Use existing active filters block post for testing

* Move prepareAttributes function to global setup
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip-changelog PRs that you don't want to appear in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter data count mismatch > Create End to End tests for the Filter Data Counts
4 participants