Skip to content

Commit

Permalink
Release notes v0.3.0 (#265)
Browse files Browse the repository at this point in the history
* Add checkHitTarget fix to release notes

* Update #264 details

* Mention the rest of v0.3.0 changes

* Update mention of JS API docs

* Mention k6 update along with other dependencies

* Mention #299 fix

* Mention #300 improvement

* Remove leftover closing paren

* Add 264 as a feature (#265)

* Update 283 comment (#265)

* Add executablePath option (#265)

* Rephrase code refactors (#265)

* Rephrase waitForFunction mention

Resolves #265 (comment)

* Mention the project roadmap as an improvement

* Mention that raf is the default waitForFunction polling option

Co-authored-by: Ivan Mirić <ivan.miric@grafana.com>
  • Loading branch information
inancgumus and Ivan Mirić authored May 9, 2022
1 parent 6e49bc8 commit 7d2e8ee
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions release notes/v0.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
xk6-browser v0.3.0 is here! :tada:

This is a minor release with some important bug fixes, a couple of new features, improvements and code refactoring!


## New features

- Implemented `Browser.on(event)`. ([#268](https://github.com/grafana/xk6-browser/pull/268), [#287](https://github.com/grafana/xk6-browser/pull/287))

`on('disconnected')` returns a `Promise` you can wait on to get notified when the WebSocket connection to the browser is closed. See [this example](https://github.com/grafana/xk6-browser/blob/v0.3.0/examples/browser_on.js) for details.

This is the first async method in xk6-browser, using the newly released [event loop support in k6](https://github.com/grafana/k6/pull/2228), and marks the start of our transition to async APIs. :tada:

- Exposed preconfigured mobile device emulation settings. ([#289](https://github.com/grafana/xk6-browser/pull/289))

We maintain an internal list of popular devices with their viewport size, user agent and scaling factor, which is useful to test how a web site looks and behaves on different devices. See [this example](https://github.com/grafana/xk6-browser/blob/v0.3.0/examples/device_emulation.js) for details.

- Made concealed elements clickable. ([#264](https://github.com/grafana/xk6-browser/pull/264))

We've added an automatic retry mechanism to improve the reliability of element and pointer actions. We will further improve this in future releases - hence our users' experience.


## Bugs fixed

- Made concealed elements clickable. ([#264](https://github.com/grafana/xk6-browser/pull/264))

Previously, interacting with an element obscured by another was failing with `wait for selector did not result in any nodes`. Now we properly detect this scenario and retry the action with different scroll positions. This affects all `Element` and `Frame` `click()`, `dblclick()`, `hover()`, `check()`, `uncheck()` and `tap()` actions.

- Fixed `waitForSelector()` flakiness by retrying once on failure. ([#260](https://github.com/grafana/xk6-browser/pull/260))

- Fixed data race accessing `Frame.documentHandle` while switching execution contexts. ([#263](https://github.com/grafana/xk6-browser/pull/263))

- Fixed keyboard press of special keys. ([#283](https://github.com/grafana/xk6-browser/pull/283))

Previously pressing some keys like Backspace, Delete, ArrowLeft, and AltGraph would panic.

- Fixed negative metric emission in certain rare scenarios. ([#288](https://github.com/grafana/xk6-browser/pull/288))

- Fixed `Page.waitForFunction()`. ([#294](https://github.com/grafana/xk6-browser/pull/294))

`waitForFunction()` previously wasn't working. The fix is a rewrite of the feature that ensures all three polling variants work. Valid `polling` options are:
* `raf` (default): run the predicate function in a [`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) callback. This will run most frequently, up to 60 times a second.
* `mutation`: run the predicate function on every DOM mutation.
* number: run the predicate function at an interval, this many milliseconds apart.

Also note that this is now an async method that returns a `Promise`, so you must use `then()` to resolve it.

See [this example](https://github.com/grafana/xk6-browser/blob/v0.3.0/examples/waitforfunction.js) for details.

- Fixed `Page.innerHTML()`, `Page.innerText()` and `Page.textContent()` panic. ([#299](https://github.com/grafana/xk6-browser/pull/299))

- Fixed the `executablePath` option. ([#246](https://github.com/grafana/xk6-browser/pull/246))

Although you could fill this option out, it wasn't working before, and we were using a predefined path by default. We implemented the option code, and you can now run a Chrome browser of your choice by providing the file path.


## Improvements

- Improved detection of non-clickable elements. ([#270](https://github.com/grafana/xk6-browser/pull/270))

We now properly detect elements obscured by another element and return an error instead of waiting. This enables the fix in [#264](https://github.com/grafana/xk6-browser/pull/264).

- Cleanly close the WebSocket connection when `Browser.close()` is called. ([#268](https://github.com/grafana/xk6-browser/pull/268))

- Added lifecycle event validation to `Page.waitForLoadState()`. ([#300](https://github.com/grafana/xk6-browser/pull/300))

- We have started updating our [JavaScript API documentation](https://k6.io/docs/javascript-api/xk6-browser/), which we know how important it is to serve as a reference while writing your scripts. This is an ardous task that won't be possible in a couple of weeks, but rest assured we're prioritizing it in all upcoming development cycles, and will be releasing gradual changes as they're done.

- We added a [project roadmap](https://github.com/grafana/xk6-browser/blob/v0.3.0/ROADMAP.md) to share our development goals with the community.



## Internals

- Refactored the `chromium` package to fix linter issues and improve code structure. ([#246](https://github.com/grafana/xk6-browser/pull/246))

- Several code refactors to improve maintainability. ([#269](https://github.com/grafana/xk6-browser/pull/269), [#293](https://github.com/grafana/xk6-browser/pull/293))

- All dependencies were updated to their latest versions. ([#274](https://github.com/grafana/xk6-browser/pull/274))
Specifically, k6 was updated to [v0.38.0](https://github.com/grafana/k6/releases/tag/v0.38.0), which required us to fix some breaking changes ([#286](https://github.com/grafana/xk6-browser/pull/286), [#302](https://github.com/grafana/xk6-browser/pull/302)).

0 comments on commit 7d2e8ee

Please sign in to comment.