Skip to content

Commit 4787cf4

Browse files
committed
fix: assertions.md codeblocks
1 parent ce1d18e commit 4787cf4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/sources/k6/next/using-k6/assertions.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The assertions API is inspired by Playwright's assertion syntax, providing a flu
1818

1919
Assertions are provided by the [k6-testing library](https://jslib.k6.io). Import the library to start using assertions:
2020

21+
2122
```javascript
2223
import { expect } from 'https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js';
2324
import { browser } from 'k6/browser';
@@ -146,6 +147,19 @@ async function pizzaRecipeIsDisplayed(page) {
146147

147148
return textContent;
148149
}
150+
151+
export const options = {
152+
scenarios: {
153+
ui: {
154+
executor: 'shared-iterations',
155+
options: {
156+
browser: {
157+
type: 'chromium',
158+
},
159+
},
160+
},
161+
},
162+
};
149163
```
150164

151165
## Assertions vs. checks
@@ -226,6 +240,19 @@ export default async function () {
226240

227241
await expect(page.locator('.error-message')).not.toBeVisible();
228242
}
243+
244+
export const options = {
245+
scenarios: {
246+
ui: {
247+
executor: 'shared-iterations',
248+
options: {
249+
browser: {
250+
type: 'chromium',
251+
},
252+
},
253+
},
254+
},
255+
};
229256
```
230257

231258
### Soft assertions
@@ -253,6 +280,8 @@ export default function () {
253280

254281
Provide descriptive error messages for better debugging:
255282

283+
<!-- md-k6:skip -->
284+
256285
```javascript
257286
import { expect } from 'https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js';
258287
import http from 'k6/http';

0 commit comments

Comments
 (0)