v0.4.6 Available

Test Reality.
Control the Rest.

Playwright tests that hit your real server. Your Server Components, routes, middleware, and business logic execute for real. Scenarist mocks only external APIs—switchable per test.

Get Started

Built for full-stack frameworks

scenario.ts | checkout.spec.ts
Define Scenario
const successScenario = {
  id: 'payment_success',
  mocks: [{
    url: 'https://api.stripe.com/*',
    method: 'POST',
    response: {
      status: 200,
      body: { paid: true }
    }
  }]
};
Run Test
test('checkout flow', async ({ page }) => {
  await switchScenario(page, 'payment_success');

  // Hits real Next.js backend
  await page.goto('/checkout');
  await page.click('#pay-button');

  // Real DB, Real Middleware, Mocked Stripe
  await expect(page).toHaveURL('/success');
});

Why Scenarist?

The Testing Gap

Fast like unit tests, realistic like integration tests

Parallel Execution

Isolated test state means unlimited parallelism

Behavior Testing

Test scenarios, not implementation details

Only mock what you don't control

Scenarist acts as a precision scalpel. It slices off external dependencies while leaving your application logic perfectly intact.

Your Application
Running Real Code

Executes For Real

Server Components
API Routes
Middleware
Zod Validation
Session Cookies
The Edge

Mocked by Scenarist

Stripe API JSON
Auth0 JWT
SendGrid 202