clerk-testing

Configures end-to-end authentication flow tests for Clerk apps using Playwright or Cypress.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/DimonikRV/ghost-pilot-project --skill clerk-testing-dimonikrv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-testing
Source: https://github.com/DimonikRV/ghost-pilot-project/tree/main/.agents/skills/clerk-testing
Command: npx skills add https://github.com/DimonikRV/ghost-pilot-project --skill clerk-testing-dimonikrv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing authentication flows in Clerk-powered applications is difficult because bot detection blocks automated sign-ins and each test needs isolated session state. This Skill guides you through setting up reliable E2E auth tests without flaky failures. ## Core Features & Use Cases - Framework Guidance: Provides decision-tree documentation for both Playwright and Cypress testing setups. - Bot Detection Bypass: Uses setupClerkTestingToken() with a CLERK_TESTING_TOKEN so automated tests pass Clerk's bot checks. - Session State Management: Persists auth via storageState so tests skip repetitive UI sign-ins and run faster. - Use Case: You are building a Next.js app with Clerk and need CI-friendly E2E tests. Follow the workflow to initialize clerkSetup(), fetch the official Playwright guide, and reuse stored auth state across your test suite. ## Quick Start Set up Clerk E2E testing with Playwright in my Next.js app using test API keys and a testing token.

Frequently Asked Questions about clerk-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Clerk authentication with Playwright?▼

Use clerkSetup() to initialize the test environment and call setupClerkTestingToken() before navigating to auth pages. Save authenticated state with storageState so subsequent tests skip the UI sign-in flow.

How do I set up Clerk testing in Cypress?▼

Add addClerkCommands({ Cypress, cy }) to your Cypress support file to register Clerk-specific commands. Then follow the official Cypress testing guide and use setupClerkTestingToken() to bypass bot detection.

Why do my Clerk E2E tests fail with bot detection errors?▼

Clerk's bot detection blocks automated sign-ins by default. Call setupClerkTestingToken() before navigating to auth pages, using a CLERK_TESTING_TOKEN obtained from the Clerk dashboard.

Can I use production Clerk keys in automated tests?▼

No, production keys in tests are a security risk and may trigger protections. Always use test API keys in the pk_test_xxx and sk_test_xxx formats for E2E testing.

How do I speed up Clerk auth tests that sign in every time?▼

Persist the authenticated session using Playwright's storageState after one sign-in, then reuse it across tests. This avoids slow UI-based sign-in flows in every test case.