You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/qit/README.md
+16-31Lines changed: 16 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,13 @@ We use the [QIT toolkit](https://qit.woo.com/docs/) for automated testing includ
5
5
### Setup
6
6
7
7
1. Create `local.env` inside the `tests/qit/config/` directory by copying the variables from `default.env`.
8
-
2. To get the actual values for local config, refer to this [secret store](https://mc.a8c.com/secret-store/?secret_id=11043) link.
9
-
3. Use standard `KEY=VALUE` format (no `export` keyword needed).
8
+
2. Use standard `KEY=VALUE` format (no `export` keyword needed).
9
+
3. Configure the required credentials:
10
+
-**QIT authentication**: Get credentials from the [secret store](https://mc.a8c.com/secret-store/?secret_id=11043). These authenticate you with the QIT service.
11
+
-**E2E Jetpack credentials** (`E2E_JP_SITE_ID`, `E2E_JP_BLOG_TOKEN`, `E2E_JP_USER_TOKEN`): Get these from a Jurassic Ninja site already onboarded in test mode.
10
12
4. Once configured, the first time you run a test command, it will create a local auth file for subsequent runs.
11
13
12
-
**Note:** E2E tests require the dev version of `qit-cli`. Run `composer require woocommerce/qit-cli:dev-trunk --dev` to install it locally.
14
+
**Note:** E2E tests require the dev version of `qit-cli` (test packages are not yet in stable releases). Run `composer require woocommerce/qit-cli:dev-trunk --dev --ignore-platform-reqs` to install it locally.
13
15
14
16
### Running Tests
15
17
@@ -31,43 +33,26 @@ Before running E2E tests, build the plugin package:
31
33
npm run build:release
32
34
```
33
35
34
-
This creates `woocommerce-payments.zip` which is used by QIT. Then run the tests:
36
+
This creates `woocommerce-payments.zip` which is used by QIT. Then run the tests with the required environment variables:
35
37
36
38
```bash
37
-
# Run all E2E tests
38
-
npm run test:qit-e2e
39
+
# Run all E2E tests (prepend with env vars from local.env)
40
+
E2E_JP_SITE_ID='<value>' E2E_JP_BLOG_TOKEN='<value>' E2E_JP_USER_TOKEN='<value>' npm run test:qit-e2e
41
+
42
+
# Run specific test file (passthrough to Playwright)
43
+
E2E_JP_SITE_ID='<value>' E2E_JP_BLOG_TOKEN='<value>' E2E_JP_USER_TOKEN='<value>' npm run test:qit-e2e -- -- shopper-checkout-purchase.spec.ts
39
44
40
-
# Run tests matching a pattern (e.g., @shopper tag, test name, or file path)
41
-
npm run test:qit-e2e:args -- --grep "@shopper"
42
-
npm run test:qit-e2e:args -- --grep "shopper-checkout-purchase"
45
+
# Run tests filtered by tag (e.g., @blocks, @shopper)
46
+
E2E_JP_SITE_ID='<value>' E2E_JP_BLOG_TOKEN='<value>' E2E_JP_USER_TOKEN='<value>' npm run test:qit-e2e -- -- --grep "@blocks"
43
47
```
44
48
45
-
You can also run QIT directly for more control:
49
+
**Tip:**You can export the variables once per shell session instead of prepending each command:
0 commit comments