Rename .env.example
mv ./.env.example ./.env.local
Paste in your keys from the Clerk dashboard.
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!@@' }
- 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
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)