Vitest Browser Mode
Learn everything you need to know to get up to speed with Vitest Browser Mode, to run your tests in a very realistic, fast and (optionally) visual way!
Vitest Browser Introduction
What is Vitest Browser Mode
Not started
Vitest Browser Mode Setup
Installing Vitest Browser Mode
Not started
Configuring & Selecting a Provider in Vitest Browser Mode
Not started
Setting up Vitest Browser Mode in your CI/CD Pipeline
Not started
Vitest Browser Mode Fundamentals
Writing Vitest Browser Mode Tests Introduction
Not started
Rendering React Components in Browser Mode
Not started
Testing Hooks in Vitest Browser Mode
Not started
Vitest Browser Mode Locators
Vitest Browser Mode Locators - Introduction
Not started
Locators - getting a single element
Not started
Locators - async behaviour/polling
Not started
Locators - getting multiple elements
Current
Locators - asserting with no matching elements
Not started
Vitest Browser Mode Locators - The Seven Query Functions
Not started
Vitest Browser Mode Locators - The Modifier Functions
Not started
Vitest Browser Mode Locators - The Interactive Methods
Not started
Vitest Browser Mode Assertions
Vitest Browser Mode Assertions Overview
Not started
Vitest Browser Mode Assertions - Forms
Not started
Vitest Browser Mode Assertions - Accessibility
Not started
Vitest Browser Mode Interactivity
Interactivity API - userEvent Guide
Not started
Lesson:Locators - getting multiple elements
Ok so we have covered how to get a single element. But the tests so far would always fail if there were more than one matching element.
In this lesson we will explain how to query for and make assertions against multiple matching elements.
For example, if you had this component
const Component = () => {
return (
<div>
<button>Save</button>
<button>Cancel</button>
</div>
);
};
And you used expect(screen.getByRole('button')).toBeInTheDocument(), it would fail.
So let's go through some ways that we can assert that there are two buttons, or how to check the buttons have different texts.