Course lesson

Use the getBy Query to get Elements that Should Always be on the Page

In order for you to interact with the elements in your tests, you need to query for them.

Duration
2 min
Access
Included
Transcript
Retained from source evidence

In order for you to interact with the elements in your tests, you need to query for them.

In this lesson, we will learn about one of the query variants that allows you to search for something that you expect to always be in your UI: the getBy.

We will also get introduced to one of the most useful jest-dom assertions: the toBeInTheDocument.