Home

Awesome

cypress-applitools-webinar

Companion Code to "Functional and Visual Testing with Cypress.io and Applitools" webinar

Functional tests

Tests are in the folder cypress/integration

The test writing and organization are covered in slides at https://slides.com/bahmutov/flawless-tests

Test setup

{
  "baseUrl": "http://localhost:4100"
}

robot

describe('Conduit', () => {
  beforeEach(() => {
    cy.request('POST', 'http://localhost:3000/api/users/login', {
      user: Cypress.env('user'),
    })
      .its('body.user.token')
      .should('exist')
      .then((token) => {
        localStorage.setItem('jwt', token)
      })

    cy.visit('/')
  })

  it('shows feeds', () => {
    cy.contains('a.nav-link', 'Your Feed').should('have.class', 'active')
    cy.contains('a.nav-link', 'Global Feed').should('not.have.class', 'active')
  })
})

And we are in business!

Shows feeds test

Tip: find different ways to quickly login in Logging in recipes.