clerk-testing

Set up Clerk authentication end-to-end testing in Playwright or Cypress.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clerk authentication tests can be brittle and slow when sessions are not isolated or when bot-protection and auth tokens are handled incorrectly.

Core Features & Use Cases

  • Decision support for test frameworks: Choose the right setup path for Playwright or Cypress based on Clerk’s official testing guides.
  • Token-based test auth flow: Use Clerk’s testing token mechanism (including CLERK_TESTING_TOKEN) to bypass bot detection during tests.
  • Faster, stable test runs: Persist authentication between tests using storageState to avoid repeatedly signing in.

Quick Start

Start by identifying whether you are using Playwright or Cypress, then follow the corresponding Clerk testing guide and initialize the Clerk test environment using the testing token before navigating to auth pages.

Frequently Asked Questions about clerk-testing

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

FAQPage Schema
How do I bypass bot detection during Clerk authentication tests?

To bypass bot detection during Clerk authentication tests, use the testing token mechanism by configuring the CLERK_TESTING_TOKEN environment variable from your Clerk dashboard before running your e2e test suite.

How do I persist Clerk authentication state in Playwright to speed up test runs?

Persist Clerk authentication state in Playwright by saving the browser session using storageState, which avoids repeatedly signing in and ensures faster, more stable isolated test runs across your test suite.

Does Clerk testing work with both Playwright and Cypress frameworks?

Yes, Clerk testing works with both Playwright and Cypress by providing framework-specific setup paths and workflows, including leveraging storageState and Clerk UI selectors for reliable automated browser authentication testing.

Why are my Clerk e2e tests failing with isolated session states?

Clerk e2e tests fail with isolated session states if auth tokens are mishandled or bot-protection is triggered, requiring the CLERK_TESTING_TOKEN and pk_test_ or sk_test_ keys for proper test environment initialization.

What selectors should I use for reliable Clerk UI detection in Cypress?

For reliable Clerk UI detection in Cypress, use the [data-clerk-component] attribute selectors, which provide stable targeting for authentication elements and prevent brittle test failures during automated browser interactions.