GetBy, QueryBy, FindBy

There are different ways to find elements in your rendered React component tests. For example ...byText(), ...byLabelText(), ...byRole(), etc.

(We will cover all of those specific ones in detail later in this course.)

Each query has three variants. It is important to learn and remember their differences.

In this lesson, we will cover getBy, queryBy, and findBy.

This is also covered in our main React testing course. If you've taken that already, you can skip this lesson.

We'll soon move into the more advanced query APIs.

Loading full lesson content & code...

Ready to try running tests for this lesson?