Guides / Time Machine

How to test renewals with Chargebee's Time Machine

Last updated

You can't wait a month to see if a renewal invoice is right. Chargebee's Time Machine lets a test site jump forward in time so you can check it today.

What the Time Machine does

On a Chargebee test site, the Time Machine moves the site's clock forward. Anything that would have happened in between runs: subscriptions renew, trials end and invoices are created. It only exists on test sites.

Typical things to test with it:

The manual way

With the API

Each test site has a single time machine called delorean.

Travel runs in the background. Check the status until it's finished before you look at invoices, or you'll see half-finished results.

A typical manual test

  1. Create a customer and a subscription.
  2. Record usage, if the plan is metered.
  3. Travel forward one month and wait until it's done.
  4. Open the new invoice and check the total by hand.

This works, but you have to repeat every step each time you change a price. That's where mistakes slip in.

Note: time travel moves the whole site, not one customer. Every subscription on the site moves forward with it. That's another reason to keep a separate, clean test site.

The faster way with Testabee

In Testabee you write a test once as a short script and run it as often as you like:

subscribe pro-EUR-Monthly, seats-EUR-Monthly x5
usage api-calls-EUR 1000
travel 1 month
expect invoice 129.00

Each run creates a fresh customer, runs the steps in order, waits for time travel to finish and checks the invoice total. If the total is wrong, the run stops and shows you which line failed. Scenarios only run on test sites.

You can also move the site's clock forward directly from Testabee's tools, without writing a script.

Test renewals without waiting

Free for one test site. No credit card needed.

Start free

More guides