All Projects → aviaviavi → Curl Runnings

aviaviavi / Curl Runnings

Licence: mit
A declarative test framework for quickly and easily writing integration tests against JSON API's.

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Curl Runnings

Karate
Test Automation Made Simple
Stars: ✭ 5,497 (+3826.43%)
Mutual labels:  testing-framework
Cli
a lightweight, security focused, BDD test framework against terraform.
Stars: ✭ 918 (+555.71%)
Mutual labels:  testing-framework
Ui5 Uiveri5
End-to-end testing framework for SAPUI5
Stars: ✭ 100 (-28.57%)
Mutual labels:  testing-framework
Selenium Wire
Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
Stars: ✭ 531 (+279.29%)
Mutual labels:  testing-framework
Nose2
The successor to nose, based on unittest2
Stars: ✭ 665 (+375%)
Mutual labels:  testing-framework
Jiramobilekit
JIRA Mobile Kit a framework for raising bugs within your app including screenshots easily. JIRA Bug Raising written in Swift. iOS JIRA SDK Swift 3-4
Stars: ✭ 33 (-76.43%)
Mutual labels:  testing-framework
Golem
A complete test automation tool
Stars: ✭ 441 (+215%)
Mutual labels:  testing-framework
Frisby
Frisby is a REST API testing framework built on Jest that makes testing API endpoints easy, fast, and fun.
Stars: ✭ 1,484 (+960%)
Mutual labels:  testing-framework
Aruba
Test command-line applications with Cucumber-Ruby, RSpec or Minitest. The most up to date documentation can be found on Cucumber.Pro (https://app.cucumber.pro/projects/aruba)
Stars: ✭ 900 (+542.86%)
Mutual labels:  testing-framework
Ktf
Kernel Test Framework - a unit test framework for the Linux kernel
Stars: ✭ 81 (-42.14%)
Mutual labels:  testing-framework
Crosshair
An analysis tool for Python that blurs the line between testing and type systems.
Stars: ✭ 586 (+318.57%)
Mutual labels:  testing-framework
Pgtap
PostgreSQL Unit Testing Suite
Stars: ✭ 631 (+350.71%)
Mutual labels:  testing-framework
Kakao
Nice and simple DSL for Espresso in Kotlin
Stars: ✭ 1,109 (+692.14%)
Mutual labels:  testing-framework
Ut
UT: C++20 μ(micro)/Unit Testing Framework
Stars: ✭ 507 (+262.14%)
Mutual labels:  testing-framework
Automation Arsenal
Curated list of popular Java and Kotlin frameworks, libraries and tools related to software testing, quality assurance and adjacent processes automation.
Stars: ✭ 105 (-25%)
Mutual labels:  testing-framework
Airframe
Essential Building Blocks for Scala
Stars: ✭ 442 (+215.71%)
Mutual labels:  testing-framework
Pose
Replace any .NET method (including static and non-virtual) with a delegate
Stars: ✭ 855 (+510.71%)
Mutual labels:  testing-framework
Tf
✔️ tf is a microframework for parameterized testing of functions and HTTP in Go.
Stars: ✭ 133 (-5%)
Mutual labels:  testing-framework
Acot
💎 Accessibility Testing Framework. More accessible web, all over the world.
Stars: ✭ 112 (-20%)
Mutual labels:  testing-framework
Bigtest
Tests that speed up development, not slow it down
Stars: ✭ 64 (-54.29%)
Mutual labels:  testing-framework

curl-runnings

Build Status Hackage Scarf

Feel the rhythm! Feel the rhyme! Get on up, it's testing time! curl-runnings!

A common form of black-box API testing boils down to simply making requests to an endpoint and verifying properties of the response. curl-runnings aims to make writing tests like this fast and easy.

curl-runnings is a framework for writing declarative tests for your APIs in a fashion equivalent to performing curls and verifying the responses. Write your tests quickly and correctly with a straight-forward specification in Dhall, yaml, or json that can encode simple but powerful matchers against responses.

Alternatively, you can use the curl-runnings library to write your tests in Haskell (though a Haskell setup is absolutely not required to use this tool).

Installing

The best way to install curl-runnings is with the scarf package manager.

# If you don't have scarf, you can easily install it with:
$ curl -L https://scarf.sh/install | bash
 
$ scarf install curl-runnings

Binaries are available on the Releases section of the GitHub page.

You can also compile from source with stack.

Writing a test specification

Curl runnings tests are just data! A test spec is an object containing an array of cases, where each item represents a single curl and set of assertions about the response. Write your tests specs in a Dhall, yaml or json file. Note: the legacy format of a top level array of test cases is still supported, but may not be in future releases.

let JSON = https://prelude.dhall-lang.org/JSON/package.dhall

let CurlRunnings = ./dhall/curl-runnings.dhall

in   CurlRunnings.hydrateCase
        CurlRunnings.Case::{
        , expectData = Some
            ( CurlRunnings.ExpectData.Exactly
                ( JSON.object
                    [ { mapKey = "okay", mapValue = JSON.bool True },
                      { mapKey = "message", mapValue = JSON.string "a message" }]
                )
            )
        , expectStatus = 200
        , name = "test 1"
        , requestMethod = CurlRunnings.HttpMethod.GET
        , url = "http://your-endpoing.com/status"
        }
---
# example-test.yaml
#
# specify all your test cases as an array keys on `cases`
cases:
  - name: A curl runnings test case
    url: http://your-endpoint.com/status
    requestMethod: GET
    # Specify the json payload we expect here
    expectData:
      # The 1 key in this object specifies the matcher we want
      # to use to test the returned payload. In this case, we
      # require the payload is exactly what we specify.
      exactly:
        okay: true
        msg: 'a message'
    # Assertions about the returned status code. Pass in
    # an acceptable code or list of codes
    expectStatus: 200

See /examples for more example curl runnings specifications, which walk through some of the other features that can be encoded in your tests such as:

  • reference data from previous responses of previous test cases
  • reference environment variables
  • various easy-to-use json matchers
  • support for importing data from other yaml files in your spec

Running

Once you've written a spec, simply run it with:

curl-runnings -f path/to/your/spec.yaml

(hint: try using the --verbose flag for more output)

If all your tests pass, curl-runnings will cleanly exit with a 0 code. A code of 1 will be returned if any tests failed.

You can also select specific test cases by filtering via regex by using the --grep flag. Just make sure your case isn't referencing data from previous examples that won't get run!

For more info:

curl-runnings --help

Running With Docker

A dockerfile is included in the root of the project. The Dockerfile will expect the linux based curl-runnings executable in the same directory as the Dockerfile and a tests.yml file. You can download the latest executable from the release page : https://github.com/aviaviavi/curl-runnings/releases .

docker build . -t curl-runnings-tests

docker run curl-runnings-tests

If you use docker-compose, you can add this to docker-compose.yml:

tests:
    build:
      context: .
      dockerfile: ./Dockerfile

Contributing

Contributions in any form are welcome and encouraged. Don't be shy! :D

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].