Ensure your system is up to date:
sudo apt update && sudo apt upgrade -yLinux Mint typically comes with Python preinstalled. Check your version:
python3 --versionIf Python is missing or outdated, install it:
sudo apt install python3 python3-pip -yVerify pip installation:
pip3 --versionIf pip is missing, install it:
sudo apt install python3-pip -yTo avoid dependency conflicts, create a virtual environment:
python3 -m venv playwright_env
source playwright_env/bin/activateUse pip to install Playwright:
pip install playwrightPlaywright requires browser binaries. Install them with:
playwright installTo install only Chromium (to save space):
playwright install chromiumRun 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-playwrightThen, 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=4install reporter pip install pytest-html
generate report with: pytest --html=report.html