v1.48.0
版本发布时间: 2024-10-08 20:59:42
microsoft/playwright最新发布版本:v1.49.0(2024-11-19 02:33:25)
WebSocket routing
New methods page.routeWebSocket() and browserContext.routeWebSocket() allow to intercept, modify and mock WebSocket connections initiated in the page. Below is a simple example that mocks WebSocket communication by responding to a "request"
with a "response"
.
await page.routeWebSocket('/ws', ws => {
ws.onMessage(message => {
if (message === 'request')
ws.send('response');
});
});
See WebSocketRoute for more details.
UI updates
- New "copy" buttons for annotations and test location in the HTML report.
- Route method calls like route.fulfill() are not shown in the report and trace viewer anymore. You can see which network requests were routed in the network tab instead.
- New "Copy as cURL" and "Copy as fetch" buttons for requests in the network tab.
Miscellaneous
- Option
form
and similar ones now accept FormData. - New method page.requestGC() may help detect memory leaks.
- New option
location
to pass custom step location. - Requests made by APIRequestContext now record detailed timing and security information in the HAR.
Browser Versions
- Chromium 130.0.6723.19
- Mozilla Firefox 130.0
- WebKit 18.0
This version was also tested against the following stable channels:
- Google Chrome 129
- Microsoft Edge 129