4ca6696f12
* Add order reference to Upsells and Cross-sells - Added 'order' to usesReference in cross-sells and upsells - Updated LinkedProductControl for order context - Enhanced ProductCollection to handle order references * Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce * Add PHP code for Cross-sells collection * Fix formatting * Add E2E tests 1. In the Cart Template, it checks that "From products in the cart" is selected by default for the "My Custom Collection - Cart Context". 2. In the Order Confirmation Template, it verifies that "From products in the order" is chosen by default for the "My Custom Collection - Order Context". * Add 'block' scope to cross-sells collection * Extract and use reference type constants This commit extracts the REFERENCE_TYPE_CART and REFERENCE_TYPE_ORDER constants to the top of the file and updates their usage throughout the code, including in the getFromCurrentProductRadioLabel function. * Align variable naming for product references in Product Collection This commit updates the ProductCollection class to ensure consistency in variable naming for product references across different collection types, particularly aligning with the naming convention used in Upsells. * Add "hadOrderReference" to conditional label display Key changes: - Removed `isUsesReferenceIncludesCart` parameter from `getFromCurrentProductRadioLabel` - Introduced `hasCartReference` and `hasOrderReference` parameters for consistency - Updated conditional logic to check for both cart and order references - Adjusted the function call in `LinkedProductControl` to pass both new parameters * Fallback to 0 for orderId in get_product_ids_from_order calls --------- Co-authored-by: github-actions <github-actions@github.com> |
||
---|---|---|
.. | ||
bin | ||
content-templates | ||
plugins | ||
rules | ||
test-data/data | ||
tests | ||
themes | ||
utils | ||
.eslintrc.js | ||
README.md | ||
flaky-tests-reporter.ts | ||
global-setup.ts | ||
playwright.config.ts | ||
playwright.performance.config.ts | ||
tsconfig.json |
README.md
WooCommerce Blocks End-to-End Tests
This document provides an overview of the WooCommerce Blocks end-to-end testing process. For detailed instructions and comprehensive guidelines, please refer to the contributor guidelines document.
Quick Start
Preparing the Environment
-
Build the WooCommerce Plugin:
pnpm --filter='@woocommerce/plugin-woocommerce' watch:build
-
Go to the WooCommerce Blocks plugin folder:
cd plugins/woocommerce-blocks/
-
Start the environment:
pnpm env:start
Running the Tests
-
Run all tests:
pnpm test:e2e
-
Run a single test file:
pnpm test:e2e path/to/the/file.spec.ts
-
Run in UI mode:
pnpm test:e2e --ui
-
Run in debug mode:
pnpm test:e2e --debug