clerk-testing
Installation
Summary
E2E testing utilities for Clerk authentication flows in Playwright and Cypress.
- Supports both Playwright and Cypress frameworks with framework-specific setup patterns (globalSetup for Playwright, custom commands for Cypress)
- Provides
clerkSetup()andsetupClerkTestingToken()utilities to initialize test environments and bypass bot detection - Includes
storageStatepersistence to reuse authenticated sessions across tests, reducing test execution time - Requires test API keys (
pk_test_*,sk_test_*) and offers best practices for avoiding common pitfalls like production credentials and repeated UI-based sign-ins
SKILL.md
Testing
Decision Tree
| Framework | Documentation |
|---|---|
| Overview | https://clerk.com/docs/guides/development/testing/overview |
| Playwright | https://clerk.com/docs/guides/development/testing/playwright/overview |
| Cypress | https://clerk.com/docs/guides/development/testing/cypress/overview |
Mental Model
Test auth = isolated session state. Each test needs fresh auth context.
clerkSetup()initializes test environmentsetupClerkTestingToken()bypasses bot detectionstorageStatepersists auth between tests for speed
Workflow
Related skills
More from clerk/skills
clerk-nextjs-patterns
Advanced Next.js patterns - middleware, Server Actions, caching with
11.2Kclerk
Clerk authentication router. Use when user asks about adding authentication,
7.7Kclerk-setup
Add Clerk authentication to any project by following the official quickstart
6.9Kclerk-custom-ui
Custom authentication flows and component appearance - hooks (useSignIn,
6.7Kclerk-webhooks
Clerk webhooks for real-time events and data syncing. Verify with verifyWebhook
6.0Kclerk-orgs
Clerk Organizations for B2B SaaS - create multi-tenant apps with org
5.3K