Code Monkey home page Code Monkey logo

automate_and_rest's Introduction

Automate & REST

The easiest way to automate REST API testing for non-programmers. (Note: Example code to follow.)

Introduction

Q: Are you working with test analysts who are interested in test automation?

This basic project is designed to be extended (it's a pattern for you to use) and to make it accessible for anyone who understands how to test a REST API (using PostMan or similar) to make the leap into writing automated tests.

The intention is to provide a simple, reliable, expandable foundation on which tests can be built and run by wrapping up all and any bootstrapping activities and then running tests in a basic Python UnitTest style. Sounds simple? It kinda is.

So if your aim is to have non-programmer, functional testers write automation for REST APIs then you're in the right place. Even if you can code, this is a pretty decent way to lay out your REST API tests and make them accessible to your peers.

What's provided

  • An endpoint class (feel free to extend) that models the HTTP functions related to REST and returns responses in the Requests format.
  • A helper class of utilities to do things (like convert json template files using jinja2 template format to JSON strings)
  • A docker-compose file for Redis - so you can share useful variables between test cases easily and reliably (note: some CI tools don't support env, so this works everywhere!)
  • An example pattern of a test module (tests/example)

What's not included

  • Your application (see bootstrap.py)
  • Your tests (see tests/example)
  • CI scripts (but basically docker-compose up and then bootstrap and then run_suites is all)
  • XML support (If you're really using XML then feel free to extend this yourself)
  • Magic - you'll need to set things up, this project is provided as a pattern with this as a reference prototype only!

Getting started: Requirements

  • Docker (for running Redis) Redis removes the dependency on environment variables, by giving us a transient data store to store values.
  • Docker compose (to setup Redis and any other services you require easily from this suite)
  • Python 2 (to execute tests)
  • Optional: PyCharm (or some text editor if you prefer, I like the enforced PEP8 style and built in test runner)

Mac installation details

You probably already use homebrew (if you don't, why not?! go to http://brew.sh right now)

Docker

$ brew cask install virtualbox
$ brew install docker docker-machine

Python 2

$ brew install python

Windows installation links

Docker

Install Docker for Windows from https://docs.docker.com/docker-for-windows/install/

Python 2

(do install to path when it asks)

https://www.python.org/downloads/

automate_and_rest's People

Watchers

James Cloos 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.