Vitest Browser Mode Locators - The Seven Query Functions

In the previous lesson we went over how to query for elements, and were using the screen.getByText() functions to return a Locator.

But there are seven of these functions.

If you use React Testing Library or Playwright, these functions will feel familiar, as they are the same across all three libraries.

Lesson covers:

getByAltText, getByLabelText, getByPlaceholder, getByRole, getByTestId, getByText, getByTitle

Loading full lesson...