Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save robin-a-meade/00fec608c0107293b174544b9162a78b to your computer and use it in GitHub Desktop.

Select an option

Save robin-a-meade/00fec608c0107293b174544b9162a78b to your computer and use it in GitHub Desktop.
Playwright compatible distrobox setup on Fedora 41

Setup on Fedora 41 (or other not supported Linux distro)

Playwright doesn't support Fedora distribution. Following is a description how to run the tests using Ubuntu 22.04 image using distrobox which is fairy supported on various Linux distributions.

Install distrobox and podman packages

sudo dnf install distrobox podman

Create home directory for your distrobox environment. It is useful not to mess with your host system home directory.

mkdir ~/distrobox

Create distrobox container environment to run tests

This command creates container using podman in your host. For more information see the documentation.

distrobox create \
--name pw --image ubuntu:22.04 \
--home ~/distrobox  \
--root \
--additional-packages "podman libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb" \
--unshare-all \
--absolutely-disable-root-password-i-am-really-positively-sure

Note

The last option of the previous command is not necessary. If avoided one will be asked for password used in sudo command in the container. One can enter the created distrobox environment using:

distrobox enter --root pw

Install nodejs in the newly created environment

We recommend to use Nodesource to help you with the nodejs setup in the container.

Enter the container using:

distrobox enter --root pw

Download and run the setup for nodejs on Ubuntu installation:

curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs -y

This made nodejs environment setup complete.

Next is to install playwright and run the test.

npx playwright install --with-deps
npm test

Note

There is a decription of how to run keycloak-js test here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment