File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
docs/sources/k6/next/using-k6 Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ The assertions API is inspired by Playwright's assertion syntax, providing a flu
18
18
19
19
Assertions are provided by the [ k6-testing library] ( https://jslib.k6.io ) . Import the library to start using assertions:
20
20
21
+
21
22
``` javascript
22
23
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
23
24
import { browser } from ' k6/browser' ;
@@ -146,6 +147,19 @@ async function pizzaRecipeIsDisplayed(page) {
146
147
147
148
return textContent;
148
149
}
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
+ };
149
163
```
150
164
151
165
## Assertions vs. checks
@@ -226,6 +240,19 @@ export default async function () {
226
240
227
241
await expect (page .locator (' .error-message' )).not .toBeVisible ();
228
242
}
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
+ };
229
256
```
230
257
231
258
### Soft assertions
@@ -253,6 +280,8 @@ export default function () {
253
280
254
281
Provide descriptive error messages for better debugging:
255
282
283
+ <!-- md-k6:skip -->
284
+
256
285
``` javascript
257
286
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
258
287
import http from ' k6/http' ;
You can’t perform that action at this time.
0 commit comments