Code Monkey home page Code Monkey logo

pytest_restapi_test's Introduction

REST API Testing Framework

The framework was designed to run inside a Docker container to strip out the complexity of setting virtual environments, facilitate its distribution and avoid the infamous but it works on my machine conversation.

Prerequisites

Setup instructions

  • Clone the repository

  • change to the project folder

  • Open a terminal

  • install python library virtualenv pip install virtulenv

  • create virualenv venv python -m venv venv

  • load virtual venv source /venv/Scripts/activate

  • install requirements.txt pip install -r requirements.txt

Usage

sh suites/all_tests.sh

pytest --html=reports/restapi_test_report.html --self-contained-html -v -s --users 7 tests/

Run the Docker image and run the tests automatically

Run Docker Image in develop mode [Optional]

In develop mode you can run the tests manually and execute the test with more parameters

  1. Start development environment
make dev

This command will remove any existing restapi_test containers, build a new test/restapi_testfwk image, start a container, mount local code under /opt/restapi_test and provide a /bin/bash terminal.

  1. Create the command line with your desired specifications for the tests.
Parameter Posible Values Description
--users default value is 1 could be N users N number of users to create and their posts and comments
--log-cli-level info or debug log level info
--html reports/restapi_test_report.html path and name of html report file
  • Example
pytest --html=reports/restapi_test_report.html --self-contained-html  --users 10  --log-cli-level=debug  tests/

You will find an HTML report stored in the path: /opt/restapi_test/reports/restapi_test_report.html In the same path you will find the log file: /opt/restapi_test/reports/restapi_test.log

Author

Ruben Vazquez

pytest_restapi_test's People

Contributors

rubnvaz avatar ruvaz 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.