You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/data/markdown/docs/02 javascript api/07 k6-experimental/01 browser.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,12 +79,18 @@ export default async function () {
79
79
80
80
Then, you can run the test with this command. Also, see the [browser module options](/javascript-api/k6-experimental/browser/#browser-module-options) for customizing the browser module's behavior using environment variables.
# When using the `k6:master-with-browser` Docker image, you need to add `--cap-add=SYS_ADMIN`
90
+
# to grant further system permissions on the host for the Docker container.
91
+
docker run --rm -i --cap-add=SYS_ADMIN grafana/k6:master-with-browser run - <script.js
92
+
```
93
+
88
94
```bash
89
95
C:\k6> k6 run script.js
90
96
```
@@ -131,11 +137,16 @@ You can customize the behavior of the browser module by providing browser option
131
137
132
138
The following command passes the [browser module options](#browser-module-options) as environment variables to launch a headful browser with custom arguments.
This gives you a representation of browser performanceas well as the usual HTTP specific metrics that k6 already tracks which lets you have a full picture on how your application behaves from a frontend and backend perspective, all in a single script.
131
+
This gives you a representation of browser performance, via the web vitals, as well as the HTTP requests that came from the browser.
Collapse file: src/data/markdown/translated-guides/en/03 Using k6 browser/02 Running browser tests.md
Copy file name to clipboardExpand all lines: src/data/markdown/translated-guides/en/03 Using k6 browser/02 Running browser tests.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,13 +82,11 @@ $ k6 run script.js
82
82
```bash
83
83
# When using the `k6:master-with-browser` Docker image, you need to add `--cap-add=SYS_ADMIN`
84
84
# to grant further system permissions on the host for the Docker container.
85
-
# There is also no need to set the K6_BROWSER_ENABLED variable explicitly since this is already
86
-
# defined in the Dockerfile.
87
85
docker run --rm -i --cap-add=SYS_ADMIN grafana/k6:master-with-browser run - <script.js
88
86
```
89
87
90
88
```bash
91
-
C:\k6>set"K6_BROWSER_ENABLED=true"&&k6 run script.js
89
+
C:\k6> k6 run script.js
92
90
```
93
91
94
92
```bash
@@ -99,12 +97,18 @@ PS C:\k6> k6 run script.js
99
97
100
98
You can also use [the browser module options](/javascript-api/k6-experimental/browser/#browser-module-options) to customize the launching of a browser process. For instance, you can start a headful browser using the previous test script with this command.
0 commit comments