clerk-testing

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

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/Rajaryan1726/ai-code-review-system --skill clerk-testing-rajaryan1726
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-testing
Source: https://github.com/Rajaryan1726/ai-code-review-system/tree/main/client/.agents/skills/clerk-testing
Command: npx skills add https://github.com/Rajaryan1726/ai-code-review-system --skill clerk-testing-rajaryan1726

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing E2E tests for Clerk-authenticated apps is tricky because bot detection blocks automated sign-ins and repeating UI-based login in every test is slow. This Skill guides the AI to set up Clerk testing correctly with testing tokens and persisted auth state. ## Core Features & Use Cases - Framework Decision Tree: Routes to the official Clerk testing documentation for Playwright or Cypress based on your test framework. - Auth Session Management: Explains clerkSetup(), setupClerkTestingToken(), and storageState so tests bypass bot detection and reuse authenticated sessions. - Anti-Pattern Detection: Flags common mistakes like using production keys in tests or skipping the testing token setup. - Use Case: You have a Next.js app protected by Clerk and want Playwright tests that sign in once and run the rest of the suite against a persisted authenticated session. ## Quick Start Set up Playwright E2E tests for my Clerk-authenticated app using a testing token and shared auth state.

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() in globalSetup to initialize the test environment, then call setupClerkTestingToken() before navigating to auth pages. Save the authenticated session with storageState so subsequent tests skip the 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. Follow the official Clerk Cypress testing guide for full configuration with your test API keys.

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

Clerk's bot detection blocks automated sign-in attempts by default. Call setupClerkTestingToken() before navigating to any auth page to bypass detection, using a CLERK_TESTING_TOKEN from your Clerk dashboard.

Can I use production Clerk keys in tests?▼

No, production keys in tests are a security risk and are flagged as an anti-pattern. Always use test API keys in the pk_test_* and sk_test_* formats for E2E testing.

How do I speed up Clerk authentication tests?▼

Avoid UI-based sign-in in every test by saving the authenticated session with Playwright's storageState after one login. Subsequent tests load the saved state instead of repeating the sign-in flow.