Leaving presentation mode.
Browser Testing and Tools Update
James Graham
About Browser Testing and Tools
- Specifications for interacting with web browsers
- Focus is enabling testing of web applications
Why Should I Care?
- Modern websites are often complex applications
- For the web to be a compelling platform it must be easy to create reliable webapps
- This requires testing across multiple browser engines
- MDN Developer Needs Assessment 2021 rated "Testing across browsers" as the #4 pain point
History: WebDriver
- Specification for automation
- Focus is on end to end testing that simulates user interactions
- Protocol is simple command / response
- Transport layer is JSON-over-HTTP
- Easy to write synchronous client code
- Rec since 2018, widely implemented
WebDriver Problems
- Modern webapps have a lot of internal state
- Ongoing network requests, js exectution, storage, etc.
- Mismatch between concurrency inside browser and synchronous automation makes writing stable tests hard
- Test authors want access to webapp internal data
- Console logs
- Network traffic
- These requirements don't map well onto the WebDriver design.
Meanwhile
- Modern automation tools have started to use browser-specific protocols to provide low level control
- This means users have to choose between cross-browser testing and advanced functionality
Current Work: WebDriver BiDi
- BiDirectional protocol for browser automation
- Browser can send events to automation tools as well and handle commands
- Transport layer is JSON=over-WebSockets
- Allows automation tools to respond to events inside the browser engine
- Lower-level than WebDriver
- Not so tied to end-to-end testing
- Interact with all browsing context and realms, not just one active context
- Compatible with WebDriver: easy to transition
WebDriver BiDi: Status
- Working draft includes:
- Console log events
- Navigation
- Next up:
- Script execution (and sandbox / isolated world)
- Network request monitoring and interception
- etc.
- https://github.com/w3c/webdriver-bidi/
Bonus Material: web-platform-tests
- web-platform-tests uses WebDriver:
- For runner
- For testdriver APIs
- Lower level BiDi protocol means more features for authors e.g.
- Inspect network traffic
- Communicate between browsing context groups
- Other features that don't fit into WebDriver model
This is a template for slides using the b6+ JavaScript framework with a style based on Humaaans. For usage instructions, see at the end.
To start the slide show, turn on JavaScript and press ‘A’. Return to the index by pressing ‘A’ or ‘Esc’. On a touch screen, use a 3-finger touch. Double click to open a specific slide.