Skip to content

sschuckk/py-test-api-todotask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Py-Test REST API - Tasks

Report Bug · Request Feature
Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Logs and Reports
  5. Contributing
  6. License

About The Project

The objective of this project is to develop an Integration Test Suite for a REST API application using the Pytest and Requests libraries from Python, with the goal of establishing a simple testing framework with logs and reports.

REST API testing frameworks help ensure the functionality, reliability, security, and performance of the APIs. This framework includes functionalities for initiating HTTP requests, validating responses, and conducting functional testing.

But why do this with Python?

  • Rich functionality
  • Clear documentation
  • Cleaner tests
  • Scalable
  • It's FREE!

Test Plan

1. Create a todo task: 
   - Create, read, verify
2. Update a todo task:
   - Create, update, read, verify
3. List created tasks:
   - Create, list, verify
4. Delete a specific task:
   - Create, delete, read, verify

Each test case is executed independently.

API Endpoint: https://todo.pixegami.io
Documentation: https://todo.pixegami.io/docs

Built With

Python Python

Getting Started

Prerequisites

Installation

  1. Clone the repo.
    git clone https://github.com/sschuckk/py-test-api-todotask
  2. Install the packages according to the configuration file 'requirements.txt'.
    pip install -r requirements.txt

Usage

The project can be run by a terminal or directly in your IDE.

In your terminal go to the project folder and run:

  1. For a simples execution:

    pytest -v

    Product presentation

  2. To enable and show the logs on terminal:

    pytest -v --log-cli-level=INFO

    Product presentation Logs options: DEBUG, INFO, WARN, ERROR, and Critical.

  3. To execute with reports by Allure plugin:

    pytest -v --alluredir=py_test_api/reports

    To show the reports:

    allure serve py_test_api/reports

(back to top)

Logs and Reports:

The test Log and Reports serves to offer a historical record of the testing process which can be used by the testing, development, product team, and other stakeholders.

Logs:

Each execution of this framework will generate a log that will be stored inside the folder 'py_test_api/logs'.

They are incremental and will be stored day by day:

Product presentation

Reports:

This framework supports the Allure plugin which has everything you need to create, customize, and understand your test reports.

The reports can be stored and accessed inside the folder 'py_test_api/reports.'

Example of a report after simulating a fail result:

Product presentation Product presentation

Go to Usage topic to learn how to execute and display the tests with reports.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project (https://github.com/sschuckk/py-test-api-todotask/fork)
  2. Create your Feature Branch (git checkout -b feature/NewFeature)
  3. Commit your Changes (git commit -m 'Add some new feature')
  4. Push to the Branch (git push origin feature/NewFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. It’s free, no legal restrictions, why not try it out?

(back to top)

About

REST API Test Framework that helps you test and identify errors in your application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published