Telepítés a projektbe:
npm install cypress --save-dev
npx cypress open
npx cypress run
describe('Háromszög számoló', () => { beforeEach(function() { cy.visit('http://localhost:3000') }) it('Bemenet 30 és 35-re, 525', () => { cy.get('#base').invoke('val', 30) cy.get('#height').invoke('val', 35) cy.get('#calcButton').click() .then( () => { cy.get('#area').should('have.value', '525') }) }) })
Szerepel-e az oldalon:
it('Alap szerepel az oldalon', () => { cy.contains('Alap') }) it('Magasság szerepel az oldalon', () => { cy.contains('Magasság') }) it('Terület szerepel az oldalon', () => { cy.contains('Terület') }) it('Van button', () => { cy.get('button') })