From 6606051c717dd9a8b7d0cabbb4319617f434574a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Mon, 4 Dec 2023 12:12:55 +0300 Subject: [PATCH 1/3] Add browser M1/M2 Macs Docker steps --- .../using-k6-browser/running-browser-tests.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/sources/next/using-k6-browser/running-browser-tests.md b/docs/sources/next/using-k6-browser/running-browser-tests.md index 6e28551d5c..fbdaa1a6cc 100644 --- a/docs/sources/next/using-k6-browser/running-browser-tests.md +++ b/docs/sources/next/using-k6-browser/running-browser-tests.md @@ -144,6 +144,30 @@ To run a simple local script: {{% /admonition %}} +3. Optional Step: Running browser tests in Docker on M1/M2 Macs + + 1. Make sure you’re running [the latest Docker](https://docs.docker.com/engine/install/) version. + + 2. Update [Rosetta](https://en.wikipedia.org/wiki/Rosetta_(software)) and export an environment variable with the following: + + ```bash + $ softwareupdate --install-rosetta + $ export DOCKER_DEFAULT_PLATFORM=linux/amd64 + ``` + + 3. Select VirtioFS in `Settings` > `General` > `VirtuoFS`. + + 4. Enable the Rosetta emulation in `Settings` > `Features in development` > `Use Rosetta for x86/amd64 emulation on Apple Silicon`. + + 5. Restart Docker. + + 6. Run the browser image with the following command (adds the `--platform` flag): + + ```bash + $ docker run --rm -i --platform linux/amd64 -v $(pwd):/home/k6/screenshots -e K6_BROWSER_HEADLESS=false grafana/k6:master-with-browser run - /javascript-api/k6-experimental/browser/locator) object, which you can later use to interact with the element. From 04387eb9390273bfd7f373449c4f49375a462257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 5 Dec 2023 10:39:50 +0200 Subject: [PATCH 2/3] Fix typos in M1/M2 mac steps Co-authored-by: Marie Cruz --- docs/sources/next/using-k6-browser/running-browser-tests.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/next/using-k6-browser/running-browser-tests.md b/docs/sources/next/using-k6-browser/running-browser-tests.md index fbdaa1a6cc..79eae35a4c 100644 --- a/docs/sources/next/using-k6-browser/running-browser-tests.md +++ b/docs/sources/next/using-k6-browser/running-browser-tests.md @@ -144,7 +144,7 @@ To run a simple local script: {{% /admonition %}} -3. Optional Step: Running browser tests in Docker on M1/M2 Macs +3. Optional step: running browser tests in Docker on M1/M2 Macs 1. Make sure you’re running [the latest Docker](https://docs.docker.com/engine/install/) version. @@ -155,7 +155,7 @@ To run a simple local script: $ export DOCKER_DEFAULT_PLATFORM=linux/amd64 ``` - 3. Select VirtioFS in `Settings` > `General` > `VirtuoFS`. + 3. Select VirtuoFS in `Settings` > `General` > `VirtuoFS`. 4. Enable the Rosetta emulation in `Settings` > `Features in development` > `Use Rosetta for x86/amd64 emulation on Apple Silicon`. From 3ee28305a4a972f21bd56a019f3b363d4e0d3ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 6 Dec 2023 13:02:40 +0300 Subject: [PATCH 3/3] Update mac docket steps bold nesting Co-authored-by: Heitor Tashiro Sergent --- docs/sources/next/using-k6-browser/running-browser-tests.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/next/using-k6-browser/running-browser-tests.md b/docs/sources/next/using-k6-browser/running-browser-tests.md index 79eae35a4c..b8f5697f3a 100644 --- a/docs/sources/next/using-k6-browser/running-browser-tests.md +++ b/docs/sources/next/using-k6-browser/running-browser-tests.md @@ -155,9 +155,9 @@ To run a simple local script: $ export DOCKER_DEFAULT_PLATFORM=linux/amd64 ``` - 3. Select VirtuoFS in `Settings` > `General` > `VirtuoFS`. + 3. Select VirtuoFS in **Settings** > **General** > **VirtuoFS**. - 4. Enable the Rosetta emulation in `Settings` > `Features in development` > `Use Rosetta for x86/amd64 emulation on Apple Silicon`. + 4. Enable the Rosetta emulation in **Settings** > **Features in development** > **Use Rosetta for x86/amd64 emulation on Apple Silicon**. 5. Restart Docker.