Skip to content

test(functional-tests): Add functional test for the Free Access Program#20860

Open
StaberindeZA wants to merge 1 commit into
mainfrom
pay-3781-add-functional-tests
Open

test(functional-tests): Add functional test for the Free Access Program#20860
StaberindeZA wants to merge 1 commit into
mainfrom
pay-3781-add-functional-tests

Conversation

@StaberindeZA

@StaberindeZA StaberindeZA commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Because

  • The Free Access Program (PAY-3780) grants subscription capabilities to users
    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

  • Adds 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 returns
    the 123donePro capability under subscriptionsByClientId.
  • Sources the account password from the FREE_ACCESS_PROGRAM_PWD environment
    variable (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 x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

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 grant
123donePro to 123donefreeaccess@restmail.net, and FREE_ACCESS_PROGRAM_PWD
provided as a CI secret. The test skips automatically when
FREE_ACCESS_PROGRAM_PWD is unset and in production.

@StaberindeZA StaberindeZA force-pushed the pay-3781-add-functional-tests branch from 033d32d to dfc59ce Compare July 14, 2026 17:19
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
@StaberindeZA StaberindeZA force-pushed the pay-3781-add-functional-tests branch from dcb0328 to a33e958 Compare July 14, 2026 19:38
@StaberindeZA StaberindeZA marked this pull request as ready for review July 14, 2026 19:38
@StaberindeZA StaberindeZA requested a review from a team as a code owner July 14, 2026 19:38
Copilot AI review requested due to automatic review settings July 14, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 subscriptionsByClientId includes 123donePro.
  • Added environment-based skipping behavior (skip in production; skip when FREE_ACCESS_PROGRAM_PWD is 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,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants