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.
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
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
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
npm test
If there are still missing libraries after following this, try running
sudo apt update
.