github grafana/xk6-browser v0.2.0

latest releases: v1.8.5, v1.8.4, v1.8.3...
2 years ago

xk6-browser v0.2.0 is here! 🎉

This is a minor release with a few new features, several bug fixes, stability improvements, and overall code cleanup.

New features

  • Support for HTTP Basic Authentication. (#242)

    The BrowserContext's httpCredentials option previously wasn't working (#203).

    The change also safely handles servers that do not adhere to the basic auth protocol by canceling the authorization process on the first failed attempt.

    It also deprecates BrowserContext.setHttpCredentials. The correct way of setting the credentials now is creating a new BrowserContext with credentials:

    // Correct
    const context = browser.newContext({
      httpCredentials: {
        username: 'user',
        password: 'pass',
      }
    });
    
    // The following is deprecated
    context.setHTTPCredentials({
      username: 'user',
      password: 'pass',
    });

    If you need to change or clear credentials within the same script, you should create a new BrowserContext.

    See the reasoning behind this deprecation here and here.

  • Viewport insets now have the correct size on every OS. (#185)

    Browser insets change depending on the operating system, and this feature adds support for adjusting insets of the viewport for Windows, Linux, and macOS.

    Note that it won't update the viewport if the browser runs in headless mode.

    See the related issues for more details: #182, #183.

  • Blocking requests based on the remote host's name or IP via k6's blacklistIPs and blockHostnames options. (#204, #205)

    The browser will block matching requests with an ERR_BLOCKED_BY_CLIENT error if the script specifies these options.

  • Support for k6's hosts option to override DNS resolution with a custom mapping. (#207).

    This has the same effect as passing the host-resolver-rules argument to Chrome via browser args.

Bugs fixed

  • Page.queryAll() and Element.queryAll() not finding elements. (#195)

  • Possible issue with consecutive clicks on an element if the first click resulted in an exception. (#219)

  • Page.waitForNavigation becomes unresponsive if the browser or connection is closed or the user cancels the script. We now handle the extension shutting-down stage more robustly, and it shouldn't become unresponsive. (#188)

  • Passing arguments to the browser command now works correctly; see this example. (#206)

  • Page.waitForNavigation() doesn't timeout anymore for navigation within the same document (e.g. via anchor links or the History API). (#247).

  • Internal fixes that improve stability: #217 and #238.

Improvements

  • Errors for deprecated Chromium events are no longer printed by default, but can be seen when running in debug mode (XK6_BROWSER_LOG=debug). (#251)

  • Some error messages were enhanced to aid with debugging. (#193)

Internals

  • The k6 dependency was updated to v0.36.0. It's recommended to upgrade to the latest xk6 v0.6.1 for building the extension. (#202).

  • Code linting was fixed and expanded. (#211, #216, #245).

  • Several code refactors and test additions that improve maintainability. (#196, #212, #213 #221, #224, #225, #229)

Don't miss a new xk6-browser release

NewReleases is sending notifications on new releases.