Skip to content

MargoMorugina/Selenium-Python-Example

 
 

Repository files navigation

Selenium Python Example

dev run nightly

Articles written about this project

Project Setup

  • Install scoop
  • Install allure commandline by running the following command:
scoop install allure
  • Clone the project
  • Navigate to the project directory
  • Install virtualenv:
py -m pip install --user virtualenv
  • Create a virtual environment:
py -m venv env
  • Activate the virtual environment:
.\env\Scripts\activate
  • Install project dependencies:
poetry install

need to create .env file in the project root with the following properties:

Parameter Description Example Value
EMAIL Your email address for authentication "[email protected]"
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)

Running Tests

pytest --browser <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>

Viewing Test Results

  • View allure results locally:
allure serve allure-results

View Help And Custom CLI Options

pytest --help

Run pre commit checks automatically

pre-commit install

Bump pre commit hooks version

pre-commit autoupdate

Run pre commit checks manually on the entire project

pre-commit run --all-files

Sort imports

isort .

format code

black .

About

Selenium Python example project with pytest and Allure report

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%