Skip to main content

Production Testing Tokens

Category
Testing
Published

Testing Tokens are now supported in production environments

Testing Tokens allow your automated tests to bypass Clerk's bot protections that might otherwise be triggered when interacting with Clerk-powered applications via automated browser agents. Previously, Testing Tokens were only for testing against Clerk development instances. With this update, Testing Tokens are now supported by Clerk production instances, allowing you to write tests against your production environment.

To make testing authenticated pages easier, the existing signIn test helper now allows authenticating a user directly by email address.

import { signIn } from '@clerk/testing/playwright'

test('sign in', async ({ page }) => {
  await signIn({ emailAddress: process.env.TEST_USER_EMAIL, page })

  // Navigate to a protected page for additional testing
  await page.goto('/protected')
})

To learn more about Testing Tokens, visit the documentation.

Contributors
Bryce Kalow
Alex Ntousias

Share this article