From the course: End-to-End JavaScript Testing with Cypress.io
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
The "filter" and "not" commands
From the course: End-to-End JavaScript Testing with Cypress.io
The "filter" and "not" commands
- Those of you who have worked jQuery before will know that there's a pretty wide range of possible situations and arrangements of elements on a web page. And to select elements in a reliable manner. There's a very wide range of different commands for selecting elements in different places. And one of the many nice things about Cypress is that it provides us with a lot of the standard jQuery commands, all wrapped up and available for us to call the same way that we'd normally call most other Cypress commands. To show you an example of this we're going to look at the commands filter and not. Which are opposites of each other. And a good example of how Cypress wraps jQuery commands for us. So let's say that in our app we have a div with the ID content container or something like that. Which contains several child elements of different kinds. Some headings, some paragraphs, et cetera. If we only want to select a subset of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.