Skip to content
A selection of API tests for Docket.
Python
Branch: master
Clone or download

Latest commit

Kevin Tuck
Kevin Tuck Optimized the tests
Latest commit c331519 Feb 12, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Optimized the tests Feb 12, 2020
endpoints Optimized the tests Feb 12, 2020
tests Optimized the tests Feb 12, 2020
utils Optimized the tests Feb 12, 2020
Pipfile Initial commit Feb 7, 2020
Pipfile.lock Initial commit Feb 7, 2020
README.md Optimized the test run Feb 12, 2020

README.md

Docket Test - Example API Tests

This repository contains sample API tests that can be used for practising your API testing skills with Docket.

Written in Python and using the pytest testing framework. Each test relies on the requests package and handles the generation of user objects and API tokens, to deliver the required API end-point tests.

Please clone this repository, learn from it, improve on the tests, add your own. Maybe even re-write the tests in the framework and language of your choice.

How to use

Your steps may differ depending on your operating system but all are supported by Python.

  1. Make sure you have Python installed and correctly setup for your operating system (you will need 3.7 or higher).
  2. You will also need to install pipenv. This can be installed by typing pip install pipenv from the command line.
  3. Clone this repo, or down it here.
  4. After unzipping the downloaded archive. Navigate to where you downloaded it and open up a terminal in the location.
  5. Type: pipenv install to install the required dependencies.
  6. Type the command pipenv run python -m pytest to run the tests.

I hope these example tests are useful to you and they become the basis for your learning about API testing.

Other API testing frameworks and tools

There are a multitude of API testing tools and frameworks available for software testing these days. From code solutions, to dedicated applications, designed to be user friendly and extremely powerful. The below list, while not a extensive list of all the options available to you today. Should give you an idea of the various tools available to you today.

I encourage you to check some of the above out. Find out what you like working with and discovery what each ones advantages/disadvantages are.

Further test ideas

Here are some ideas that you could implement and let me know of your solutions. I'd love to see them!

  • Create multiple users.
  • Create multiple todo items.
  • Add tests the check if the returned list of users contains the number you expect.
  • Create tests for the 'unhappy path' (negative tests).

Problems

If you have problems with the code, or any the running of the tests. Please reach out to me on Twitter.

Have a custom solution that you would like to created automated tests for? reach out to me and lets discuss! kevin@kevintuck.co.uk

About the author

I'm a freelance software tester based in the southwest of the UK. Please feel free to check out my blog on which I write articles about software testing. Or connect with me via email or Twitter.

Website: http://kevintuck.co.uk

Email: kevin@kevintuck.co.uk

Twitter: http://twitter.com/keva161

You can’t perform that action at this time.