Cypress
End to end testing
describe('template spec', () => {
it('passes', () => {
// simulate user action
// visit page
cy.visit('https://example.cypress.io')
// click button
cy.contains('type').click()
// assert the url
cy.url().should('include', '/commands/actions')
// Get an input, type into it
cy.get('.action-email').type('fake@email.com')
// Capture a part of dom element and assert it
cy.get('.action-email').should('have.value', 'fake@email.com')
})
})Component Testing
Last updated