test(functional-tests): Add functional test for the Free Access Program#20860
Open
StaberindeZA wants to merge 1 commit into
Open
test(functional-tests): Add functional test for the Free Access Program#20860StaberindeZA wants to merge 1 commit into
StaberindeZA wants to merge 1 commit into
Conversation
033d32d to
dfc59ce
Compare
Because: * The Free Access Program (PAY-3780) grants subscription capabilities to users configured in Strapi without an actual subscription, and there was no automated coverage confirming the capability is broadcast. This commit: * Adds a functional test that provisions the configured free-access account and asserts the auth-server profile returns the `123donePro` capability under `subscriptionsByClientId`. * Sources the account password from FREE_ACCESS_PROGRAM_PWD (skips when unset) and skips in production, since the feature relies on environment-specific Strapi configuration. Closes PAY-3781
dcb0328 to
a33e958
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Playwright functional test to validate that the Free Access Program correctly grants and exposes the expected capability via the auth-server /account/profile response, protecting against regressions in the Strapi-driven “capability without subscription” path.
Changes:
- Added a new payments-next functional test that provisions/signs-in a configured free-access account and asserts
subscriptionsByClientIdincludes123donePro. - Added environment-based skipping behavior (skip in production; skip when
FREE_ACCESS_PROGRAM_PWDis unset).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+47
to
+51
| // Track for automatic teardown so each run starts from a clean slate. | ||
| testAccountTracker.accounts.push({ | ||
| email: FREE_ACCESS_EMAIL, | ||
| password, | ||
| }); |
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.
Because
configured in Strapi without an actual subscription, but there was no
automated coverage confirming the granted capability is actually broadcast.
This adds a functional test so regressions in that path are caught.
This pull request
packages/functional-tests/tests-payments-next/free-access-program.spec.ts,a functional test that provisions the configured free-access account
(
123donefreeaccess@restmail.net) and asserts the auth-server profile returnsthe
123doneProcapability undersubscriptionsByClientId.FREE_ACCESS_PROGRAM_PWDenvironmentvariable (skipping when unset), and skips in production, since the feature
depends on environment-specific Strapi configuration.
Issue that this pull request solves
Closes: PAY-3781
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Running this test requires the target environment to have the Free Access
Program enabled (
FREE_ACCESS_PROGRAM_ENABLED) with Strapi configured to grant123doneProto123donefreeaccess@restmail.net, andFREE_ACCESS_PROGRAM_PWDprovided as a CI secret. The test skips automatically when
FREE_ACCESS_PROGRAM_PWDis unset and in production.