https://github.com/sambego/cypress-auth0-spa
https://github.com/sambego/cypress-auth0-spa
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/sambego/cypress-auth0-spa
- Owner: Sambego
- Created: 2020-07-07T12:07:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T10:51:03.000Z (over 3 years ago)
- Last Synced: 2025-04-12T07:59:25.193Z (about 1 year ago)
- Language: JavaScript
- Size: 5.19 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Setup
- Add Auth0 credentials to [src/config.js](https://github.com/Sambego/cypress-auth0-spa/blob/master/src/config.js)
- Add Auth0 credentials to [cypress.json](https://github.com/Sambego/cypress-auth0-spa/blob/master/cypress.json)
- Compile and watch with `npm run dev`
- Run dev server with `npm run start`
- Run tests with `npm run test`
Optionally
- When changing things in the code, run `npm run dev` to recompile the code.
## Cypress task usage
```js
describe("Auth0 cypress command test", () => {
it("Navigates trough the website", () => {
// Go to the homepage
cy.visit("http://localhost:8080").then(() => {
cy.loginWithAuth0(Cypress.env("username"), Cypress.env("password"));
...
cy.logout();
});
});
});
```
The Cypress command assumes the Auth0 credentials, a username and password are set in the `cypress.json` file.
