-
Notifications
You must be signed in to change notification settings - Fork 73
[E2E][QIT] Migrate to Test Packages infrastructure #11175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mgascam
wants to merge
26
commits into
develop
Choose a base branch
from
dev/qit-use-test-packages
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+931
−710
Draft
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d801eeb
add test package
46c82d0
remove development files
53ac3d9
fix failing tests
79ec438
chore: update woocommerce/qit-cli to dev-trunk and add .gitignore for…
mgascam 390bdd9
rename tests folder
mgascam 946f6b4
Rename parent folder
mgascam 3fd0e69
feat: add .nvmrc file and update setup script for WooPayments E2E tests
mgascam 5d0cd5e
feat: update test configuration and add shopper subpackage for WooPay…
mgascam 3dcb1de
fix: update home page test to verify visibility of site title
mgascam 45bd62d
chore: remove outdated migration guide for QIT test packages
mgascam 4cf2b28
fix: update QIT test package path and clean up environment configuration
mgascam 770059f
fix: update plugin entries in QIT test package configuration
mgascam dc1e43b
feat: add QIT test package configuration and E2E test scripts
mgascam 33d24e1
Move wc blocks tests
mgascam 0aeaf4a
Remove QIT custom E2E configuration.
mgascam ac22d68
fix: improve reliability of save payment method interaction in WC Blo…
mgascam 4b0080a
docs: update README for WooPayments QIT tests setup and execution ins…
mgascam 8949a12
remove comment
mgascam 2a3fa10
revert qit-cli to stable version for CI compatibility
mgascam 3d53ccc
Remove comment
mgascam cef58d1
docs: add note about dev version of qit-cli requirement for E2E tests
mgascam aa42127
Fix internal dependencies comment
mgascam 1637b12
Remove migration readme
mgascam c8e0f68
Amend test instructions
mgascam 987bfec
refactor: simplify E2E test command and update README instructions
mgascam 52eeeb6
fix: update test directory path for shopper project in Playwright config
mgascam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,4 @@ vendor/* | |
| release/* | ||
| tests/e2e/docker* | ||
| tests/e2e/deps* | ||
| tests/qit/test-package/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,66 @@ | ||
| ## 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. To get the actual values for local config, refer to this [secret store](https://mc.a8c.com/secret-store/?secret_id=11043) link. | ||
| 3. Use standard `KEY=VALUE` format (no `export` keyword needed). | ||
| 4. Once configured, the first time you run a test command, it will create a local auth file for subsequent runs. | ||
|
|
||
| ### 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/`. | ||
|
|
||
| ```bash | ||
| # Run all E2E tests | ||
| 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 tests matching a pattern (e.g., @shopper tag, test name, or file path) | ||
| npm run test:qit-e2e:args -- --grep "@shopper" | ||
| npm run test:qit-e2e:args -- --grep "shopper-checkout-purchase" | ||
| ``` | ||
|
|
||
| You can also run QIT directly for more control: | ||
|
|
||
| ```bash | ||
| # Run all tests | ||
| ./vendor/bin/qit run:e2e woocommerce-payments \ | ||
| --config tests/qit/qit.json \ | ||
| --profile=default \ | ||
| --env_file tests/qit/config/local.env | ||
|
|
||
| # Run specific test file via Playwright options | ||
| ./vendor/bin/qit run:e2e woocommerce-payments \ | ||
| --config tests/qit/qit.json \ | ||
| --profile=default \ | ||
| --env_file tests/qit/config/local.env \ | ||
| --pw_options "woopayments/shopper/shopper-checkout-purchase.spec.ts" | ||
|
|
||
| # Run tests with specific tag | ||
| npm run test:qit-e2e -- --tag=@basic | ||
| ./vendor/bin/qit run:e2e woocommerce-payments \ | ||
| --config tests/qit/qit.json \ | ||
| --profile=default \ | ||
| --env_file tests/qit/config/local.env \ | ||
| --pw_test_tag="@critical" | ||
| ``` | ||
|
|
||
| **Note:** E2E tests require valid Jetpack credentials in `local.env` (`E2E_JP_SITE_ID`, `E2E_JP_BLOG_TOKEN`, `E2E_JP_USER_TOKEN`). | ||
|
|
||
| - 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. | ||
|
|
||
| ### 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. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.