Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autotest Factory

This repository contains very simple PageObject implementation with test examples for two test sites:

  1. https://idemo.bspb.ru/
  2. https://the-internet.herokuapp.com/

Using this repo you can easily start your own UI E2E test automation, which will be fast enough and reliable. Also, you will be able to extend this framework with your own features, using current structure.

Main Used Packages

  1. Selenium (https://selenium-python.readthedocs.io/)
  2. Pytest (https://docs.pytest.org/en/7.2.x/)
  3. Allure-Pytest (https://github.com/allure-framework/allure-python/tree/master/allure-pytest)
  4. Faker (https://faker.readthedocs.io/en/master/)

How to run tests

First you need to install Python 3.7 or above, pip (Python package manager) and venv (Virtual environment library for Python).

Download source code and prepare env

NB: this will work on Linux/MacOS.

# Clone repository
git clone git@github.com:ivdunin/autotest_factory.git
cd autotest_factory

# Enable virtualenv
python3 -m venv .venv
source .venv/bin/activate

# Install Python requirements
pip install -r requirements.txt

It is better to use VirtualEnv package to keep your local environment clean and safe.

Download ChromeDriver

  1. Download ChromeDriver from https://chromedriver.chromium.org/downloads for your OS and Chrome (Chromium) version.
  2. Unzip archive and place file under your PATH environment or to autotest_factory dir.

or

It is possible WebDriver Manager for Python (https://pypi.org/project/webdriver-manager/) to install ChromeDriver/Gekodriver/etc automatically.

Run tests

Make sure your VirtualEnv is enabled

PYTHONPATH=$(pwd) pytest --headless tests/ui/

pytest console output

Should be one failed test, to check that screenshot is always taken on failure.

Prepare report

  1. Install Allure: https://docs.qameta.io/allure-report/#_installing_a_commandline
  2. Prepare Allure Report:
cd autotest_factory
allure generate --clean && allure open

Allure Example 1 Allure Example 2

Project structure

.
├── config
├── tests
│   └── ui
│       ├── bspb
│       └── the_internet
└── ui
    ├── page_object
    │   └── expected_condition
    └── pages
        ├── bspb
        │   └── payments
        └── the_internet

Project files description

TODO:

  1. Boilerplate code for API automation

About

Boilerplate code to start UI E2E Automation with Selenium or/and API automation with python requests

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages