Skip to content

clerk/example-cypress-nextjs

Repository files navigation

This is a simple Clerk+Next.js application showing how you can create and run e2e Cypress tests for your application

Accompanying documentation

https://clerk.dev/docs/testing/cypress

Getting Started

  1. Sign up for a Clerk account at https://clerk.dev.
  2. Go to Clerk's dashboard and create an application.
  3. Set the required Clerk environment variables as shown in the example env file.
  4. npm install the required dependencies.
  5. npm run dev to launch the development server.

Testing

  1. Create a test account using Clerk Dashboard or by signing up on the application.
  2. Copy the cypress.env.example.json file to cypress.env.json.
cp cypress.env.example.json cypress.env.json
  1. Set test_email and test_password to the credentials of the test account.
  2. Open Cypress while keeps the development server running:
npm run cypress:open
  1. Navigate through cypress and run the tests

e2e testing -> chrome -> start e2e testing in chrome

If you are running NOT running on localhost:3000, you will need to update the baseUrl in cypress.config.js to match your development server's URL.

About

Example repo using Clerk, Cypress and NextJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •