A flow-driven testing framework for quickly testing REST APIs.
193
This testing framework is designed to facilitate automated testing of RESTful APIs through configurable YAML or JSON files. It supports making HTTP requests, asserting response data, and dynamically managing test data.
Test configurations are defined in YAML or JSON files. Here's an example configuration for testing post creation and retrieval:
testPostLifecycle:
- name: "Create a New Post"
url: "https://jsonplaceholder.typicode.com/posts"
method: "POST"
params:
title: 'foo'
body: 'bar'
userId: 1
assertions:
- type: "equal"
target: "status"
expected: 201
- type: "equal"
target: "data.title"
expected: "foo"
saveToContext:
postId: "data.id"
{
"testPostLifecycle": [
{
"name": "Create a New Post",
"url": "https://jsonplaceholder.typicode.com/posts",
"method": "POST",
"params": {
"title": "foo",
"body": "bar",
"userId": 1
},
"assertions": [
{
"type": "equal",
"target": "status",
"expected": 201
},
{
"type": "equal",
"target": "data.title",
"expected": "foo"
}
],
"saveToContext": {
"postId": "data.id"
}
}
]
}
To run your tests, execute the test runner from the command line:
cd /path/to/tests/directory
docker run -v $(pwd):/flower/tests jersobh/flower:latest
The framework supports several assertion types:
equal: Asserts that the target value is equal to the expected value.include: Asserts that the target string or array includes the expected value.greaterThan, lessThan: Asserts numerical comparisons.deepEqual: Asserts deep equality of objects or arrays.notEqual, isNull, isNotNull, isTrue, isFalse: Assert specific conditions.Contributions to this testing framework are welcome. Please submit a pull request or create an issue for any features, fixes, or improvements.
Content type
Image
Digest
sha256:a362c596e…
Size
415.5 MB
Last updated
over 2 years ago
docker pull jersobh/flower