32 releases

1.0.0-alpha.35 Jun 16, 2022
1.0.0-alpha.34 Jun 15, 2021
1.0.0-alpha.33 May 20, 2021
1.0.0-alpha.29 Apr 13, 2021
0.1.0 Jan 14, 2021

#1699 in Development tools

Download history 14/week @ 2024-03-30 2/week @ 2024-04-06

85 downloads per month

MIT license

535KB
3.5K SLoC

Capter logo

Capter CLI

test-build codecov npm

Capter is a lightweight end-to-end testing tool for APIs. It's language agnostic and can test APIs written in any language (Node.js, Go etc).

  • 🧑‍💻 Write tests in YAML
  • 🔎 Run the same tests locally, in CI, or as a cron job to monitor your live APIs
  • 🏃‍♂️ Takes less than a minute to get started

How it works:

Create a workflow file in a .capter folder:

# .capter/products.yml

name: products
steps:
  - name: fetch all products
    id: products
    url: ${{ env.URL }}/api/products
    assertions:
      - !expect status to_equal 200
      - !expect body to_be_array

  - name: fetch first product
    url: ${{ env.URL }}/api/posts/${{ products.response.body.0.id }}
    assertions:
      - !expect body.id to_equal ${{ products.response.body.0.id }}

Then run the CLI:

URL=http://localhost:3000 capter test

Demo

CLI

Getting started

Follow the instructions in the documentation to get started:

API

License

The Capter CLI is provided under the MIT License. See LICENSE for details.

Dependencies

~14–24MB
~310K SLoC