diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index c5e2a068c26..906c5c437d3 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -59,12 +59,27 @@ console.log(context.cookies.length); // 0 Allows users to register a handler to be executed every time the `console` API methods are called from within the page's JavaScript context. The arguments passed into the handler are defined by the [ConsoleMessage](https://k6.io/docs/javascript-api/k6-experimental/browser/consolemessage/) class. +```js +page.on('console', msg => { + check(msg, { + 'assertConsoleMessageType': msg => msg.type() == 'log', + 'assertConsoleMessageText': msg => msg.text() == 'this is a console.log message 42', + 'assertConsoleMessageArgs0': msg => msg.args()[0].jsonValue() == 'this is a console.log message', + 'assertConsoleMessageArgs1': msg => msg.args()[1].jsonValue() == 42, + }); +}); + +page.evaluate(() => console.log('this is a console.log message', 42)); +``` + ### UX improvements and enhancements - [#3338](https://github.com/grafana/k6/pull/3338), [xk6-grpc#48](https://github.com/grafana/xk6-grpc/pull/48). Adds a support of the v1 of the gRPC reflection protocol. - [#3290](https://github.com/grafana/k6/pull/3290) Log errors when executing `setup` and `teardown` via REST API. - [#3327](https://github.com/grafana/k6/pull/3327) `k6 version` now prints the commit identifier for the build. - [#3340](https://github.com/grafana/k6/pull/3340) The k6 ``*-with-browser`` Docker images set now the `no-sandbox` environment variable automatically. +- [browser#1007](https://github.com/grafana/xk6-browser/pull/1007) Inject `window.k6 = {};` to help identify k6 browser module tests. +- [browser#1022](https://github.com/grafana/xk6-browser/pull/1022) Refactor the `check` in `examples/fillform.js` so that it matches the type definitions and documentation for `check`. ## Bug fixes @@ -75,6 +90,10 @@ Allows users to register a handler to be executed every time the `console` API m - [browser#1040](https://github.com/grafana/xk6-browser/pull/1040) fix the `context.clearCookies()` method to clear all cookies from the current browser context. - [browser#1031](https://github.com/grafana/xk6-browser/pull/1031) fix the `expires` field while adding cookies using the `context.addCookie()` method. - [browser#1039](https://github.com/grafana/xk6-browser/pull/1039) fix Goja conversions while adding and retrieving cookies. +- [browser#1038](https://github.com/grafana/xk6-browser/pull/1038) Fix read/write data race for edge case with remote browsers. +- [browser#1035](https://github.com/grafana/xk6-browser/pull/1035) Refactor `int64` timeout to `time.Duration` which ensures no confusion as to whether a timeout is in milliseconds or seconds. +- [browser#1034](https://github.com/grafana/xk6-browser/pull/1034) Fix `page.reload` & `page.setContent` to use the default navigation timeout over the default timeout. +- [browser#1033](https://github.com/grafana/xk6-browser/pull/1033) Fix the `page` timeouts so it is actually used after being set. ## Maintenance and internal improvements @@ -85,6 +104,11 @@ Allows users to register a handler to be executed every time the `console` API m - [#3351](https://github.com/grafana/k6/pull/3351) Updated the version of Prometheus remote write output. Check the specific [release notes](https://github.com/grafana/xk6-output-prometheus-remote/releases/tag/v0.3.0). - [#3341](https://github.com/grafana/k6/pull/3341), [#3339](https://github.com/grafana/k6/pull/3339) Updated `goja` that includes Runtime initialization speed-up and a fix for source indexes. - [#3311](https://github.com/grafana/k6/pull/3311) Updated the `alpine` image version that is used as the base of the k6 Docker image. +- [browser#1043](https://github.com/grafana/xk6-browser/pull/1043), [browser#1021](https://github.com/grafana/xk6-browser/pull/1021), [browser#1019](https://github.com/grafana/xk6-browser/pull/1019), [browser#1014](https://github.com/grafana/xk6-browser/pull/1014) Fix tests. +- [browser#1000](https://github.com/grafana/xk6-browser/pull/1000), [browser#1024](https://github.com/grafana/xk6-browser/pull/1024) Refine issue and PR templates. +- [browser#1003](https://github.com/grafana/xk6-browser/pull/1003), [browser#1009](https://github.com/grafana/xk6-browser/pull/1009), [browser#1010](https://github.com/grafana/xk6-browser/pull/1010) Internal changes. +- [browser#997](https://github.com/grafana/xk6-browser/pull/997) Update readme. +- [browser#962](https://github.com/grafana/xk6-browser/pull/962) CI fixes. ## _Optional_ Roadmap