
Cypress enables end-to-end testing of full application flows, like user authentication, by writing automated tests for the website; the course contrasts end-to-end with unit and component tests.
See how Cypress organizes tests by creating .cy.js files in the e2e folder, using describe and it blocks to build test suites and tests.
Explore the Cypress end-to-end testing getting started course for web developers with no Cypress knowledge, learning core concepts through practical examples and code-along practice in on-demand videos.
Use the Cypress visit command to load pages and verify they render on localhost, leveraging the cy object to run end-to-end tests that fail if a page is missing.
Learn to locate the main image with Cypress using the get command and CSS selectors. Validate tests by ensuring the image appears in the header and refine selectors for precision.
Learn how Cypress uses implicit and explicit assertions, with commands like visit and get, and how should with have length enforces exactly one h1 element.
Learn to simulate user interaction with Cypress by adding a tasks management test file, opening a modal with the add task button, and closing it via backdrop or cancel.
Explore simulating user typing to create a new task in a Cypress end-to-end test, filling title and summary, submitting the modal, and asserting task creation.
Learn how Cypress enforces test isolation by reloading the page, clearing cookies and local storage, and creating a new browser context between tests.
Master deeper Cypress basics by refining element selection, simulating user interactions, and navigating pages, while exploring assertions and alternative expectation formulations.
Test Cypress page navigation by clicking the about link and verifying the path becomes /about, then go back to the homepage and confirm the path is / using data-cy selectors.
Chain commands in Cypress by selecting a button, using contains to yield the element, and applying should or end to verify text and attributes, with alternative readable rewrites.
Explore how to override global Cypress settings for specific tests or suites by passing a configuration object to describe, enabling per-test or per-suite timeouts and options.
Configure Cypress globally or locally, override timeouts and base URL, and choose which browser runs each test, using before hooks for setup; apply custom commands and tasks judiciously.
Learn how to use stubs to replace browser functions, such as navigator.geolocation.getCurrentPosition, enabling automated tests to simulate a user location and test your app without relying on browser behavior.
Demonstrate creating a fake stub for getCurrentPosition in Cypress tests by using a custom callback to pass a dummy position and simulate a brief delay.
Tackle end-to-end testing challenges in Cypress by handling HTTP requests, using a dedicated testing database to protect production data, and simulating authentication flows such as sign up, login, and logout.
Set up and write your first end-to-end test with Cypress, visiting the starting page to verify two takeaway items using data-cy selectors, then run tests with a single npm script.
Highlight that the first test relies on a database under the hood via Prisma. Use a dedicated testing database to avoid altering production or development data.
Use a dedicated testing database to validate newsletter sign-up with Cypress, seed before each test, and verify the 'Thanks for signing up' success message to ensure test isolation.
Intercept and block outgoing http requests with Cypress cy.intercept, return a dummy 201 response, and alias with cy.wait to verify the signup success message without backend calls.
Verify that validation errors display when signing up for the newsletter by intercepting requests and returning an error message like "email exists already" to simulate an existing email.
Automated testing is a vital part of modern application development. Of course, website development is no exception here - you must be able to run automated tests to efficiently detect bugs and regressions.
This course teaches you how to write and run end-to-end (E2E) tests with Cypress - one of the most popular web development E2E testing tools you can use these days!
You will learn:
What exactly Cypress is and why E2E testing matters
How to install and use Cypress
How to write and run E2E tests with Cypress
How to simulate realistic website user flows by selecting elements and simulating user interaction (button clicks, keyboard typing & more)
How to write good assertions (and what assertions are)
Which core features and concepts Cypress offers
How to use basic and more advanced Cypress concepts
How to efficiently test third-party code
How to deal with network (HTTP) requests and databases
How to test user authentication flows
And much more!
All these topics will be taught from the ground up, with no prior Cypress knowledge required! You do need basic web development and JavaScript knowledge though.
This course focuses on the core Cypress concepts and explores all basic as well as various more advanced Cypress features.
By the end of this course, you'll have a solid set of Cypress fundamentals and you'll be ready to dive deeper into Cypress and end-to-end testing!