Skip to content

Instantly share code, notes, and snippets.

@hernanif1
Created November 11, 2019 16:16
Show Gist options
  • Save hernanif1/cc3b36c21b43c8106ca02bac2dc1cfaf to your computer and use it in GitHub Desktop.
Save hernanif1/cc3b36c21b43c8106ca02bac2dc1cfaf to your computer and use it in GitHub Desktop.
// run command
npm install cypress --save-dev
// add in your scripts package.json
"cy:dev": "cypress open",
// run this command to create cypress folder and cypress.json
run run cy:dev
// create a file in cypress/integration/login.js and add:
it("Load page", () => {
cy.get('[data-testid=loginForm]')
})
// add this attribute in your Login.tsx
data-testid="loginForm"
// configurate your cypress.json
{
"baseUrl": "http://localhost:3000",
"chromeWebSecurity": false,
"projectId": "myid",
}
// create another tests :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment