Ensure your system is up to date:
sudo apt update && sudo apt upgrade -y
Linux Mint typically comes with Python preinstalled. Check your version:
python3 --version
If Python is missing or outdated, install it:
sudo apt install python3 python3-pip -y
Verify pip
installation:
pip3 --version
If pip
is missing, install it:
sudo apt install python3-pip -y
To avoid dependency conflicts, create a virtual environment:
python3 -m venv playwright_env
source playwright_env/bin/activate
Use pip
to install Playwright:
pip install playwright
Playwright requires browser binaries. Install them with:
playwright install
To install only Chromium (to save space):
playwright install chromium
Run the following command to check if Playwright is installed correctly:
python -c "from playwright.sync_api import sync_playwright; print('Playwright installed successfully!')"
If no errors appear, the installation was successful.
If you're using Pytest to run Playwright tests, install the Playwright plugin:
pip install pytest-playwright
Then, configure Playwright within your Pytest framework.
You're now ready to use Playwright on Linux Mint! 🚀
To run tests in parallel:
pip install pytest-xdist then
pytest --numprocesses=4
install reporter pip install pytest-html
generate report with: pytest --html=report.html