Skip to content

Commit

Permalink
Adds xk6-browser v1.0.2 release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ka3de committed Aug 9, 2023
1 parent 66683f6 commit be5dbd5
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions release notes/v0.46.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ k6 `v0.46` is here 🎉! This release includes:

- `#pr`, `<small_break_1>`
- `#pr`, `<small_break_2>`
- [browser#868](https://github.com/grafana/xk6-browser/pull/868) Removes support for browser `devtools` option.
- [browser#870](https://github.com/grafana/xk6-browser/pull/870) Removes support for browser `env` option.
- [browser#872](https://github.com/grafana/xk6-browser/pull/872) Removes support for browser `proxy` option.
- [browser#876](https://github.com/grafana/xk6-browser/pull/876) Refactors browser options. Browser `launch`/`connect` options are no longer defined in the corresponding JS API methods as these no longer exist, instead the test execution related options are now defined inside the browser scenario options (see [#3036](https://github.com/grafana/k6/pull/3036)), and the other more "environmental options", such as `headless`, `debug`, `executablePath`, are set as ENV vars. Also `slowMo` option is no longer supported, although it might be supported again in the future through a different API.
- [browser#885](https://github.com/grafana/xk6-browser/pull/885) Renames Web Vitals metrics to use `browser_` prefix and short namings (e.g.: `webvital_first_input_delay` -> `browser_web_vital_fid`).
- [browser#903](https://github.com/grafana/xk6-browser/pull/903) Renames metrics with a browser prefix. Metrics related with HTTP requests performed from the browser are now split from the default HTTP module metrics into their own `browser_` prefixed metrics.
- [browser#910](https://github.com/grafana/xk6-browser/pull/910) Abstracts `browser` and `browserType` from JS API. Users no longer have to explicitly initialize/close the browser instance through the JS API, instead a browser instance will be automatically initialized/closed at the beginning/end of each iteration if the browser type is set in scenario options (see [#3036](https://github.com/grafana/k6/pull/3036))). This also implies that the `chromium` entity from `k6/experimental/browser` import path is no longer valid, instead the `browser` entity provides access to the browser methods such as `browser.newPage()`.
- [browser#915](https://github.com/grafana/xk6-browser/pull/915) Removes the Web Vitals rating metric. Instead the rating is now set as a label in all other Web Vitals metrics.
- [browser#916](https://github.com/grafana/xk6-browser/pull/916) Removes some of the http metrics. Specifically removes the HTTP metrics that measure number of requests and the time per request stage (connecting, sending, receiving...), which means that the browser module will just report `browser_http_req_duration` and `browser_http_req_failed` HTTP metrics.
- [browser#919](https://github.com/grafana/xk6-browser/pull/919) Do not expose `browser.on()` method. Considering the new automatic way to initialize/close browser instances, this method is no longer applicable.
- [browser#929](https://github.com/grafana/xk6-browser/pull/929) Limits browser implementation to hold a single `browserContext`. Only one concurrent `browserContext` is allowed per iteration, which means that the user can create a new `browserContext`, close it, and then create it again; but can not have more than one "alive" `browserContext`. Instead, [scenarios](https://k6.io/docs/using-k6/scenarios/) should be used to separate independent actions in a test.
- [browser#945](https://github.com/grafana/xk6-browser/pull/945) Refactors `browser.contexts()` method to `browser.context()`. This is a required change after the modifications done to only allow a single concurrent `browserContext` in [browser#929](https://github.com/grafana/xk6-browser/pull/929).

### (_optional h3_) `<big_breaking_change>` `#pr`

Expand Down Expand Up @@ -35,6 +47,38 @@ This release supports the new integration between k6 and Tempo in the cloud. Gra

The new cloud traces will work "out of the box" for `k6 cloud` runs. In case of `k6 run` execution, the `K6_CLOUD_TRACES_ENABLED` environment variable has to be set to `true`.

### Automatic Browser Lifecycle Handling [browser#910](https://github.com/grafana/xk6-browser/pull/910), [browser#944](https://github.com/grafana/xk6-browser/pull/944)

This release changes the way the browser lifecycle is handled. Previously the creation/closing of the browser instance through the JS API was delegated to the user through `browserType.launch()` and `browserType.connect()` methods for creation; and `browser.close()` method to release the associated resources before finishing the iteration. This was a common boilerplate code that is now removed. Instead, for any browser based test, the user now has to specify the browser type field inside scenario options, and a browser instance will be automatically created and closed for each iteration.

With this change and the browser options refactor done in [browser#876](https://github.com/grafana/xk6-browser/pull/876), a simple browser test now looks like:
```js
import { browser } from 'k6/experimental/browser';

export const options = {
scenarios: {
ui: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium', // chromium is the only supported browser type so as long as
// the option is set, Chromium/Google Chrome will be used
},
},
},
},
};

export default async function () {
const page = browser.newPage();
try {
await page.goto('https://grafana.com')
} finally {
page.close();
}
}
```

### `<big_feature_1>` `#pr`

_what, why, and what this means for the user_
Expand All @@ -52,12 +96,20 @@ _Format as `<number> <present_verb> <object>. <credit>`_:
- [#3159](https://github.com/grafana/pull/3159) Adds per-vu TLS configuration to `grpc.Client` connect method's parameters. Thanks @chrismoran-mica 🙇‍♂️.
- [#3176](https://github.com/grafana/pull/3176) Adds a `js/promises` package, which enables extension developers to easily create promises that will be dispatched to the eventloop using the `New` function.
- [#3181](https://github.com/grafana/pull/3181) Adds a `RunOnEventLoop` method to the `modulestest.Runtime` type, which allows extensions developers to run code on the event loop from their tests.
- [browser#901](https://github.com/grafana/xk6-browser/pull/901) Adds support for shadow DOM piercing in `locator`. Thanks to @tmc for its implementation.
- [browser#953](https://github.com/grafana/xk6-browser/pull/953) Improves Web Vitals reporting for better accuracy and consistency.

## Bug fixes

- [#3163](https://github.com/grafana/pull/3163) Addresses a bug in our gRPC example.
- [#3178](https://github.com/grafana/pull/3178) Fixes the registration of nested protobuf messages in the gRPC module.
- [#3170](https://github.com/grafana/pull/3170) Upgrades the version of gRPC k6 depends on to address a security vulnerability ([CVE-2023-32731]).
- [browser#866](https://github.com/grafana/xk6-browser/pull/866) Disables the timeout on browser process execution.
- [browser#942](https://github.com/grafana/xk6-browser/pull/942) Fixes deadlock in `frameNavigated`.
- [browser#943](https://github.com/grafana/xk6-browser/pull/943) Fixes a race condition in navigation and lifecycle events.
- [browser#979](https://github.com/grafana/xk6-browser/pull/979) Fixes a deadlock on `pagehide` event evaluation when `page.close()` is called.
- [browser#980](https://github.com/grafana/xk6-browser/pull/980) Fixes Loki log output for console log serializer.
- [browser#991](https://github.com/grafana/xk6-browser/pull/991) Fixes data directory not being cleared during `browser.close()` panic.

## Maintenance and internal improvements

Expand Down Expand Up @@ -89,6 +141,24 @@ _Format as `<number> <present_verb> <object>. <credit>`_:
- [#3136](https://github.com/grafana/k6/pull/3136) Updates k6 Go dependencies.
- [#3131](https://github.com/grafana/k6/pull/3131) Updates our Pull Request template to be more structured and include a checklist for contributors.
- [#3177](https://github.com/grafana/k6/pull/3177) Updates the version of golangci-lint we use to the latest version.
- [browser#849](https://github.com/grafana/xk6-browser/pull/849) Updates `nil` session log warn to debug level in page attach.
- [browser#881](https://github.com/grafana/xk6-browser/pull/881) Adds a new `browser_http_req_failed` metric.
- [browser#889](https://github.com/grafana/xk6-browser/pull/889) Refactors `isRemoteBrowser` check.
- [browser#889](https://github.com/grafana/xk6-browser/pull/899) Refactors pid registry.
- [browser#902](https://github.com/grafana/xk6-browser/pull/902) Refactors registry back into browser package.
- [browser#904](https://github.com/grafana/xk6-browser/pull/904) Fixes a race condition in Web Vitals unit test.
- [browser#906](https://github.com/grafana/xk6-browser/pull/906) Parses the scenarios JSON definition from the `K6_INSTANCE_SCENARIOS` environment variable.
- [browser#918](https://github.com/grafana/xk6-browser/pull/918) Replaces the usage of `os.LookupEnv` for k6 `LookupEnv` and abstracts environment variables lookup.
- [browser#923](https://github.com/grafana/xk6-browser/pull/923) Removes the browser module exported version field.
- [browser#935](https://github.com/grafana/xk6-browser/pull/935) Refactors the integration test browser implementation.
- [browser#936](https://github.com/grafana/xk6-browser/pull/936) Removes the `BaseEventEmitter` from browser.
- [browser#959](https://github.com/grafana/xk6-browser/pull/959) Fixes `TestFrameNoPanicNavigateAndClickOnPageWithIFrames` test.
- [browser#972](https://github.com/grafana/xk6-browser/pull/972) Fixes log level from `warn` to `debug` when `fetchBody` fails due to `context` being canceled on iteration end.
- [browser#977](https://github.com/grafana/xk6-browser/pull/977) Removes goroutine ID field from logger.
- [browser#978](https://github.com/grafana/xk6-browser/pull/978) Adds browser extension source log field.
- [browser#983](https://github.com/grafana/xk6-browser/pull/983) Avoids `onRequestPaused` error log when `context` is canceled.
- [browser#984](https://github.com/grafana/xk6-browser/pull/984) Ensures CDP requests message ID are unique at the connection scope.
- [browser#992](https://github.com/grafana/xk6-browser/pull/992) Fixes go mod prometheus dependency issue.

## _Optional_ Roadmap

Expand Down

0 comments on commit be5dbd5

Please sign in to comment.