test: add a playwright suite for the account and subscription flows - #12
Merged
Merged
Conversation
YvesCesar
marked this pull request as draft
September 15, 2026 22:06
YvesCesar
marked this pull request as ready for review
September 16, 2026 22:13
vitormattos
requested changes
Sep 16, 2026
YvesCesar
force-pushed
the
refactor/decision-logic-in-src
branch
from
September 16, 2026 23:02
2852b63 to
011fb74
Compare
YvesCesar
force-pushed
the
test/e2e-playwright
branch
from
September 16, 2026 23:02
0572b21 to
30abddd
Compare
YvesCesar
force-pushed
the
refactor/decision-logic-in-src
branch
from
September 17, 2026 20:58
011fb74 to
a8eb740
Compare
YvesCesar
force-pushed
the
test/e2e-playwright
branch
from
September 17, 2026 20:59
30abddd to
5d327d9
Compare
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
YvesCesar
force-pushed
the
test/e2e-playwright
branch
from
September 17, 2026 21:21
5d327d9 to
c4ad0df
Compare
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
vitormattos
approved these changes
Sep 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The plugin had no browser tests. This adds a Playwright suite over the flows the PHPUnit suite cannot reach, on top of the refactor from #11 (hence the base branch; it retargets to
mainonce #9, #10 and #11 are merged).The suite
tests/E2E/mirrorssrc/the waytests/Unit/already does, with.spec.tsin place ofTest.php. Fifteen tests in three files, one per class whose behaviour only appears with WooCommerce loaded, the rewrite rules in place and a browser driving them:Account/Navigation.spec.ts— the five entries and their order, the three renamed labels, the endpoint title, the payment methods and the addresses merged into the billing screen, the redirect from the standalone addresses list, the highlighting while an address is edited, and the Nextcloud CTA.Account/RootEndpoint.spec.ts—/orders/,/payment-methods/and/lost-password/answering from the site root instead of being collapsed back to the front page by a canonical redirect, and/my-account/still working as an alias.Subscription/StatusChange.spec.ts— cancelling from the account: the prompt instead of the cancellation, backing out, and confirming.The site under test
The suite drives a WordPress that is already up, named by
WP_BASE_URLandWP_CLI. The defaults are the local SaaS stack, sonpm run test:e2etakes no arguments there.tests/E2E/support/seed.phpdescribes the preconditions — My Account as the front page, a customer with a known password, an active subscription — and is applied throughwp eval-file -, reading the script from stdin so no path has to line up between host and container. It runs again before each test that changes the subscription, and it leaves the customer's password alone when it already matches, which is what keeps the browser session alive across a reseed..wp-env.jsondescribes a disposable site with the same three plugins, which is what the newe2e.ymlworkflow runs. Two differences from the local stack had to be spelled out there:.wp-env.jsonmaps a mu-plugin that declares one..htaccess. The seed asks WP-CLI for a hard flush, which writes it.Two things worth pointing out
pending-cancel, notcancelled: WooCommerce Subscriptions honours the term already paid for. The test asserts what the software does, and the prompt the plugin shows is the one the customer sees before that happens.tests/E2E/support/*.phpis excluded from PHPStan. Both files run inside a WordPress that has WooCommerce Subscriptions and WP-CLI loaded, and there are no stubs for either. PHPCS andparallel-lintstill cover them, and every E2E run exercises them.Verification
The suite is green in both environments: 15 passed against the local stack, and 15 passed against
wp-envwithWP_BASE_URL=http://localhost:8888 WP_CLI="npx wp-env run cli wp".composer ciis still green — 239 PHPUnit tests, no lint, PHPCS or PHPStan findings.