clerk-testing

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

Updated Sep 19, 2026
One-click install
npx skills add https://github.com/paramcodes/autobro --skill clerk-testing-paramcodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-testing
Source: https://github.com/paramcodes/autobro/tree/main/.agents/skills/clerk-testing
Command: npx skills add https://github.com/paramcodes/autobro --skill clerk-testing-paramcodes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing authentication flows in Clerk-powered applications is tricky 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 manual trial and error. ## Core Features & Use Cases - Framework Decision Tree: Routes you to official Clerk testing documentation for Playwright or Cypress based on your test framework. - Auth Session Management: Explains how to use clerkSetup(), setupClerkTestingToken(), and storageState to bypass bot detection and persist auth between tests. - Anti-Pattern Detection: Flags common mistakes like using production keys in tests or performing UI-based sign-in for every test. - Use Case: You are adding E2E tests to a Next.js app with Clerk authentication. The Skill walks you through generating development keys with clerk init, configuring the testing token, and reusing stored auth state for fast test runs. ## Quick Start Set up Playwright end-to-end tests for the Clerk authentication flows in my Next.js app.

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 Playwright's globalSetup to initialize the test environment, then call `setupClerkTestingToken()` before navigating to auth pages. Save authenticated state with `storageState` so subsequent tests skip UI-based sign-in.

How to set up Clerk testing in Cypress?▼

Add `addClerkCommands({ Cypress, cy })` to your Cypress support file to register Clerk-specific commands. Follow the official Cypress testing guide at clerk.com for full configuration with your development keys.

Why do Clerk E2E tests fail with bot detection?▼

Clerk's bot detection blocks automated sign-in attempts by default. Call `setupClerkTestingToken()` before navigating to auth pages to bypass detection and allow programmatic authentication in tests.

Can I use production Clerk keys in tests?▼

No, production keys in tests are a security risk. Use development-instance keys (`pk_test_*` and `sk_test_*`), which can be auto-generated by running `npx clerk@latest init` without needing a Clerk account.

How do I speed up Clerk authentication tests?▼

Avoid UI-based sign-in in every test by saving auth state with Playwright's `storageState` after one sign-in. Reusing the persisted session across tests significantly reduces execution time.