Skip to content

A maintainable UI test automation framework built with Python, Selenium WebDriver, Pytest, and Allure. The project follows a modular Page Object Model structure, enabling clean separation of concerns, improved readability, and easy scalability for future test expansion.

Notifications You must be signed in to change notification settings

Safron09/Python-based-UI-automation-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ui_framework

Docker

  1. Download Docker For Windows https://www.docker.com/products/docker-desktop/
  2. To install Docker run command in Terminal ( start /w "" "Docker Desktop Installer.exe" install )
  3. Click "Close and Restart" after installation is done
  4. Open Docker. Pop up window displayed "WSL2 installation is incomplete". This will require Linux Kernel installation
  5. WSL Installation you can follow guide https://learn.microsoft.com/en-us/windows/wsl/install-manual 5.1. For Newer versions of windows run ( wsl --install ) https://learn.microsoft.com/en-us/windows/wsl/install 5.2. For Older. Enable the Windows Subsystem for Linux. Open PowerShell as administrator and run ( dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart ) 5.2. Enable Virtual machine. run ( dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart ) 5.3. Download. https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package 5.4. Set WSL2 as your default version ( wsl --set-default-version 2 ) 5.5. Optional. Set up your Linux distribution. https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-6---install-your-linux-distribution-of-choice
  6. Restart your computer Framework
  7. Download or clone the repository
  8. Open terminal and cd to your repository folder (example. c:/ui_framework)
  9. Start Docker
  10. Run command in repository folder ( docker build -f chrome.Dockerfile -t chrome_docker . ). This command will build container in Docker
  11. Run command in repository folder ( docker run -it --init --shm-size="2g" --env THREADS=3 --env RERUNS=1 --env MARKS="-m basic_login" chrome_docker ) This command will install/update everything in requirements.txt (pip, python, nose, allure, etc) --shm-size="2g" - shared memory size --env THREADS=3 - will run 3 tests at once --env RERUNS=1 - after every failed test it will try to rerun it just once --env MARKS="-m basic_login" - file "test_ui_test.py" contain marks for different test scenarios Change basic_login to regression in order to run all tests

Note. To stop Containers from running open Docker and stop container.

Original Image used by UI_Framework Docker Image download ( docker pull selenium/standalone-chrome ) https://hub.docker.com/r/selenium/standalone-chrome

Create an IMAGE

docker build -f chrome.Dockerfile -t chrome_docker .

Run the tests

docker run -it --init --shm-size="2g" --env THREADS=3 --env RERUNS=1 --env MARKS="-m basic_login"  chrome_docker

Run 2 Tests

python -m pytest -v -m basic_login -n2

Create password Steps. Navigate to encode.py, Input password/2fa, run command

python -m pytest -v -m encode_password -s

General command

python -m pytest -v -m basic_login

Allure reports saved to a folder

pytest -v -s --alluredir="C:\venvs\allure_reports" test_ui_tests.py 

Markers to run tests

regression - all tests
login_page - tests on a login page
home_page  - tests on a home page
network_page - tests on a network page
vendor_overview_page - vendors profile tests
product_page - tests on a prodcut page
admin_page - tests associated with Admin Dropdown
video_page - tests associated with videos and video page
contactus_page - tests associated with Contact Us page

About

A maintainable UI test automation framework built with Python, Selenium WebDriver, Pytest, and Allure. The project follows a modular Page Object Model structure, enabling clean separation of concerns, improved readability, and easy scalability for future test expansion.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages