Files
TechradarDev/radar/2019-11-01/cypress.md
2024-05-03 12:06:49 +02:00

1.4 KiB

title, ring, quadrant, tags
title ring quadrant tags
Cypress assess tools
academy training
frontend
quality assurance

Cypress is a front-end testing tool (E2E). It comes as a simple node package, making it easy to use and maintain for front-end developers and testers. Cypress has a different approach than Selenium; it runs in the browser and in the same loop as the device under test.

Good:

Not so good:

  • No cross-browser testing (only Chrome and Electron)
  • Scenarios with multiple browser tabs cannot be tested
  • Relatively new test tool, although it is becoming more popular

Example of a test:

describe('My First Test', function() {
  it('Visits the Kitchen Sink', function() {
    cy.visit('https://example.cypress.io')

    cy.contains('type').click()

    cy.url().should('include', '/commands/actions')

    cy.get('.action-email')
      .type('fake@email.com')
      .should('have.value', 'fake@email.com')
  })
})