woocommerce/plugins/woocommerce-blocks/docs/internal-developers/testing/releases/371.md

48 lines
3.1 KiB
Markdown
Raw Normal View History

# Testing notes and ZIP for release 3.7.1
2020-11-05 13:16:05 +00:00
> Note: These tests only apply to the feature plugin, nothing in this release impacts what is exposed in WooCommerce core via package.
Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github.com/woocommerce/woocommerce-gutenberg-products-block/files/5493854/woocommerce-gutenberg-products-block.zip)
All tests require:
- Checkout block published in woo checkout page.
- Items added to cart.
- Anon / incognito user session.
## Test 1: Store API will only create an account if store options allow it
2020-11-05 13:16:05 +00:00
1. Render checkout block with `Create an account?` checkbox. We're going to use a stale copy of the page to submit a checkout API request with `should_create_account=true`.
- Ensure `WooCommerce > Settings > Accounts & Privacy > Allow customers to create an account during checkout` is checked (temporarily enable).
- Edit checkout page, ensure `Allow shoppers to sign up for a user account during checkout` is enabled, publish.
2020-11-05 13:16:05 +00:00
2. In another browser/window, view checkout page (with items in cart, as anon user/logged out). Should see `Create an account` checkbox.
3. Complete checkout form and check `Create an account`. **Do not submit** (yet).
4. As admin, disable `WooCommerce > Settings > Accounts & Privacy > Allow customers to create an account during checkout` and save settings.
5. Submit checkout (with `should_create_account=true`).
6. Ensure no account is created for the customer, and the order is processed correctly.
As an alternative to (1), could also hack the JS REST request to always send `should_create_account=true`, or use other approaches to call the API with that value set.
## Test 2: Checkout block will only offer to create an account if store options allow it
2020-11-05 13:16:05 +00:00
1. As admin, disable `WooCommerce > Settings > Accounts & Privacy > Allow customers to create an account during checkout` and save settings.
2. View checkout page and ensure there is no `Create an account` checkbox.
3. Repeat the above test with different block settings and ensure no checkbox is displayed unless store option is enabled. E.g. allow checkout signup in settings, enable block `Allow shoppers to sign up for a user account during checkout` setting, publish, change store setting and refresh page.
## Other possible tests
- Repeat similar tests with a custom plugin implementing `woocommerce_checkout_registration_enabled` hook to disable checkout signup.
- Test various combinations of store settings (e.g. guest checkout `Allow customers to place orders without an account`) and ensure that accounts are created when appropriate.
- Test with WooCommerce < v4.7 and ensure that checkout block sign-up feature is not available, and there is no way to sign up using checkout block.
<!-- FEEDBACK -->
---
[We're hiring!](https://woocommerce.com/careers/) Come work with us!
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/internal-developers/testing/releases/371.md)
<!-- /FEEDBACK -->