GithubHelp home page GithubHelp logo

api-testing-foundations's Introduction

api-testing-challenges

Table of contents

Install

After cloning the repo locally you can install it by calling

$ npm install

Setup

Once you have it installed you can start the server by calling

$ node <server-name>

Where the available servers are:

  • find_the_secret_server.js
  • find_the_500_server.js

Challenges

These challenges are all designed to be 'black box.' The purpose of them is to help you learn more about how APIs work and what kinds of things to think about when testing them. For you to get the most of them, try to solve them all by using only API calls. Don't go looking in the server implementations or the databases for the answers. See if you can find them with only using the APIs

Secret profile

The challenge:

There is a secret profile (profile 1) that you are not supposed to be able to access. Using only API calls, can you find out the name of that profile?

Routes

The find the secret challenge can be solved using the following routes:

GET    /blogposts
GET    /blogposts/<id>
GET    /comments
GET    /comments/<id>
GET    /profiles
GET    /profiles/<id>

You may also need to use the following parameters:

Relationships

To include children resources, add _embed

GET /blogposts?_embed=comments
GET /blogposts/1?_embed=comments

To include parent resource, add _expand

GET /comments?_expand=blogpost
GET /comments/1?_expand=blogpost

Find The 500 Errors

The challenge:

There are (at least) two 500 errors to be found in this little application. See if you can find them using only API calls.

Routes

The find the 500 challenge has the following routes:

GET    /blogposts
GET    /blogposts/<id>
GET    /comments
GET    /comments/<id>
GET    /profiles
GET    /profiles/<id>
GET    /avatars
GET    /avatars/<id>

POST and PUT commands are also available. To figure out what parameters they take, just do a GET call on the corresponding resource to see what paramters it has.

POST    /blogposts
POST    /comments
POST    /profiles
POST    /avatars

PUT    /blogposts/<id>
PUT    /comments/<id>
PUT    /profiles/<id>
PUT    /avatars/<id>

DELETE commands will also work, but you shouldn't need them to solve this challenge

You may also need to use the following parameters:

Relationships

To include children resources, add _embed

GET /blogposts?_embed=comments
GET /blogposts/1?_embed=comments

To include parent resource, add _expand

GET /comments?_expand=blogpost
GET /comments/1?_expand=blogpost

api-testing-foundations's People

Contributors

djwester avatar dependabot[bot] avatar

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.