Skip to content

asaf/gojet

Repository files navigation

GoJet

Build Status

GoJet is a CLI tool to automate testing of HTTP APIs, written in Golang.

While unit tests aims to test internal functions and written by developers, acceptance / integration tests aims to test high level API and can possible be written by automation / QA teams.

GoJet can run as a part of CICD pipeline as one would do with standard unit tests.

We struggled finding a descriptive approach to write integration tests for our RESTful API that suites our native stack, the result is GoJet.

crud.gif

Quickstart

A playbook is a composition of stages where each stage represents an http test,

Here is a single stage playbook that performs an http GET request for a blog post and asserts that the returned status code is 200:

name: "test blog REST API"
stages:
- name: "get a post 1"
  request:
    url: "https://jsonplaceholder.typicode.com/posts/1"
    method: GET
  response:
    code: 200 

gojet is a single binary, distributed under the release page

simply run a playbook by: gojet playbook run --file <file>.yml

output example:

playing simplest playbook
stage get a post
[SUCCESS: 200 OK] status 

For more info see documentation