clerk-testing

Set up Clerk authentication end-to-end tests with isolated session state.

Updated May 30, 2026
One-click install
npx skills add https://github.com/Athone88/Anima --skill clerk-testing-athone88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-testing
Source: https://github.com/Athone88/Anima/tree/main/.agents/skills/clerk-testing
Command: npx skills add https://github.com/Athone88/Anima --skill clerk-testing-athone88

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clerk authentication flows are hard to test reliably because each test needs isolated auth context and the correct Clerk testing token setup.

Core Features & Use Cases

  • Test auth with isolated session state: keeps auth context fresh for each test to reduce flakiness.
  • Deterministic test setup helpers: uses clerkSetup() and setupClerkTestingToken() to initialize the test environment and bypass bot detection for Clerk E2E runs.
  • Fast and reusable auth sessions: supports persisting authentication between tests using storageState.

Quick Start

Use the clerk-testing skill to set up a Playwright or Cypress E2E auth test flow using the Clerk testing token from your Clerk dashboard.

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 flows in Playwright without bot detection blocking my E2E tests?

To test Clerk authentication flows in Playwright without bot detection, use the `setupClerkTestingToken()` helper with your `CLERK_TESTING_TOKEN` to bypass bot detection and initialize the test environment for E2E runs.

What is the best way to keep Clerk auth sessions isolated between Cypress tests?

The best way to keep Clerk auth sessions isolated between Cypress tests is to use isolated session state helpers that keep auth context fresh for each test, reducing flakiness and preventing state bleed across your E2E suite.

Can I reuse and persist Clerk authentication state across multiple E2E tests?

Yes, you can reuse and persist Clerk authentication state across multiple E2E tests by utilizing `storageState` to maintain fast, reusable auth sessions, avoiding the need to log in from scratch during every test run.

Do I need a specific Clerk testing token to run E2E auth tests?

Yes, you need a `CLERK_TESTING_TOKEN` from your Clerk dashboard to run E2E auth tests, and the setup strictly supports using only `pk_test_*` and `sk_test_*` keys for configuring your Playwright or Cypress environment.

Why are my Clerk E2E tests flaky when navigating to auth pages?

Clerk E2E tests are often flaky when navigating to auth pages because auth context is not properly isolated, which you can fix by applying deterministic test setup helpers like `clerkSetup()` to keep session state fresh.