End-to-end Testing with Cypress Series: 08 DRY Test Setup @TestDouble
End-to-end Testing with Cypress Series: 08 DRY Test Setup  @TestDouble
Uploaded April 2022 | Updated September 2026, 2 weeks ago
In this video, learn how duplicated test setup steps can make Cypress end-to-end test suites unmaintainable. Discover how to use helper functions like `beforeEach` and how to configure Cypress with the cypress.json file in order to simplify and reduce repeated test setup.

Chapters
00:00 Intro
00:09 Recap of previous video
00:21 Learning goals for this video
00:36 Reminder instructions for running demo app and Cypress test suite
00:48 Identifying duplicate `cy.visit` calls in each end-to-end test
01:17 Make `cy.visit` automatically run before each test with `beforeEach`
01:55 Cypress ensures `cy.visit` completes before running each test
02:02 Remove previously duplicated `cy.visit` calls and save
02:07 Verify end-to-end tests still visit initial page and run successfully
02:15 Expand Cypress command log to see the`visit` command inside BEFORE EACH
02:32 Duplicating hardcoded URLs can make Cypress test suites unmaintainable
02:55 Configuring Cypress to know the base URL for all visited URL paths
03:05 Explaining the cypress.json file for configuring Cypress test suites
03:24 Add the `baseUrl` to cypress.json
03:45 Save file to see Cypress reload the spec file list
04:01 Replace URL in end-to-end spec file with root path / and save
04:12 Open up spec file again from Cypress list of spec files
04:17 Verify end-to-end tests run successfully
04:35 Link to other configuration options available in cypress.json
04:43 Recapping what you learned
04:59 Summary of different ways duplication affects Cypress test suites
05:17 Conclusion and next module teaser

Additional resources:
Configuring Cypress: docs.cypress.io/guides/references/configuration

Find out more about Test Double at link.testdouble.com/more-info
End-to-end Testing with Cypress Series: 08 DRY Test SetupUnder Pressure (Todd Kaufman)Test Double Coffee Time:  AI HarnessesCypress vs. Capybara, part 3: testing with Cypress (Justin Searls)Building a Linkblog with Hugo, Tailwind, and NetlifyCMSWhat CTOs need to know about vibe coding and their teamGoing To Eleven (Steve Jackson)End-to-end Testing with Cypress Series: 07 DRY for SpeedWhat the heck is test concrete?Meet Test Double consultantsHow to Stop Hating Your Tests (Justin Searls)Theres Nothing.new Under the Sun (Justin Searls)
Test Double |

End-to-end Testing with Cypress Series: 08 DRY Test Setup

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER