Skip to content

umitozdemirf/python-pytest-selenium-google-yandex-UI-test-infrastructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytest UI Automation Project

This project is prepared for the self improvement.

Tool stack

  • Python
  • Pytest
  • Appium
  • Selenium
  • Faker

Requirements

Project Tree

.
├── README.md
├── config
│   └── base_config.py
├── conftest.py
├── docker-compose.yml
├── output
│   ├── assets
│   │   └── style.css
│   └── report.html
├── pages
│   ├── base_page.py
│   ├── google
│   │   ├── google_main_page.py
│   │   └── google_results_page.py
│   └── yandex
│       ├── yandex_main_page.py
│       └── yandex_results_page.py
├── pytest.ini
├── requirements.txt
├── test
│   └── test_search.py
└── utils
    ├── data
    │   └── data_compare.py
    └── driver.py

Config Folder

Used for environment variables. There are usually *_config.py files.

Pages Folder

This will be used for Page Object Model implementation in the project. Locators should be defined at the top of the page. The locator definition should not be made inside the methods. Actions of all steps are defined on pages.

Test folder

Test files, that is, test cases in Pytest format will be located under this folder.

Utils Folder

The utils class and methods of the project will be defined in this folder.

conftest.py

File where decorators such as global fixtures are defined for pytest.

pytest.ini

Required file for pytest configuration.

requirements.txt

The file required for the installation of project necessary libraries.

output/*

Generates pytest-html reports after each execution.

Naming Convention

Conditions are requested when naming. Names should be short and meaningful.

directory names = my_directory (snake case)

variable name = my_variable (snake case)

method name = my_method (snake case)

class name = MyClass (Pascal case)

tag name = @MyTag (Pascal case)

Test Run

Install required libraries :

pip3 install -r requirements.txt

Python CLI command to run tests.

execution tests :

python3 -m pytest

execution tests via specific test file

python3 -m pytest 'file path'

execution tests via marks

@pytest.mark.smoke should be added in the test case

pytest -v -m smoke

execution tests via docker

Create docker container docker compose up -d --build

Use remote-firefox or remote-chrome on your scenario

pytest test/test_search.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages