-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(testing): Introduce support for the Cypress framework #3378
Conversation
馃 Changeset detectedLatest commit: 80a6440 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
!snapshot |
Hey @anagstef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/testing@1.1.0-snapshot.v641a910 --save-exact |
* feat(testing): Introduce support for the Cypress framework * chore(testing): Update README * chore(testing): Fix typos
Description
This PR adds support for the Cypress framework. It's been tested on the latest version of Cypress (v13).
All utilities related to Cypress are exported from the subpath
@clerk/testing/cypress
.Also, this PR adds an Error to be thrown if someone tries to import from the package's root path (
@clerk/testing
).Usage
Firstly, add your Clerk keys (
CLERK_PUBLISHABLE_KEY
andCLERK_SECRET_KEY
) to your environment variables file (e.g..env.local
or.env.
).You can find these keys in your Clerk Dashboard.
All Cypress related utilities are exported from
@clerk/testing/cypress
. Make sure that your import paths are correct!On your
cypress.config.ts
, you must use theclerkSetup
function to set up Clerk for your tests.Keep in mind that you must pass the Cypress
config
object to theclerkSetup
function and also return the new config object from thesetupNodeEvents
function.Then, you can use the
setupClerkTestingToken
function to bypass bot protection on your tests.Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change