2024-05-27 14:54:06 +00:00
# WooCommerce Blocks End-to-End Tests
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
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 ](../../docs/contributors/e2e-guidelines.md ).
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
## Quick Start
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
### Preparing the Environment
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
1. Build the WooCommerce Plugin:
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
```sh
pnpm --filter='@woocommerce/plugin-woocommerce' watch:build
```
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
2. Go to the WooCommerce Blocks plugin folder:
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
```sh
cd plugins/woocommerce-blocks/
```
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
3. Start the environment:
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
```sh
pnpm env:start
```
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
### Running the Tests
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
1. Run all tests:
2024-01-10 15:51:53 +00:00
2024-05-27 14:54:06 +00:00
```sh
pnpm test:e2e
```
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
2. Run a single test file:
2024-01-10 15:51:53 +00:00
2024-05-27 14:54:06 +00:00
```sh
pnpm test:e2e path/to/the/file.spec.ts
```
2024-01-10 15:51:53 +00:00
2024-05-27 14:54:06 +00:00
3. Run/Debug in UI mode:
2023-04-17 12:01:41 +00:00
2024-05-27 14:54:06 +00:00
```sh
pnpm test:e2e --ui
```