Skip to content

Instantly share code, notes, and snippets.

@matefs
Last active June 21, 2023 13:30
Show Gist options
  • Save matefs/da6fdf40cb2e9df14cfa2f44c328d325 to your computer and use it in GitHub Desktop.
Save matefs/da6fdf40cb2e9df14cfa2f44c328d325 to your computer and use it in GitHub Desktop.
Cypress basics

Cypress basics

Instalando o cypress

npm install cypress --save-dev 

Abrir o cypress sem o autorun

npx cypress open --config watchForFileChanges=false
  1. Escolha o browser que irá utilizar para os testes.
  2. Esolha a opção "E2E Testing"
  3. Clique sobre um dos arquivos com a extensão " .cy.js".

Criando um teste

  1. Crie um novo arquivo com final .cy.js
beforeEach(() => {
  cy.visit('https://site.com.br')
})


describe('Testando o login do usuário', () => {
  it('Escrevendo o login', () => {
    // code 
  })

})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment