7.2 KiB
7.2 KiB
Testing notes and ZIP for release 8.6.0
Zip file for testing: woocommerce-gutenberg-products-block.zip
Feature plugin and package inclusion in WooCommerce
Allow rendering HTML in shipping package names 7147
Test HTML rendering in shipping package names
- Install the Multiple Packages for WooCommerce plugin.
- Go to
/wp-admin/admin.php?page=wc-settings&tab=multiple_packages
, enable the Multiple Packages for Shipping plugin and selectProduct (individual)
for the optionGroup By
. - Install the Code Snippets plugin.
- Add the following code snippet to the site:
add_filter( 'woocommerce_shipping_package_name', 'test_package_name', 1, 3 );
function test_package_name( $title, $index, $package ) {
return $title . '<br/>test<br/>test2';
}
- Ensure to have one page with the Cart block and one page with the Checkout block.
- Add two products to the cart.
- Verify that the page with the Cart block shows the the shipping package name with line breaks instead of showing
Shipping method<br/>test<br/>test2
. - Verify that the page with the Checkout block shows the the shipping package name with line breaks instead of showing
Shipping method<br/>test<br/>test2
. - Replace the previous code snippet with the following one:
add_filter( 'woocommerce_shipping_package_name', 'test_xss', 1, 3 );
function test_xss( $title, $index, $package ) {
return $title . '<br><a href="https://woocommerce.com/" target="_blank">WooCommerce.com<img src=x onerror="javascript:alert('XSS')"></a>';
}
- Verify that the page with the Cart block and the page with the Checkout block:
- do not show an XSS alert.
- do show the package name and the URL WooCommerce.com in the next line and that the URL opens in a new tab when being clicked.
Test reusable sanitise util (only for developer testing)
- Open
assets/js/base/components/cart-checkout/shipping-rates-control-package/index.tsx
and change
<div
className="wc-block-components-shipping-rates-control__package-title"
dangerouslySetInnerHTML={ sanitizeHTML( packageData.name ) }
/>
to
<div
className="wc-block-components-shipping-rates-control__package-title"
dangerouslySetInnerHTML={ sanitizeHTML( packageData.name, {
tags: [ 'a' ],
} ) }
/>
- Run
npm run build
to build the extension again. - Look up the page with the Cart or the Checkout block from the previous test case.
- Verify that the the URL WooCommerce.com is still visible, but that it no longer appears in the next line but in the same line.
Revert "Add static class name for product-details (#6914)" 7191
- Add an item to your cart that has multiple variants. E.g. Hoodie (Blue, Logo)
- Go to the Cart Block
- Inspect the text for one of the variants (e.g. Colour: Blue)
- Make sure there is a class called
wc-block-components-product-details__{name of your variant}
Prevent Express Checkout block from being cut off 7152
- Install the WooCommerce Stripe Payment Gateway plugin.
- Go to
/wp-admin/admin.php?page=wc-settings&tab=checkout
and activate the payment methodStripe
so that the Express Payment block becomes visible. - Create a page and add the Checkout block to it.
- Select the Checkout block and verify that the Express Payment block is no longer cut off.
Make chevron clickable in Filter by Product block input 7139
- Add the
Filter by Attribute
block and theAll Products
block to a page. - Set the
Filter by Attribute
block display to dropdown and allow selecting multiple options. - Play around with the window size and the options you select, and make sure the pills inside the input don't overlap the chevron.
- Verify that when you click on the chevron, the options dropdown appear.
Fix: Inner blocks control position for Cart Block 6973
- Go to the Cart Block
- Click on the fee inner block
- Confirm that the controls appear on the correct side
Create Cross-Sells product list 6645
Test editor behaviour when adding Cart block
- Create a test page and add the Cart block to it.
- Verify that the Cart block contains the Cart Cross-Sells inner block.
- Verify that the Cart Cross-Sells inner block contains the Heading and Cart Cross-Sells products inner blocks.
- Select the Cart Cross-Sells products inner block and verify that the number of visible Cross-Sells products can be adjusted in the editor.
Test editor behaviour after removing Cross-Sells block
- Create a test page and add the Cart block to it.
- Verify that the Cart block contains the Cart Cross-Sells inner block.
- Delete the Cart Cross-Sells inner block.
- Verify that the Cart Cross-Sells inner block can be reinserted.
Test frontend behaviour if cart items does not have Cross-Sells products
- Visit the frontend.
- Add a product to the cart that does not Cross-Sells products.
- Go to the Cart page.
- Verify that the Cross-Sells product block is not visible.
Test frontend behaviour if cart items have Cross-Sells products
- Visit the frontend.
- Add a product to the cart that has Cross-Sells products.
- Go to the Cart page.
- Verify that the Cross-Sells product block is visible.
- Add one of the Cross-Sells products, which also has Cross-Sells products, to the cart.
- Verify that the added Cross-Sells product had been added to the cart and is no longer visible as a Cross-Sells product.
- Verify that the Cross-Sells products, of the product that had been added to the cart in step 6., are visible in the Cross-Sells block.
Test frontend behaviour if cart items have a Cross-Sells product that is out of stock
- Visit the frontend.
- Add a product to the cart that has a Cross-Sells product which is out of stock.
- Go to the Cart page.
- Verify that the Cross-Sells product block is visible.
- Verify that the Cross-Sells product, which is out of stock, does not show an
Add to Cart
button, but aRead More
button, that links to the corresponding product page.
Test number of visible Cross-Sells products in the frontend
- Ensure that you have one test product which has more than 6 Cross-Sells products.
- Open the cart page in the editor and set the number of visible Cross-Sells items to 1.
- Go to the frontend and add the test product from step 1 to the cart.
- Go to the cart and verify that only 1 Cross-Sells product is visible.
- Repeat steps 2 until 4 and set the number of visible Cross-Sells items to 2, 3, 4, 5 & 6.