testing javascript logo
    Loading

    Use Custom Cypress Command for Reusable Assertions

    We’re going to need a newly created user for several tests so let’s move our cy.request command to register a new user into a custom Cypress command so we can use that wherever we need a new user.

    There's been a small breaking change to Cypress Testing Library that affects the code in this video. Learn more here.

    Transcript

    Use Custom Cypress Command for Reusable Assertions

    module imageInstall, Configure, and Script Cypress for JavaScript Web Applications
    • 1.
      What's changed in Install, Configure, and Script Cypress for JavaScript Web Applications
    • 2.
      Intro to Install, Configure, and Script Cypress for JavaScript Web Applications
    • 3.
      Install and Run Cypress
    • 4.
      Write the First Cypress Test
    • 5.
      Configure Cypress in cypress.json
    • 6.
      Installing Cypress Testing Library
    • 7.
      Script Cypress for Local Development and Continuous Integration
    • 8.
      Debug a Test with Cypress
    • 9.
      Test User Registration with Cypress
    • 10.
      Cypress Driven Development
    • 11.
      Simulate HTTP Errors in Cypress Tests
    • 12.
      Test User Login with Cypress
    • 13.
      Create a User with cy.request from Cypress
    • 14.
      Keep Tests Isolated and Focused with Custom Cypress Commands
    • 15.
      Use Custom Cypress Command for Reusable Assertions
    • 16.
      Run Tests as an Authenticated User with Cypress
    • 17.
      Use cy.request from Cypress to Authenticate as a New User
    • 18.
      Use a Custom Cypress Command to Login as a User
    • 19.
      Combine Custom Cypress Commands into a Single Custom Command
    • 20.
      Install React DevTools with Cypress