Docker
- Download Docker For Windows https://www.docker.com/products/docker-desktop/
- To install Docker run command in Terminal ( start /w "" "Docker Desktop Installer.exe" install )
- Click "Close and Restart" after installation is done
- Open Docker. Pop up window displayed "WSL2 installation is incomplete". This will require Linux Kernel installation
- 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
- Restart your computer Framework
- Download or clone the repository
- Open terminal and cd to your repository folder (example. c:/ui_framework)
- Start Docker
- Run command in repository folder ( docker build -f chrome.Dockerfile -t chrome_docker . ). This command will build container in Docker
- 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