The project development requires Python version 3.9+. To set it as default in the environment run the following commands:
# You may need to install python 3.9 venv if it's missing, on Ubuntu just run `sudo apt-get install python3.9-venv`
python3.9 -m venv env
source ./env/bin/activate
Install required dependencies:
python -m pip install --upgrade pip wheel
pip install -r local-requirements.txt
Build and install drivers:
pip install -e.
python setup.py bdist_wheel
# For all platforms
python setup.py bdist_wheel --all
Run tests:
pytest --browser chromium
Checking for typing errors
mypy playwright
Format the code
pre-commit install
pre-commit run --all-files
For more details look at the CI configuration.
Collect coverage
pytest --browser chromium --cov-report html --cov=playwright
open htmlcov/index.html
./scripts/update_api.sh
pre-commit run --all-files
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.