* Add E2E tests for Product Collection Block
This commit does the following changes:
1. Adjusts the .gitignore file to ignore the test-results and artifacts directories under all subdirectories named 'e2e-pw'.
2. Adds new E2E tests for the Product Collection block, specifically testing:
- If the block renders correctly, including validating the number of product images, titles, prices, and 'Add to Cart' buttons.
- If the sidebar settings correctly control the number of displayed columns.
3. Implements the 'ProductCollectionPage' class, providing methods to perform actions such as creating a new post, inserting a block, publishing a post, and locating various elements on the page.
4. Adjusts the directory structure for the E2E tests to improve organization and readability.
* Minor improvements
* Update E2E tests for Product Collection block sidebar settings
This commit updates the E2E tests for the sidebar settings of the Product Collection block. The changes include:
1. Refactoring the test assertions to use property accessors instead of method calls for the `ProductCollectionPage` class. This improves readability and consistency.
2. Updating the `ProductCollectionPage` class to initialize locators for editor and frontend elements separately. This allows easier differentiation between editor and frontend locators.
The test file `sidebar-settings.block_theme.spec.ts` has been deleted, as its functionality is now covered by the updated tests in `product-collection.block_theme.spec.ts`.
* Don't update package.json files
* Don't update gitignore file
* Add E2E test for order by control
This commit updates the E2E tests for the sidebar settings and order by control of the Product Collection block. The changes include:
1. Refactoring the test assertions and descriptions for improved readability and clarity.
2. Adding a new test case to verify the correct sorting of products by title in descending order.
3. Updating the `ProductCollectionPage` class to include a new method `setOrderBy()` to set the order by value in the order by control.
4. Adding a new method `waitForProductsToLoad()` in the `ProductCollectionPage` class to wait for the products to load in the block.
These changes ensure that the sidebar settings and order by control are functioning correctly in the Product Collection block.
* Minor improvements
* Add tests for "on sale" filter
* Add tests for Hand picked products filter
This commit updates the E2E tests for the handpicked products filter in the Product Collection block. The changes include:
1. Adding a new test case to verify that products can be filtered based on the selection in the handpicked products option.
2. Adding a new method `addFilter()` to the `ProductCollectionPage` class to select a filter option from the dropdown.
3. Adding a new method `setHandpickedProducts()` to the `ProductCollectionPage` class to set the handpicked products in the block settings.
These changes ensure that the handpicked products filter is functioning correctly in the Product Collection block.
* Verify that on sale filter works on frontend
Adding assertions to verify the count and presence of on-sale products in the frontend after publishing.
* Add tests for Keyword filter
This commit updates the E2E tests for the keyword filter in the Product Collection block. The changes include:
1. Adding assertions to verify that the products are correctly filtered based on the keyword entered.
2. Adding assertions to verify the filtered products in the frontend after publishing.
These changes ensure that the keyword filter in the Product Collection block is functioning correctly.
* Use fixture to setup product collection page
This commit refactors the E2E tests for the Product Collection block to improve test structure and readability. The changes include:
1. Refactoring the test structure using the `test.extend` function to define shared setup and teardown logic.
2. Moving the creation of the `ProductCollectionPage` instance to the shared setup logic.
3. Using the `pageObject` fixture in each test to access the `ProductCollectionPage` instance.
4. Removing duplicate code for creating the `ProductCollectionPage` instance.
These changes enhance the maintainability and readability of the E2E tests for the Product Collection block.
* Add CartEventsContext with onProceedToCheckout event
* Wrap Cart in CartEventsProvider
* Dispatch onProceedToCheckout event when button is pressed
* Update type of children on CartEventsProvider
* Add test for ProceedToCheckout block
* Add tests for CartEventProvider
* Remove superfluous div
* Fix incorrect nesting after rebase
* Wrap mini cart in CartEventsProvider
* Dispatch onProceedToCheckout event when clicking button in mini cart
* Add tests for mini cart onProceedToCheckout emitter
* Make observer fail so navigation isn't attempted
* Prevent console error on navigation
* Try preventing navigation in unit tests
* Try preventing navigation in unit tests
* Try preventing navigation in unit tests
* Try preventing navigation in unit tests
* Try preventing navigation in unit tests
* Try preventing navigation in unit tests
* Try preventing navigation in unit tests
* Mini Cart Block: show the total price, including tax, according to the option
* Fix tests in PR 9878 (https://github.com/woocommerce/woocommerce-blocks/pull/9880)
* add unit test
---------
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
* Mini Cart Block: show the total price, including tax, according to the option
* Fix tests in PR 9878 (https://github.com/woocommerce/woocommerce-blocks/pull/9880)
* add unit test
---------
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>
* Mini Cart: Update color settings to include Price, Icon and Product Count.
* Fix color settings in the editor.
* Mini Cart: Add color settings for the Price, Icon and Product Count.
* Mini Cart: Remove unnecessary color settings.
* Remove unnecessary code comments.
* Update color settings labels.
* Add price color to the tax label.
* Add missing docs comment
* Fix TS errors
* Fix TS error
* Adjust type declaration
* Add TS error comments
* Change @ts-to-do to @ts-expect-error
---------
Co-authored-by: tjcafferkey <tjcafferkey@gmail.com>
This commit introduces the 'Display Settings' toolbar for the 'Product Collection' block in the Gutenberg editor.
- A new component 'DisplaySettingsToolbar' is added in 'display-settings-toolbar.tsx'. It includes controls for changing the number of items per page, the offset, and the maximum number of pages to show in the block. The toolbar only shows up when the 'inherit' query attribute is set to false.
- The 'DisplaySettingsToolbar' component is then integrated into the main 'edit.tsx' file through 'ToolbarControls'.
- Styles have also been added to 'editor.scss' to ensure the popover content of the display settings toolbar has an appropriate minimum width.
* Allow failure of the PHP Unit Tests
* Limit the PHP versions to 7.4 and 8.0 to run unit tests
* Don't allow failing fast
* Add a comment explaining the skipped part
* Cancel jobs later
* Cancel all the steps in workflow based on the same condition
* Cache script data in a transient for production builds
* Store as json
* Disable cache when script debug is on
* Disable in test environment
* Simplify caching structure
* Put back cache buster
* Fix update_script_data_cache
* Merge dependencies param always—do not cache it
* Empty commit for release pull request
* Update Hero Product 3-split pattern image
* Update Banner Pattern To Replace Unsplash Image (https://github.com/woocommerce/woocommerce-blocks/pull/9760)
* Update Banner to replace Unsplash image.
Replaces the Unsplash image with a CCO licensed image from Pxhere. Also
updates the CTA button to link to the Shop page, by default.
* Remove extra padding from top of test column.
Vertical alignment was off on the text column due to 60px of top
padding. This aligns everythign, as expected.
* Update Chessboard pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9761)
* Updathe the Hero Product Split (https://github.com/woocommerce/woocommerce-blocks/pull/9762)
* Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9763)
* Update Images for the Product Details Patterns (https://github.com/woocommerce/woocommerce-blocks/pull/9764)
* Update image for the Product Hero pattern.
Replace the Unsplash image with a CCO licensed image from Pxhere.
* Update images for Prod List Gallery Desc pattern
Replace the Unsplash image with a CCO licensed image from Pxhere for the
Product Listing with Gallery and Description pattern.
* Remove unneeded Unsplash images.
* Update copy for Prod Listing Gallery Desc pattern.
* Optimize new image exports.
* Update image for the Product Listing pattern.
Replace the Unsplash image with a CCO licensed image from Pxhere.
* Update images for Product Details pattern.
Replace the Unsplash images with CCO licensed images from Pxhere.
* Remove unneeded Unsplash image.
* Use Relative URLs for Images in the Product Listing Pattern
This commit replaces hardcoded URLs with dynamic ones for image placeholders in the `product-listing-with-gallery-and-description.php` pattern file.
- The `plugins_url()` function is now used to generate URLs, which correctly points to the images folder within the WooCommerce Blocks plugin directory. This approach provides better flexibility and portability since it doesn't rely on a specific domain or path. The `esc_url()` function is used to ensure the URL is safe to use in the HTML context.
- The change is made for a total of four images in the pattern.
---------
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
* Update/patterns featured category product collection (https://github.com/woocommerce/woocommerce-blocks/pull/9765)
* Update image for featured category focus pattern
* Update image for featured category cover image pattern
* Update images for featured category triple pattern
* Change to wide width
* Update links to buttons
* Fix typo in hex color value.
There was an extra `f` in the hex color value, causing the text to
unexpectedly render black.
---------
Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>
* Update/collection pattern images (https://github.com/woocommerce/woocommerce-blocks/pull/9766)
* Update featured collections images
* Add shop link to shop by price pattern
* Update hero product pattern title (https://github.com/woocommerce/woocommerce-blocks/pull/9769)
* Remove unused pattern image (https://github.com/woocommerce/woocommerce-blocks/pull/9770)
* Add 10.4.2 changelog in readme.txt
* Update version number to 10.4.2
* Add testing instructions for 10.4.2
* Add 9769 PR testing steps
* WooCommerce Classic Template block: Fix error on clearing customizations on Woo Templates (https://github.com/woocommerce/woocommerce-blocks/pull/9759)
* Fix Classic Template block error on clearing customizations on template
* Add link to issue in JS Doc
* Change the way of debug check of tests-mysql container (https://github.com/woocommerce/woocommerce-blocks/pull/9794)
* Add alt text to images used in patterns describing their purpose (https://github.com/woocommerce/woocommerce-blocks/pull/9788)
* Add alt text to images used in patterns describing their purpose
* Replace 1/3 notation with 1 out of 3, so it's better handled byt screen readers
* Update testing instructions to include 9759 PR
* Update zip to include 9759 PR
* Remove 9759 PR from testing instructions
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: Daniel W. Robert <danielwrobert@users.noreply.github.com>
Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
Co-authored-by: Roy Ho <roykho77@gmail.com>
Co-authored-by: Daniel W. Robert <danielwrobert@gmail.com>
Co-authored-by: Tarun Vijwani <tarun.vijwani@automattic.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Karol Manijak <karol.manijak@automattic.com>