This project sets up a Python virtual environment and installs necessary dependencies, including Playwright, to run a demo test using pytest
.
Make sure you have the following installed on your system:
- Operating System: Debian 11, Debian 12, Ubuntu 20.04, Ubuntu 22.04, or Ubuntu 24.04
- Architecture: x86-64 or arm64
- Python: Python 3.8+
sudo
privileges- Internet connection for downloading packages
-
Clone the repository (if applicable):
-
Run the setup script: Run
source install.sh
. The setup script will replace the existingplaywright_venv
folder with a fresh one, update your system packages, and install the necessary Python packages and Playwright browsers. -
Run the demo test: Once the setup is complete, you can run the demo test using
pytest test_demo.py
.
The install.sh
script performs the following steps:
- Prompts the user to confirm if they want to replace the existing
playwright_venv
folder. - Deactivates any active Python virtual environment.
- Removes the existing
playwright_venv
folder if it exists. - Updates system packages.
- Installs necessary packages:
python3-venv
,figlet
,jp2a
, andpython3-pip
. - Creates and activates a new Python virtual environment (
playwright_venv
). - Upgrades
pip
to the latest version. - Installs Python packages listed in
requirements.txt
. - Installs Playwright browsers.
- Displays a success message using
figlet
.
- The script uses
sudo
for package installation and removing directories. Ensure you have the necessary privileges to runsudo
commands. - The
requirements.txt
file should be in the same directory asinstall.sh
and list all the required Python packages for your project. - In case you need to activate a virtual env in Python run in the project folder
source playwright_venv/bin/activate
. To deactivate it rundeactivate
.
- If you encounter network issues during package installation, ensure you have a stable internet connection.
- If the script fails at any step, check the error message, resolve the issue, and rerun the script.
- Make sure the
requirements.txt
file exists and is correctly formatted.
This project is licensed under the MIT License. For more information, please visit MIT License on GitHub.