clerk-testing

Initialize Clerk authentication for Playwright or Cypress end-to-end tests.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/koushik-hait/xigenis-landingpage-v1 --skill clerk-testing-koushik-hait
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-testing
Source: https://github.com/koushik-hait/xigenis-landingpage-v1/tree/main/.agents/skills/clerk-testing
Command: npx skills add https://github.com/koushik-hait/xigenis-landingpage-v1 --skill clerk-testing-koushik-hait

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It removes flaky, slow, and inconsistent end-to-end testing of Clerk authentication by ensuring each test runs with a fresh and valid Clerk auth context.

Core Features & Use Cases

  • Decision-ready framework selection: Choose Playwright or Cypress and follow the matching official testing path for Clerk.
  • Deterministic auth initialization: Initialize the Clerk testing environment with clerkSetup() and set up setupClerkTestingToken() before visiting auth pages.
  • Fast, reusable authenticated sessions: Use storageState to persist auth between tests and avoid repeating UI-based sign-in for every run.
  • Secure test credentials: Use only pk_test_* and sk_test_* keys to avoid production key leakage.
  • Framework-specific wiring: Use Playwright globalSetup for auth state or add Cypress commands via addClerkCommands({ Cypress, cy }) for file support.

Quick Start

Ask the skill to guide you through setting up Playwright-based Clerk auth E2E tests using your Clerk CLERK_TESTING_TOKEN and pk_test_*/sk_test_* keys, saving authenticated state with storageState.

Frequently Asked Questions about clerk-testing

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

FAQPage Schema
How do I set up Playwright E2E testing for Clerk auth flows?▼

To set up Playwright E2E testing for Clerk auth flows, initialize the testing environment with clerkSetup() and set up setupClerkTestingToken() before visiting auth pages, using globalSetup for auth state and pk_test_* keys.

Why are my Cypress E2E tests for Clerk authentication failing or flaky?▼

Cypress E2E tests for Clerk authentication are flaky without deterministic initialization; fix this by adding addClerkCommands({ Cypress, cy }) for file support and waiting for UI components via [data-clerk-component] selectors.

Can I reuse authenticated Clerk sessions between Playwright test runs?▼

Yes, you can reuse authenticated Clerk sessions between Playwright test runs by using storageState to persist auth state, avoiding repeated UI-based sign-in and ensuring fast, reusable E2E test execution.

Do I need a Clerk testing token to bypass bot detection in E2E tests?▼

Yes, you need a CLERK_TESTING_TOKEN to bypass bot detection during E2E tests, ensuring deterministic auth initialization and isolated session state for both Playwright and Cypress frameworks.

What test keys should I use when testing Clerk authentication flows?▼

When testing Clerk authentication flows, use only pk_test_* and sk_test_* keys to avoid production key leakage and ensure secure test credentials within your isolated E2E testing environment.

Does this Clerk testing Skill support both Playwright and Cypress?▼

Yes, this Clerk testing Skill supports both Playwright and Cypress, providing decision-ready framework selection and framework-specific wiring for deterministic auth initialization and reusable authenticated sessions.