From the course: Advanced Cypress

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

How to use assertions in Cypress

How to use assertions in Cypress - Cypress Tutorial

From the course: Advanced Cypress

How to use assertions in Cypress

Welcome back. In this video, we're going to talk about assertions in Cypress. So just ways of checking that things are appearing the way that they should appear or behaving the way that they are expected to behave. So the learning goals for this video are to identify and use common Cypress assertions, and then also understanding when assertions happen by default. So like we've seen in previous topics, Cypress handles a lot of things, kind of, behind the scenes by default. And this is also true with assertions where some assertions just, kind of, happen out of the box based on the action that you're taking. So let's go ahead and dive in. Before we dive into the actual code, I wanted to point out this Assertions page on Cypress's documentation section of their website. You might see some familiar looking ways of writing tests from other libraries like Chai. All of this stuff is built in to Cypress, which is super helpful if you're familiar with these other testing libraries, you'll see…

Contents