release notes/v1.1.0.md
k6 v1.1.0 is here 🎉! This release includes:
count, nth, first, and last methods for the browser module's Locator API #4797, #4825k6/experimental/webcrypto module has been removed as its functionality is available globally.full end-of-test summary are now sorted as in code and properly indented.As per our stability guarantees, breaking changes across minor releases are allowed only for experimental features.
k6/experimental/webcrypto module #4851The WebCrypto API has been available globally since v1.0.0-rc1 (or v0.58.0), and now the experimental import (k6/experimental/webcrypto) is no longer available.
The required change for users is to remove the import; the rest of the code should work.
count method for the browser module's Locator API #4797The new locator.Count method returns the number of elements matching the locator. Unlike other Locator API methods, locator.Count returns the result immediately and doesn't wait for the elements to be visible.
import { expect } from "https://jslib.k6.io/k6-testing/0.4.0/index.js";
import { browser } from 'k6/browser'
export const options = {
scenarios: {
ui: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
}
export default async function () {
const page = await browser.newPage()
await page.goto('https://quickpizza.grafana.com/login')
expect(await page.locator('input').count()).toEqual(3);
await page.close();
}
nth, first and last methods for the browser module's Locator API #4825The new Locator API methods, nth, first, and last, can select a single element from multiple elements matched by a locator. For example, selecting a single item from a catalogue of items on an e-commerce website. Because items in this catalogue generally change often and selecting an exact element may fail in future test runs, the new methods help to prevent flaky tests, leading to more reliable tests.
import { expect } from "https://jslib.k6.io/k6-testing/0.4.0/index.js";
import { browser } from 'k6/browser'
export const options = {
scenarios: {
ui: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
}
export default async function () {
const page = await browser.newPage()
await page.goto('https://quickpizza.grafana.com')
await expect(await page.locator('p').first()).toContainText('QuickPizza');
await expect(await page.locator('p').nth(4)).toContainText('QuickPizza Labs.');
await expect(await page.locator('p').last()).toContainText('Contribute to QuickPizza');
await page.close();
}
full end-of-test summary group results as in code and fixes the indentation. Thanks, @the-it, for the contribution!k6/browser.locator.fill method when used on react based websites.12345 instead of k6 to avoid having to work with runAsUser in the pod manifest file.click is called.k6/browser performance improvements.chromedp/cdproto dependency and adjusts the Browser module accordingly.examples/grpc_server and updates its dependencies.CODECOV_TOKEN variable for GH Workflows from Vault.ubuntu-24.04-arm). Thanks, @nadiamoe, for the contribution!We're working to integrate a built-in testing and assertions module that's compatible with Playwright's in k6. You can try the current implementation using the k6 testing jslib, which serves as our work-in-progress implementation for what will become the official k6/test module (final name TBD). We'd love your feedback on issue #4805.
We're developing the next version of k6's end-of-test summary to make it easier to integrate test results into CI/CD pipelines and automated workflows. This new format will be officially supported, versioned, and designed specifically for programmatic use. Follow our progress, and provide us with feedback on issue #4803.