Skip to content

v1.29.0

Compare
Choose a tag to compare
@mxschmitt mxschmitt released this 04 Jan 14:32
05d45c3

Highlights

New APIs

  • New method Route.FetchAsync and new option Json for Route.FulfillAsync:

    await Page.RouteAsync("**/api/settings", async route => {
      // Fetch original settings.
      var response = await route.FetchAsync();
      // Force settings theme to a predefined value.
      var json = await response.JsonAsync<MyDataType>();
      json.Theme = "Solarized";
      // Fulfill with modified data.
      await route.FulfillAsync(new() {
        Json = json
      });
    });
  • New method Locator.AllAsync to iterate over all matching elements:

    // Check all checkboxes!
    var checkboxes = Page.Locator("role=checkbox");
    foreach (var checkbox in await checkboxes.AllAsync())
      await checkbox.CheckAsync();
  • Locator.SelectOptionAsync matches now by value or label:

    <select multiple>
      <option value="red">Red</div>
      <option value="green">Green</div>
      <option value="blue">Blue</div>
    </select>
    await element.SelectOptionAsync("Red");

Browser Versions

  • Chromium 109.0.5414.46
  • Mozilla Firefox 107.0
  • WebKit 16.4

This version was also tested against the following stable channels:

  • Google Chrome 108
  • Microsoft Edge 108