https://github.com/clerk/clerk-playwright-nextjs
An example repository for E2E testing with Clerk + Nextjs + Playwright
https://github.com/clerk/clerk-playwright-nextjs
Last synced: 4 months ago
JSON representation
An example repository for E2E testing with Clerk + Nextjs + Playwright
- Host: GitHub
- URL: https://github.com/clerk/clerk-playwright-nextjs
- Owner: clerk
- Created: 2024-04-04T17:01:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-27T18:33:53.000Z (5 months ago)
- Last Synced: 2026-02-27T22:51:29.700Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 107 KB
- Stars: 21
- Watchers: 4
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next.js + Playwright + Clerk
This example uses:
- Next.js 16.x
- Playwright 1.x
- Clerk (NextJS 6.x)
### Getting Started
To run the current example test, you'll need dev instance keys, a test user with username and password, and have `username` and `password` authentication enabled in the Clerk Dashboard.
You need the following environment variables in the `.env.local` file:
```bash
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_XXX
CLERK_SECRET_KEY=sk_test_XXX
E2E_CLERK_USER_USERNAME=username
E2E_CLERK_USER_PASSWORD=password
```
### Install dependencies
```bash
npm install
```
### Install test dependencies
```bash
npx playwright install-deps
```
### Run tests
```bash
npm run test:e2e
```
### Run the GitHub Actions workflow
To run the **GitHub Actions** workflow, set the environment variables in the repository settings. After that, manually trigger the workflow from the **GitHub Actions** tab.
```shell
# secrets
CLERK_SECRET_KEY
E2E_CLERK_USER_USERNAME
E2E_CLERK_USER_PASSWORD
# vars
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
```