Giter Site home page Giter Site logo

python-pytest-dummyjson-api-test-infrastructure's Introduction

Pytest API Automation Project

This project is prepared for the self improvement.

Tool stack

  • Python
  • Pytest
  • Requests
  • Faker

Requirements

Project Tree

.
├── README.md
├── config
│   ├── base_config.py
│   └── service
│       └── service_config.py
├── conftest.py
├── model
│   └── product.py
├── output
│   ├── assets
│   │   └── style.css
│   └── report.html
├── pytest.ini
├── requirements.txt
├── service
│   ├── carts
│   │   └── carts_service.py
│   └── products
│       └── products_service.py
├── tests
│   ├── test_customer.py
│   └── test_products.py
└── utils
    ├── api
    │   ├── api_commons.py
    │   └── api_utils.py
    ├── assertion
    │   └── assertion.py
    └── data
        └── data_generator.py

Config Folder

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

Model Folder

This will be used for variables implementation in the project. Variables should be defined in the class.

Service Folder

Requests to the service are managed here, methods are usually created using service utils.

Tests 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

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 parallel

python3 -m pytest -n 4

python-pytest-dummyjson-api-test-infrastructure's People

Contributors

umitozdemirf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.