Group
  • Testing

    Test the full subscription lifecycle end to end

    Walk a subscription through trial, active, past due, upgrade, downgrade, cancel, and win-back in one coherent suite.

    • Improve quality
    • Debug & fix
    • Advanced
    • General

Free Prompt

My app sells subscriptions, and I want one coherent test suite that walks a subscription through its entire life, because that's where the state bugs hide. Using a mocked payment provider (or building one if my suite lacks it), write lifecycle tests that move a single subscription through: 1. Trial start (if I offer trials): access granted immediately, correct trial end date recorded. 2. Trial end with no payment method: access revoked, correct emails sent, account state reflects lapsed trial. 3. Conversion to paid: first successful charge grants full access, receipt sent, trial flags cleared. 4. Renewal: a successful renewal charge extends access to the correct new date. 5. Failed renewal: access enters the right grace or past-due state, dunning emails go out, and access is actually revoked after the grace period ends. 6. Upgrade mid-cycle: new plan's features unlock, proration is calculated the way my provider is configured to do it, old plan's features lock. 7. Downgrade: takes effect at the time my product promises (immediately or at period end), not before and not never. 8. Cancel: access continues through the paid period (if that's my policy), no further charges occur, cancellation email sent. 9. Reactivation after cancel: a returning customer can resubscribe and gets access without duplicate customer records. Assert database state and user-visible access at every step, not just that events were received. Skip whichever stages don't apply to my product, but tell me which ones you skipped. When done, run the suite and give me a stage-by-stage report of verified behavior.

What This Does / How This Helps

This tests a subscription through its whole life: trial, conversion, renewal, failed payment, plan changes, cancel, and reactivation, asserting access and billing state at each stage. Subscription bugs compound. A wrong date at renewal or a downgrade that applies a month late isn't one bug, it's a confused customer, a support thread, a refund, and a chargeback risk. The state transitions are also exactly what AI-generated billing code gets wrong, because each event handler looks reasonable in isolation while the sequence doesn't. Testing the lifecycle as a sequence catches what testing individual handlers can't.

Want to skip doing this by hand?

Fortivibe audits your app for all of the areas these prompts cover (and more).

See What We Check

Related Prompts