woocommerce/plugins/woocommerce-blocks/tests/e2e/utils
Karol Manijak 40b43e8d9c
Prevent collection different than Product Catalog from being filtered (#45820)
* Prevent collection different than Produyct Catalog from being filtered

* Adjust Product Filters tests

* Split taxonomies filter into seperate filter per taxonomy

* Add changelog

* Improve onDeselect function

* Update Product Filter test handlebars so they all use Product Collection that inherits query from template

* Set Product Collection to inherit query from template in PHP unit tests

* Remove unnecessary empty space

* Add changelog

* Update tests

* Fix lint

* Update Product Collection attributes in filter E2E handlebars

* Update the Product Filters testing pages title

* Satisfy TS by returning single React element rather than array of elements

* Revert some incorrect changes

* Cleanup after accidental incorrect merge

* Add template utils to dynamic contents util

* Fix Attribute Filter tests

* Cleanup Attribute tests, refactor and fix types

* Add product filter on top of attirbute filter in handlebars

* Fix lint

* Update Rating filter tests to use Product Archive template instead of post

* Update Rating Filter handlebars

* Update Stock filter tests to use Product Archive template instead of post

* Update Stock Filter handlebars

* Add more granular util to update Produyct Catalog based on handlebar template

* Use Product Catalog util and simplify test scenarios

* Unify handlebar templates

* Fix Product Collection attributes in Product Filter handlebar templates

* Revert temporary timeouts increase

* Remove unused types

* Cleanup types

* Cleanup types

* Lint fix

* Rename updateTemplatesContent to updateTemplateContents to better depict its purpose

* Fix types

* Rename updateProductCatalogContent to updateProductCatalogTemplate to better depict its purpose

* Allow for beforeAll and afterAll in PW tests

* Use beforeAll and afterAll instead of using fixture in active filters test

* Use beforeAll and afterAll instead of using fixture in attribute filters test

* Use beforeAll and afterAll instead of using fixture in price filters test

* Use beforeAll and afterAll instead of using fixture in rating filters test

* Use beforeAll and afterAll instead of using fixture in stock status filters test

* Get rid of updateProductCatalogTemplate util as it's too specific

* Extract some constants

* Remove unused file probably added here by accident

* Adjust Attribute Filter block tests to the new logic

* Merge fix

* Bring back necessary handlebars file

* Merge fix

* Merge fix

* Update beforeAll

* Avoid relying on product collection page object in before all

* Bring back the original order of tests

* Switch Filter by Attribute tests to handlebars

* Fix typo

* Update test to new circumstances

* Fix hooks usage
We no longer use hooks other than `beforeEach` since we're resetting the DB for each test (#46125). Using other hooks was not caught by the linter (on this PR) because I accidentally removed the no-hooks rule in #47228 and restored it just now in #47500. 😅

* Fix the test

* Fix Price filter test

* Update attribute filter tests

* Share the handlebars between tests

* Update price filter tests

* Update rating filter tests

* Update stock filter tests

* Remove unnecessary product collection page object from filter tests

* Fix typo

* Fix Filter by Stock test

* Simplify Attribute filter test by remoiving one filter from page

* Try to wait for element to be visible

* Fix handlebars syntax for filters so it doesnt throw validation errors and warnings

* Wait for filters to be visible for sure before performing further part of test

* Wait for Site Editor canvas loader

* Fix linter error

---------

Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
2024-05-17 11:23:56 +02:00
..
api Fix E2E tests for WordPress 6.5 (#44593) 2024-03-27 10:54:44 +01:00
editor Blocks E2E: Remove obsolete waitForSiteEditorFinishLoading util (#47547) 2024-05-16 16:39:30 +02:00
frontend Blocks E2E: Align ESLint and TS configs with Gutenberg (#47228) 2024-05-14 10:23:17 +02:00
local-pickup E2E test env: use WordPress 6.5 stable version (#46155) 2024-04-03 14:33:04 +02:00
mini-cart Migrate coupon- and shipping-related tests to Playwright (#44108) 2024-01-31 01:23:09 -08:00
navigation Blocks E2E: Align ESLint and TS configs with Gutenberg (#47228) 2024-05-14 10:23:17 +02:00
performance Allow usage of block notice templates when using classic themes (#45164) 2024-03-14 19:33:33 +07:00
shipping Migrate coupon- and shipping-related tests to Playwright (#44108) 2024-01-31 01:23:09 -08:00
storeApi Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903) 2023-12-22 09:33:18 +01:00
wpCli Migrate coupon- and shipping-related tests to Playwright (#44108) 2024-01-31 01:23:09 -08:00
cli.ts Blocks E2E: Refactor configs and workflow (#46409) 2024-05-13 14:58:26 +02:00
constants.ts Block E2E: Eliminate side effects through improved test isolation (#46125) 2024-04-26 11:39:11 +02:00
create-dynamic-content.ts Prevent collection different than Product Catalog from being filtered (#45820) 2024-05-17 11:23:56 +02:00
index.ts Block E2E: Eliminate side effects through improved test isolation (#46125) 2024-04-26 11:39:11 +02:00
types.ts Open templates from list instead of loading the URL in block templates e2e tests (#44774) 2024-02-20 10:35:27 +01:00