Next-Gen TestingBetween Real Browsers and AI
Rainer Hahnekamp
1
Why Browser Tests?
Part 1
Why
Browser Tests?
Agenda
01
Why Browser Tests?
02
Testing and AI
Testing Strategies
Original images: Spotify Engineering - Testing of Microservices; Kent C. Dodds - Write Tests
5
Angular 21: The Shift Towards Browser Tests
Angular 21: The Shift Towards Browser Tests
Angular 21: The Shift Towards Browser Tests
Why Vitest?
A Little Bit of History
Browser
Emulated Browser
jsdom
Browser
Why the Browser?
Real Browser Behavior
- Rendering
- User Events
- Timings (Signals)
- New Technologies (Shadow DOM, Hydration)
Switch to "UI Is the API"
Performant Headless Browsers
Visualization (DX)
Browser Mode
Common API
Delegates
DOM Interaction
DOM Interaction
Browser Mode in a Nutshell
Advantages
- Less Manual Synchronization
whenStable() · detectChanges() - User Actions Check Elements
- Queries via A11y Selectors
Power of E2E
- Real Asynchronous Waiting
- Actionability Checks and Auto-Wait
- Powerful Locators
Vite-Powered Build With Vitest
Build
Framework-Specific Vite Plugins
Execution
Angular Build With Vitest
Build
Execution
Vite-Powered Build With Vitest
Build
Angular as a Vite Plugin
Execution
“All-In” Features
Configuration as DocumentedTimeouts, etc.
VS Code Support
Trace Viewer Support
Debugging
Vitest Extensions
Coding Time
Coding Time
Testing in the Age of AI
Part 2
Testing in
the Age of AI
How Do We Make Sure We Have the Right Tests?
Skills
Existing Quality Tests
Include Tests in the Prompt / Plan
Review the Tests
Write Test Titles
Models Generate. Tools Verify.
Non-Deterministic
Models
Same Model + Same Prompt
Run 1
Run 2
Run 3
Different Answers Are Possible
Deterministic
Tools
- Tests
- Behavior
- ESLint
- Code Rules
- TypeScript
- Types
- Architecture Rules
- Dependencies
Three Ways to Run the Same Tests
| Approach | Who Initiates? | Main Benefit | Main Tradeoff |
|---|---|---|---|
| Hooks | Coding agent (lifecycle event) | Predictable execution | Redundant runs |
| Review Agent | Separate reviewer | Focused repair feedback | Coordination and repeated checks |
| Automatic | The model | It just works | Reliance on the model |
Test Code - The Last Code We Read?
Test Code -
The Last Code
We Read?
Charted Coding With Younes Jaaidi
Younes Jaaidi - Original Video - June 20, 2025
24
Charted Coding: Human Participation
Younes Jaaidi - Charted Coding - June 20, 2025
25
Mostly Integration Still Applies
Today We See the Complete Opposite With AI.A Lot of Tests, Mainly Unit Tests.
Guillermo Rauch - December 10, 2016
26
Testing Solved!?
Tests Fulfill Many Purposes
Tests Fulfill
Many Purposes.
Documentation and a “Guaranteed Abstraction”
for Knowing That Our Code Works.