File tree Expand file tree Collapse file tree 15 files changed +208
-0
lines changed
docs/sources/k6/next/javascript-api/jslib/testing Expand file tree Collapse file tree 15 files changed +208
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,19 @@ export default function () {
63
63
import { browser } from ' k6/experimental/browser' ;
64
64
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
65
65
66
+ export const options = {
67
+ scenarios: {
68
+ ui: {
69
+ executor: ' shared-iterations' ,
70
+ options: {
71
+ browser: {
72
+ type: ' chromium' ,
73
+ },
74
+ },
75
+ },
76
+ }
77
+ };
78
+
66
79
export default async function () {
67
80
const page = browser .newPage ();
68
81
Original file line number Diff line number Diff line change @@ -145,6 +145,19 @@ export default function () {
145
145
import { browser } from ' k6/experimental/browser' ;
146
146
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
147
147
148
+ export const options = {
149
+ scenarios: {
150
+ ui: {
151
+ executor: ' shared-iterations' ,
152
+ options: {
153
+ browser: {
154
+ type: ' chromium' ,
155
+ },
156
+ },
157
+ },
158
+ }
159
+ };
160
+
148
161
// Create expect instance configured for browser testing with longer timeouts
149
162
const browserExpect = expect .configure ({
150
163
timeout: 15000 , // Longer timeout for browser operations
Original file line number Diff line number Diff line change @@ -58,6 +58,19 @@ Retrying assertions automatically retry until they pass or timeout. These are pa
58
58
import { browser } from ' k6/experimental/browser' ;
59
59
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
60
60
61
+ export const options = {
62
+ scenarios: {
63
+ ui: {
64
+ executor: ' shared-iterations' ,
65
+ options: {
66
+ browser: {
67
+ type: ' chromium' ,
68
+ },
69
+ },
70
+ },
71
+ }
72
+ };
73
+
61
74
export default async function () {
62
75
const page = browser .newPage ();
63
76
await page .goto (' https://test.k6.io' );
Original file line number Diff line number Diff line change @@ -41,6 +41,19 @@ You can pass a `RetryConfig` object as the last parameter to any retrying assert
41
41
import { browser } from ' k6/browser' ;
42
42
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
43
43
44
+ export const options = {
45
+ scenarios: {
46
+ ui: {
47
+ executor: ' shared-iterations' ,
48
+ options: {
49
+ browser: {
50
+ type: ' chromium' ,
51
+ },
52
+ },
53
+ },
54
+ }
55
+ };
56
+
44
57
export default async function () {
45
58
const page = await browser .newPage ();
46
59
await page .goto (' https://quickpizza.grafana.com/' );
@@ -69,6 +82,19 @@ You can create a new expect instance with custom default configuration using `ex
69
82
import { browser } from ' k6/browser' ;
70
83
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
71
84
85
+ export const options = {
86
+ scenarios: {
87
+ ui: {
88
+ executor: ' shared-iterations' ,
89
+ options: {
90
+ browser: {
91
+ type: ' chromium' ,
92
+ },
93
+ },
94
+ },
95
+ }
96
+ };
97
+
72
98
// Create a new expect instance with custom retry configuration
73
99
const myExpect = expect .configure ({
74
100
timeout: 10000 , // 10 seconds default timeout
Original file line number Diff line number Diff line change @@ -37,6 +37,19 @@ All retrying assertions must be awaited since they return promises:
37
37
import { browser } from ' k6/browser' ;
38
38
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
39
39
40
+ export const options = {
41
+ scenarios: {
42
+ ui: {
43
+ executor: ' shared-iterations' ,
44
+ options: {
45
+ browser: {
46
+ type: ' chromium' ,
47
+ },
48
+ },
49
+ },
50
+ }
51
+ };
52
+
40
53
export default async function () {
41
54
const page = await browser .newPage ();
42
55
await page .goto (' https://quickpizza.grafana.com/' );
Original file line number Diff line number Diff line change @@ -45,6 +45,19 @@ This is a retrying assertion that will automatically re-check the element's stat
45
45
import { browser } from ' k6/browser' ;
46
46
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
47
47
48
+ export const options = {
49
+ scenarios: {
50
+ ui: {
51
+ executor: ' shared-iterations' ,
52
+ options: {
53
+ browser: {
54
+ type: ' chromium' ,
55
+ },
56
+ },
57
+ },
58
+ }
59
+ };
60
+
48
61
export default async function () {
49
62
const page = await browser .newPage ();
50
63
Original file line number Diff line number Diff line change @@ -45,6 +45,19 @@ This is a retrying assertion that will automatically re-check the element's disa
45
45
import { browser } from ' k6/browser' ;
46
46
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
47
47
48
+ export const options = {
49
+ scenarios: {
50
+ ui: {
51
+ executor: ' shared-iterations' ,
52
+ options: {
53
+ browser: {
54
+ type: ' chromium' ,
55
+ },
56
+ },
57
+ },
58
+ }
59
+ };
60
+
48
61
export default async function () {
49
62
const page = await browser .newPage ();
50
63
await page .goto (' https://quickpizza.grafana.com/' );
Original file line number Diff line number Diff line change @@ -49,6 +49,19 @@ This is a retrying assertion that will automatically re-check the element's edit
49
49
import { browser } from ' k6/browser' ;
50
50
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
51
51
52
+ export const options = {
53
+ scenarios: {
54
+ ui: {
55
+ executor: ' shared-iterations' ,
56
+ options: {
57
+ browser: {
58
+ type: ' chromium' ,
59
+ },
60
+ },
61
+ },
62
+ }
63
+ };
64
+
52
65
export default async function () {
53
66
const page = await browser .newPage ();
54
67
Original file line number Diff line number Diff line change @@ -50,6 +50,19 @@ This is a retrying assertion that will automatically re-check the element's enab
50
50
import { browser } from ' k6/browser' ;
51
51
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
52
52
53
+ export const options = {
54
+ scenarios: {
55
+ ui: {
56
+ executor: ' shared-iterations' ,
57
+ options: {
58
+ browser: {
59
+ type: ' chromium' ,
60
+ },
61
+ },
62
+ },
63
+ }
64
+ };
65
+
53
66
export default async function () {
54
67
const page = await browser .newPage ();
55
68
await page .goto (' https://quickpizza.grafana.com/' );
Original file line number Diff line number Diff line change @@ -50,6 +50,19 @@ This is a retrying assertion that will automatically re-check the element's visi
50
50
import { browser } from ' k6/browser' ;
51
51
import { expect } from ' https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js' ;
52
52
53
+ export const options = {
54
+ scenarios: {
55
+ ui: {
56
+ executor: ' shared-iterations' ,
57
+ options: {
58
+ browser: {
59
+ type: ' chromium' ,
60
+ },
61
+ },
62
+ },
63
+ }
64
+ };
65
+
53
66
export default async function () {
54
67
const page = await browser .newPage ();
55
68
await page .goto (' https://quickpizza.grafana.com/' );
You can’t perform that action at this time.
0 commit comments