Vitest Browser Mode Course

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!

This is a course about Vitest Browser Mode.

  • learn how to install Vitest Browser Mode, and configure it
  • how it differs from normal Vitest tests, or E2E tests
  • and how to use all of its features to test your apps in this new and exciting way

Unlike the other courses on this site, it is not interactive and is more text-based.

I personally think that Vitest Browser Mode is a key part of your arsenal of tools to help write tests, so it is really important to understand it.

If you want to read a blog post introducing the basics of Vitest Browser Mode, check out my blog post here, then return to this course if you want to learn it all in depth and become an expert on it!

Note: Right now this course focuses only on testing React components in Vitest Browser Mode (and not Svelte or Vue - yet!)

23 lessons
Step by step lessons

Course Lessons

23 lessons to learn everything about Vitest Browser Mode

Vitest Browser Mode Locators

9
PRO

Vitest Browser Mode Locators - Introduction

A full guide to using Locators to find and query elements in your tests, understanding the page API and element selection

Start
10
PRO

Locators - getting a single element

Lesson covering everything you need to know about querying for a single element on the page

Start
11
PRO

Locators - async behaviour/polling

How to query for elements asynchronously, with the built in polling methods to retry until your assertions pass (or it fails and times out). This is mostly with expect.element()

Start
12
PRO

Locators - getting multiple elements

Lesson explaining how to query for multiple elements, and how to make assertions against them

Start
13
PRO

Locators - asserting with no matching elements

Explaining how to use Locator query functions and assertions to check that something is NOT rendered

Start
14
PRO

Vitest Browser Mode Locators - The Seven Query Functions

Detailed overview of the seven query functions: getByRole, getByAltText, getByLabelText, getByPlaceholder, getByText, getByTitle, and getByTestId

Start
15
PRO

Vitest Browser Mode Locators - The Modifier Functions

Learn how to combine regular locator functions with modifiers: nth, first, last, and, or, and filter to create powerful element queries

Start
16
PRO

Vitest Browser Mode Locators - The Interactive Methods

Learn the methods to initiate interactivity: click, dblClick, clear, hover, unhover, fill, selectOptions, screenshot, and element queries

Start