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
'shttpCredentials
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 newBrowserContext
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
. -
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.
-
Blocking requests based on the remote host's name or IP via k6's
blacklistIPs
andblockHostnames
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()
andElement.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).
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)