Conversation
…d with playwright Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
…t hides elsewhere Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
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 PHP suites check the theme hooks one by one, but the flows a customer goes through run in the browser: the WooCommerce checkout block validates in JavaScript, the CPF/CNPJ field is shown or hidden by the theme script, and the lost password page is printed and ends the request with
exit. This adds a Playwright suite for those flows.Flows
tests/E2E/Inc/Registration.spec.ts, creating a workspace together with a plan: a visitor without a plan in the cart is sent to choose one; with a plan, the workspace is created and the customer continues to checkout; without the terms consent (therequiredattribute removed, so the server check runs) the workspace is refused.tests/E2E/Inc/Checkout.spec.ts, the policy consent: the terms text links to the policy, an order without the consent is refused, and with it the order is placed.tests/E2E/Inc/CpfCnpj.spec.ts, the CPF/CNPJ field: shown in Brazil and hidden when the country changes, required in Brazil, and an invalid CPF is refused. The theme script refuses these before the order is sent, so the server check ininc/cpf-cnpj.phpstays covered by the integration tests.tests/E2E/Inc/Account.spec.ts, the lost password page:/lost-password/renders the form on its own page, and the account page links to it.Setup
tests/E2E/docker-compose.ymlruns WordPress 7.1 on PHP 8.3 at:8889, with this theme and WooCommerce fromvendor/test-plugins, so acomposer installcomes first.support/setup.shinstalls the site, activates the theme, turns on account registration and the check payments gateway, andsupport/seed.phpcreates the WooCommerce pages and a "Basic" plan. The seed only runs once, soenv:startcan be run again.test:e2e,test:e2e:ui,env:start,env:stop. Results go totests/E2E/.resultsandtests/E2E/.report, both ignored.playwright.ymlinstalls Composer and Node dependencies, starts the stack, runs the suite with thegithuband HTML reporters, and uploads the report withinclude-hidden-files: true, since the report folder is hidden.readme.txtsays how to run it.Verification
npm run env:start && npm run test:e2epasses: 11 tests. It also passes afterenv:stopand a fresh start, and whenenv:startruns again on a started stack.