Skip to content

jeremy-clerk/clerk-playwright-example

Repository files navigation

Test Repo Example w/Playwright

Configure .env.local

Rename .env.example

mv ./.env.example ./.env.local

Paste in your keys from the Clerk dashboard.

Install Deps

npm i

Configure global.setup.ts

Update the clerk.signIn

 signInParams: {
      strategy: "password",
      identifier: "[email protected]", 
      password: "##@this-is-a-test-password!@@", //update this to a new password 
    }

Configure app.spec.ts

Update the clerk.signIn

signInParams: { strategy: 'password', identifier: '[email protected]', password: '##@this-is-a-test-password!@@' }

Configure User in Clerk Dashboard

  • Enable password in Authentication strategies
  • Enable test mode in Settings
  • Create the user
    • Set the passsword and email that you used in the app.spec.ts and global.setup.ts

Run the test

npm run test:e2e

output: 
> playwright test

baseURL http://localhost:3000

Running 3 tests using 1 worker

baseURL http://localhost:3000
  ✓  1 [global setup] › global.setup.ts:8:6 › global setup (254ms)
  ✓  2 [global setup] › global.setup.ts:17:6 › authenticate (1.8s)
baseURL http://localhost:3000
  ✓  3 [Main tests] › app.spec.ts:4:5 › sign in (1.9s)

  3 passed (13.1s)

About

Clerk playwright example repro

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published