Skip to content
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5940c8a
[E2E][QIT] Migrate remaining shopper specs
mgascam Dec 3, 2025
8832b55
Add changelog entry
mgascam Dec 3, 2025
774085a
Fix Alipay and pay-for-order test failures
mgascam Dec 3, 2025
7977468
Skip Alipay tests due to QIT environment limitation
mgascam Dec 3, 2025
61d20ed
Skip cardTestingPreventionEnabled: true case in pay-for-order test
mgascam Dec 3, 2025
1de9aa1
Merge branch 'develop' into dev/qit-e2e-shopper-remaining-specs
mgascam Dec 3, 2025
698a093
Remove unused emptyCart import
mgascam Dec 3, 2025
1b5c186
add test package
Nov 20, 2025
5a5874e
remove development files
Nov 20, 2025
c21f5c9
fix failing tests
Nov 21, 2025
33c7a61
chore: update woocommerce/qit-cli to dev-trunk and add .gitignore for…
mgascam Dec 1, 2025
f65a0fa
rename tests folder
mgascam Dec 1, 2025
ca9195a
Rename parent folder
mgascam Dec 1, 2025
698ac2f
feat: add .nvmrc file and update setup script for WooPayments E2E tests
mgascam Dec 1, 2025
4ee499e
feat: update test configuration and add shopper subpackage for WooPay…
mgascam Dec 1, 2025
9626216
fix: update home page test to verify visibility of site title
mgascam Dec 1, 2025
de9cfaa
chore: remove outdated migration guide for QIT test packages
mgascam Dec 1, 2025
d147c6d
fix: update QIT test package path and clean up environment configuration
mgascam Dec 1, 2025
3d95523
fix: update plugin entries in QIT test package configuration
mgascam Dec 1, 2025
5696698
feat: add QIT test package configuration and E2E test scripts
mgascam Dec 2, 2025
0c525a2
Move wc blocks tests
mgascam Dec 2, 2025
4efa989
Remove QIT custom E2E configuration.
mgascam Dec 2, 2025
a0f8100
fix: improve reliability of save payment method interaction in WC Blo…
mgascam Dec 2, 2025
92e4117
docs: update README for WooPayments QIT tests setup and execution ins…
mgascam Dec 2, 2025
a3f67df
remove comment
mgascam Dec 2, 2025
f3580e4
revert qit-cli to stable version for CI compatibility
mgascam Dec 2, 2025
0831dbe
Remove comment
mgascam Dec 2, 2025
5b19283
docs: add note about dev version of qit-cli requirement for E2E tests
mgascam Dec 2, 2025
1d9a361
Fix internal dependencies comment
mgascam Dec 2, 2025
0b6d0b8
Remove migration readme
mgascam Dec 2, 2025
c8ff3a6
Amend test instructions
mgascam Dec 2, 2025
beebe58
refactor: simplify E2E test command and update README instructions
mgascam Dec 3, 2025
3597932
fix: update test directory path for shopper project in Playwright config
mgascam Dec 3, 2025
7355c44
Migrate remaining shopper tests
mgascam Dec 3, 2025
dfccf99
Merge branch 'develop' into dev/qit-use-test-packages
mgascam Dec 9, 2025
c3d144c
update: change version of woocommerce/qit-cli to dev-trunk in compose…
mgascam Dec 9, 2025
9db1b35
update: add package-lock.json for QIT dependency management
mgascam Dec 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ vendor/*
release/*
tests/e2e/docker*
tests/e2e/deps*
tests/qit/test-package/*
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ wordpress-org-assets

tests/e2e/docker
tests/e2e/deps
tests/qit/test-package

docs/dependencies.md
docs/metadata.md
Expand Down
4 changes: 4 additions & 0 deletions changelog/dev-qit-e2e-shopper-remaining-specs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

Migrate remaining shopper E2E specs to QIT (my account, multicurrency, alternative payment methods)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"test:qit-phpstan": "npm run build:release && ./tests/qit/phpstan.sh",
"test:qit-phpstan-local": "npm run build:release && ./tests/qit/phpstan.sh --local",
"test:qit-malware": "npm run build:release && ./tests/qit/malware.sh --local",
"test:qit-e2e": "./tests/qit/e2e-runner.sh",
"test:qit-e2e": "./vendor/bin/qit run:e2e woocommerce-payments --config tests/qit/qit.json --profile=default",
"watch": "webpack --watch",
"hmr": "webpack server",
"start": "npm run watch",
Expand Down
61 changes: 41 additions & 20 deletions tests/qit/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,61 @@
## WooCommerce Payments QIT tests
## WooPayments QIT Tests

We use the [QIT toolkit](https://qit.woo.com/docs/) for automated testing including security, PHPStan, and E2E tests.

#### Setup
- Create `local.env` inside the `tests/qit/config/` directory by copying the variables from `default.env`.
- To get the actual values for local config, refer to this [secret store](https://mc.a8c.com/secret-store/?secret_id=11043) link.
- Use standard `KEY=VALUE` format (no `export` keyword needed).
- Once configured, the first time you run a test command, it will create a local auth file for subsequent runs.
### Setup

#### Running Tests
1. Create `local.env` inside the `tests/qit/config/` directory by copying the variables from `default.env`.
2. Use standard `KEY=VALUE` format (no `export` keyword needed).
3. Configure the required credentials:
- **QIT authentication**: Get credentials from the [secret store](https://mc.a8c.com/secret-store/?secret_id=11043). These authenticate you with the QIT service.
- **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.
4. Once configured, the first time you run a test command, it will create a local auth file for subsequent runs.

**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.

### Running Tests

#### Security and PHPStan tests

**Security and PHPStan tests:**
```bash
npm run test:qit-security
npm run test:qit-phpstan
npm run test:qit-phpstan-local # Against local development build
```

**E2E tests:**
#### E2E Tests

E2E tests use the [QIT Test Packages](https://qit.woo.com/docs/test-packages/) approach. Tests are located in `tests/qit/test-package/`.

Before running E2E tests, build the plugin package:

```bash
# Run all E2E tests
npm run test:qit-e2e
npm run build:release
```

This creates `woocommerce-payments.zip` which is used by QIT. Then run the tests with the required environment variables:

```bash
# Run all E2E tests (prepend with env vars from local.env)
E2E_JP_SITE_ID='<value>' E2E_JP_BLOG_TOKEN='<value>' E2E_JP_USER_TOKEN='<value>' npm run test:qit-e2e

# Run specific test file
npm run test:qit-e2e tests/qit/e2e/specs/woopayments/shopper/shopper-checkout-purchase.spec.ts
# Run specific test file (passthrough to Playwright)
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
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The command shown uses double dashes -- -- which may be confusing. The first -- is npm's argument separator to pass arguments to the underlying script, and the second -- is likely Playwright's separator. Consider adding a brief explanation or simplifying the example to make it clearer for users, such as:

# Run specific test file
npm run test:qit-e2e -- -- shopper-checkout-purchase.spec.ts
# The first -- passes args to npm script, second -- passes to Playwright

Copilot uses AI. Check for mistakes.

# Run tests with specific tag
npm run test:qit-e2e -- --tag=@basic
# Run tests filtered by tag (e.g., @blocks, @shopper)
E2E_JP_SITE_ID='<value>' E2E_JP_BLOG_TOKEN='<value>' E2E_JP_USER_TOKEN='<value>' npm run test:qit-e2e -- -- --grep "@blocks"
```

**Note:** E2E tests require valid Jetpack credentials in `local.env` (`E2E_JP_SITE_ID`, `E2E_JP_BLOG_TOKEN`, `E2E_JP_USER_TOKEN`).
**Tip:** You can export the variables once per shell session instead of prepending each command:

- The commands use `build:release` to create `woocommerce-payments.zip` at the root of the directory which is then uploaded and used for the QIT tests.
```bash
set -a && source tests/qit/config/local.env && set +a
npm run test:qit-e2e
```

### Analyzing Results

#### Analysing results
- Once the test run is done, you'll see a result URL along with the test summary.
- Look at any errors that might have been surfaced and associate with PRs that has introduced the same by using `git blame`.
- Once the test run completes, you'll see a result URL along with the test summary.
- Look at any errors that might have been surfaced and associate with PRs that introduced them using `git blame`.
- Ping the author for fixing the error, or fix it yourself if it is straightforward enough.
- For failed tests, check the artifacts directory for screenshots and error context.
244 changes: 0 additions & 244 deletions tests/qit/e2e-runner.sh

This file was deleted.

26 changes: 0 additions & 26 deletions tests/qit/e2e/.eslintrc.js

This file was deleted.

Loading
Loading