From 5f87a5b4a3ee6ff3dcd5cd08f46085b63e7c7bba Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 27 Sep 2023 11:43:27 +0100 Subject: [PATCH 1/8] Add release notes for remaining browser updates --- release notes/v0.47.0.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index c5e2a068c26..e3f7368e0d4 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -65,6 +65,8 @@ Allows users to register a handler to be executed every time the `console` API m - [#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#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#1007](https://github.com/grafana/xk6-browser/pull/1007) Inject `window.k6 = {};` to help identify k6 browser module tests. ## Bug fixes @@ -75,6 +77,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 race condition for edge case with remote browsers. +- [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. +- [browser#1022](https://github.com/grafana/xk6-browser/pull/1022) Fix the `check` in examples/fillform.js so that it matches the type definitions and documentation for `check`. ## Maintenance and internal improvements @@ -85,6 +91,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), [#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) Internal refactor. +- [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 From 5d6933ff9cbaa3958821788632054ca3b763af4e Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 27 Sep 2023 13:36:38 +0100 Subject: [PATCH 2/8] Add 1009 and 1010 PRs to internal improvements --- release notes/v0.47.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index e3f7368e0d4..f74bb966686 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -96,6 +96,7 @@ Allows users to register a handler to be executed every time the `console` API m - [browser#1003](https://github.com/grafana/xk6-browser/pull/1003) Internal refactor. - [browser#997](https://github.com/grafana/xk6-browser/pull/997) Update readme. - [browser#962](https://github.com/grafana/xk6-browser/pull/962) CI fixes. +- [browser#1009](https://github.com/grafana/xk6-browser/pull/1009), [browser#1010](https://github.com/grafana/xk6-browser/pull/1010) Supporting internal changes. ## _Optional_ Roadmap From 5630386d8bf88bd242be2d018139c8a879aba22f Mon Sep 17 00:00:00 2001 From: Ankur Date: Wed, 27 Sep 2023 13:39:15 +0100 Subject: [PATCH 3/8] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: İnanç Gümüş --- release notes/v0.47.0.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index f74bb966686..a05d077677f 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -80,7 +80,7 @@ Allows users to register a handler to be executed every time the `console` API m - [browser#1038](https://github.com/grafana/xk6-browser/pull/1038) Fix read/write race condition for edge case with remote browsers. - [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. -- [browser#1022](https://github.com/grafana/xk6-browser/pull/1022) Fix the `check` in examples/fillform.js so that it matches the type definitions and documentation for `check`. +- [browser#1022](https://github.com/grafana/xk6-browser/pull/1022) Fix the `check` in `examples/fillform.js` so that it matches the type definitions and documentation for `check`. ## Maintenance and internal improvements @@ -91,7 +91,7 @@ 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), [#1014](https://github.com/grafana/xk6-browser/pull/1014) Fix tests. +- [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) Internal refactor. - [browser#997](https://github.com/grafana/xk6-browser/pull/997) Update readme. From 89130002df854284f1a8c756359b351924abc579 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 27 Sep 2023 13:40:18 +0100 Subject: [PATCH 4/8] Refactor to data race MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: İnanç Gümüş --- release notes/v0.47.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index a05d077677f..ed05930d901 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -77,7 +77,7 @@ 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 race condition for edge case with remote browsers. +- [browser#1038](https://github.com/grafana/xk6-browser/pull/1038) Fix read/write data race for edge case with remote browsers. - [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. - [browser#1022](https://github.com/grafana/xk6-browser/pull/1022) Fix the `check` in `examples/fillform.js` so that it matches the type definitions and documentation for `check`. From 7e25e672a36eb84a4f3f170637e90912701c25f2 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 27 Sep 2023 13:41:59 +0100 Subject: [PATCH 5/8] Move browser#1022 to improvements Co-authored-by: Oleg Bespalov --- release notes/v0.47.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index ed05930d901..36dd48deecc 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -67,6 +67,7 @@ Allows users to register a handler to be executed every time the `console` API m - [#3340](https://github.com/grafana/k6/pull/3340) The k6 ``*-with-browser`` Docker images set now the `no-sandbox` environment variable automatically. - [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#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 @@ -80,7 +81,6 @@ Allows users to register a handler to be executed every time the `console` API m - [browser#1038](https://github.com/grafana/xk6-browser/pull/1038) Fix read/write data race for edge case with remote browsers. - [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. -- [browser#1022](https://github.com/grafana/xk6-browser/pull/1022) Fix the `check` in `examples/fillform.js` so that it matches the type definitions and documentation for `check`. ## Maintenance and internal improvements From 698baab6192a27058ca285ed9773d79042338b0b Mon Sep 17 00:00:00 2001 From: ka3de Date: Thu, 28 Sep 2023 10:06:51 +0200 Subject: [PATCH 6/8] Add page.on() example --- release notes/v0.47.0.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index 36dd48deecc..34c8660e54d 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -59,6 +59,19 @@ 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. From f6d882a1609c06b3093659390b8bef5d944c4313 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Thu, 28 Sep 2023 09:38:38 +0100 Subject: [PATCH 7/8] Move browser#1035 to bug fixes section --- release notes/v0.47.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index 34c8660e54d..bdb669f34e4 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -78,7 +78,6 @@ page.evaluate(() => console.log('this is a console.log message', 42)); - [#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#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#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`. @@ -92,6 +91,7 @@ page.evaluate(() => console.log('this is a console.log message', 42)); - [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. From b761f40bf55975fa99d49a505a27a96d44037516 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 2 Oct 2023 14:12:32 +0100 Subject: [PATCH 8/8] Refactor internal changes issues --- release notes/v0.47.0.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release notes/v0.47.0.md b/release notes/v0.47.0.md index bdb669f34e4..906c5c437d3 100644 --- a/release notes/v0.47.0.md +++ b/release notes/v0.47.0.md @@ -106,10 +106,9 @@ page.evaluate(() => console.log('this is a console.log message', 42)); - [#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) Internal refactor. +- [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. -- [browser#1009](https://github.com/grafana/xk6-browser/pull/1009), [browser#1010](https://github.com/grafana/xk6-browser/pull/1010) Supporting internal changes. ## _Optional_ Roadmap