As software consultants at Test Double, we delight in helping client development
teams succeed at building quality software at a sustainable pace. For most
software consulting agencies that typically means contributing directly to
software delivery and advising on good coding practices at a client.
One area often overlooked is the quality of automated testing on a client
project. For many teams, automated testing is nonexistent or boils down to a
checklist item with no ethos, mired in a spaghetti of hybrid unit-integration
tests with an identity crisis.
Our consultants believe a healthy project depends on having automated testing in
place with intentional rules and boundaries that team members have agreed upon.
Know thyself, and then know what and why you’re testing.
End-to-end tests offer a great example of the kinds of tests that are ripe for
misunderstanding and misuse by client teams. More often than not, we encounter
end-to-end test suites that are slow, unreliable, and unmaintainable, slowing
down teams as they constantly debug tests and rely on restarting CI builds to
make flaky tests pass.
An unfortunate side effect of problematic test suites is that teams can blame
testing tools instead of cutting to the heart of the real issue:
ad hoc, poorly designed test suites.
Granted, software developers have raised legitimate
concerns with end-to-end testing tools. Thanks to those concerns, we now have
tools such as Cypress. If you haven’t heard of Cypress, it offers a
carefully-designed ecosystem of tooling for writing, running, and debugging
end-to-end test suites that reduces the friction found in other tools such as
Unsurprisingly, many other issues with end-to-end tests didn’t disappear when
teams adopted Cypress, though. Tests are still slow and still unreliable. Ever
true to our mission, Test Double wants to improve how the world builds software,
in this case by improving how teams test their code with end-to-end testing.
If you’re a web developer or QA engineer that wants to make your application
more reliable, then this video series from your friends at Test Double is for
you. Throughout, you will learn how to write Cypress end-to-end tests that
provide the most value to your business without sacrificing maintainability.
This video series will take you from knowing nothing about end-to-end tests or
Cypress to building your own maintainable end-to-end test suite with Cypress.
In this first video, you will receive an introduction to the world of end-to-end testing
with Cypress. You will learn who Test Double is and why we love Cypress, how
end-to-end tests fit in the testing pyramid, the pros and cons of end-to-end
tests, and what you should expect from this series. By the end of this video,
you will understand what end-to-end tests are and why Cypress makes writing them
familiar and fun.
Learn what end-to-end tests are and why Cypress makes writing them familiar and
Learn how to initialize a Cypress test suite and start writing end-to-end tests
- (upbeat music)
- Hello, and welcome to Test Double’s intro course
- on end-to-end testing with Cypress.
- My name is Jeremy Fairbank,
- and I will be your humble guide on this testing journey.
- At Test Double, we believe software is broken,
- and we are here to fix it.
- Our mission is to improve how the world builds software.
- Test Double’s seasoned developer consultants
- work as extended members of your engineering team.
- We get things done by embracing your tools,
- participating in your process,
- and making improvements as we go.
- We tackle the technical and human aspects of every problem,
- striving to build both great software and great teams.
- If you’d like to have our consultants help your team,
- or if you’d like to join our awesome team of consultants,
- follow the links below.
- Cypress has grown immensely popular over the past few years,
- quickly becoming a leader
- in the world of web application end-to-end testing.
- At Test Double, we love using Cypress
- and helping our clients
- build safe and maintainable applications with it.
- But what even are end-to-end tests in Cypress?
- End-to-end tests are automated tests
- that verify all the parts of an application
- work together correctly throughout the whole stack.
- They’ve traditionally occupied the top layer
- of what’s known as the testing pyramid.
- Each slice of the testing pyramid offers guidelines
- about how much your team may wanna invest
- in those types of tests
- based on their value, speed, and maintainability.
- Although end-to-end tests provide reassurance
- that your application works as a whole,
- they tend to be the slowest and hardest to debug tests
- because they interact with the full stack.
- So the testing pyramid generally recommends
- limiting the number of end-to-end tests,
- focusing primarily on the most critical paths
- through your application.
- Many end-to-end testing solutions exist
- in the world of web development.
- Cypress has really stood out among the various options,
- thanks to its many developer-friendly design choices.
- For the most part,
- and a popular choice among many web developers.
- Cypress fully embraces that.
- Little to no waiting.
- Cypress’ declarative API lets you primarily focus
- on interacting with your application
- without worrying about when elements appear or disappear
- from the DOM.
- Cypress offers an impressive suite of tools
- for debugging and replaying tests right inside the browser.
- Cypress is an all-in-one package.
- When you install Cypress,
- you have everything you need to start testing.
- No extra testing frameworks or libraries to piece together.
- So who is this course for,
- and is Cypress testing right for you and your team?
- Do you have a front-end web application
- driven by a back-end server?
- Do you want to have confidence that your app works correctly
- throughout the whole stack?
- Do you want to ensure sev0 bugs
- don’t come back to haunt you?
- Do you wanna automate manual regressions tests
- and user acceptance tests,
- ensuring features work as intended?
- If you answered “Yes” to any of those questions,
- then this course is for you,
- whether you’re a front-end, back-end,
- or a full-stack software engineer, or even a QA engineer.
- So what can you expect from this course?
- This course will be a follow-along tutorial
- spread across multiple short videos.
- This course also assumes you are new to Cypress.
- We’ll start with basic concepts
- and build on top of previous videos
- to introduce more concepts.
- At times, you’ll even re-factor or rewrite previous tests
- as you learn more advanced topics.
- This course takes a pragmatic approach
- to get you testing with Cypress on your own
- as quickly as possible.
- So you won’t learn all of Cypress’ API and options,
- but you will still learn advanced techniques,
- best practices, and some of Test Double’s recommendations.
- That being said,
- there are some pre-requisites to this course.
- Since this pertains to web applications,
- you need to know HTML
- and have some experience with front-end web applications.
- so you need to be familiar with its syntax,
- asynchronous patterns, and interacting with JSON APIs.
- Also, you will need to use npm to install Cypress.
- Throughout this course,
- you will test a provided demo application
- built with React, Ruby on Rails, and Docker.
- If you’re familiar with those technologies, that’s great.
- If not, no worries.
- We will limit the time we spend
- in the application’s source code,
- and instructions for using Docker are provided
- with the source code repo.
- Speaking of source code, the demo app is hosted on GitHub,
- so you will need some experience
- forking and cloning GitHub repos.
- Ultimately, when you complete this course,
- you will be able to:
- install and set up a new Cypress test suite,
- use many of Cypress’ most important API commands,
- identify critical, happy-path user scenarios
- to test in your application,
- and identify what not to test with Cypress,
- use different approaches to control your application data
- for deterministic tests,
- create custom Cypress commands,
- use advanced techniques to makes tests more maintainable
- and eliminate false negatives that destroy productivity,
- and set up continuous integration environments
- to run your tests on a schedule
- and notify you of failing tests.
- Now that we’ve set the stage for this Cypress course,
- let’s forge ahead.
- In the next video,
- you will learn how to install Cypress,
- initialize a test suite,
- and write your first test against the demo app.
- (upbeat music)