- Test Automation - How To Build a CI/CD Pipeline Using Pytest and GitHub Actions
- Test Automation - How To Attach Public IP Address to Allure report using Pytest and Requests
- Test Automation - Selenium Example Python Project 2022 Updates
- Test Automation - How To Add Git Version Control Data To Allure Report in Python
- Test Automation - How To Attach Session Storage, Local Storage, Cookies, and Console logs To Allure Report in Selenium Python
- Test Automation - How To Capture Full-Page Screenshots In Selenium Python Using Chrome DevTools Protocol
- Test Automation - How To Edit Cookies in Selenium Python
- Test Automation - Pre-Merge Testing with GitHub Actions: A Step-by-Step Guide
- Test Automation - How To Use Custom User Agent in Selenium Python or Playwright Python to Avoid Security Bots
- Test Automation - How to Use Dynamic Base URLs with Selenium And Playwright Python in GitHub Actions
Tool | Description |
---|---|
allure-pytest | Allure reporting with your Pytest tests for better reporting |
assertpy | An expressive assertion library for Python |
dataclasses-json | A library for serialization of dataclasses to and from JSON |
deprecated | A library for emitting warnings about deprecated code |
mailinator-python-client-2 | A Python client for interacting with the Mailinator email service |
mysql-connector-python | Interface for connecting to MySQL databases and executing SQL queries |
pytest | A popular testing framework for Python |
pytest-base-url | Pytest plugin for setting a base URL for your tests |
pytest-check | Provides additional checking functionality for your Pytest tests |
pytest-dependency | Pytest plugin that allows declaring dependencies between tests |
pytest-ordering | Pytest plugin for ordering test functions |
pytest-rerunfailures | Pytest plugin to rerun failed tests automatically |
pytest-split | Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. |
python-dotenv | Loads environment variables from a .env file, simplifying configuration |
requests | A versatile library for making HTTP requests in Python |
requests-toolbelt | Collection of utilities for python-requests |
selenium | A powerful tool for automating web browsers and conducting web tests |
tenacity | Retrying library |
visual-regression-tracker | Performs visual regression testing |
xlrd | Library for reading data and formatting information from Excel files |
git clone https://github.com/nirtal85/Selenium-Python-Example.git
cd selenium-python-example
py -m pip install --user virtualenv
py -m venv env
.\env\Scripts\activate
python3 -m pip install --user virtualenv
python3 -m venv venv
source venv/bin/activate
pip install poetry
poetry install --no-root
Create a .env
file in the project root directory to securely store project secrets and configuration variables. This
file will be used to define key-value pairs for various parameters required by the project. Add the following properties
to the .env
file:
Parameter | Description | Example Value |
---|---|---|
Your email address for authentication | "your@email.com" | |
PASSWORD | Your secret password for authentication | "your_secret_password" |
VRT_APIURL | Visual Regression Tracker API URL | "https://vrt.example.com/api" |
VRT_PROJECT | Visual Regression Tracker Project ID | "project_id" |
VRT_CIBUILDID | Visual Regression Tracker Build Number | "build_number" |
VRT_BRANCHNAME | Visual Regression Tracker Branch Name | "main" |
VRT_APIKEY | Visual Regression Tracker API Key | "your_api_key" |
VRT_ENABLESOFTASSERT | Enable Soft Assertions | True (or False) |
MAILINATOR_API_KEY | API Key for Mailinator service | "your_mailinator_api_key" |
MAILINATOR_DOMAIN_NAME | Domain name for Mailinator | "your_mailinator_domain" |
pytest --driver <firefox/chrome_headless>
When no browser was selected then chrome will be used.
- Run according to tags:
pytest -m <tag_name> --browser <firefox/chrome_headless>
Follow the instructions here to install Scoop.
Run the following command to install Allure using Scoop:
scoop install allure
brew install allure
allure serve allure-results
View allure results via Github pages
pytest --help
pre-commit install
pre-commit install --hook-type commit-msg
pre-commit autoupdate
pre-commit run --all-files