Getting started with Flurry begins with creating or joining an organisation. Organisations are collaborative spaces where users can work together on projects. Admins can invite new members and manage roles. Within each organisation, projects are created to group related work. Each project can contain multiple collections, which serve as containers for your testing logic and scenarios.
Collections are at the core of Flurry. When using the CLI, you initiate a collection run. This collection contains your testing building blocks: tasks. Tasks are units of action, such as making an API call or listening for a callback. They come in two flavors: dispatchers, which handle outgoing actions like sending requests, and listeners, which handle incoming data such as webhooks or event stream messages.
Tasks are combined into flows. Flows represent different testing scenarios. Only flows that are toggled to be active are executed when you run a collection, which means you can work on a flow and only enable it when it is ready. Tasks can be run in groups or individually. Grouped tasks are executed in two concurrent phases. All dispatchers are executed first (in parallel), while listeners are executed after all dispatchers have completed (also in parallel).
Environments allow you to configure different testing contexts. Each environment contains variables that can be referenced in your tasks using the {{variableName}}
syntax. This enables you to test the same collection against different API endpoints, authentication credentials, or configurations without duplicating your test logic. A Local environment is available in the UI, but is not available in the CLI. The values in the Local environment are only stored in the browser.
Relevant task types can have assertions that validate the data it produces. Simple checks can be quickly configured in the UI. Define the path, assertion type, data type and expected value. You can create these simple comparisons or complex custom JavaScript validation scripts.
Dispatchers are tasks that initiate outgoing actions, such as making HTTP requests or publishing messages to queues.
Make API calls to your endpoints.
Listeners are tasks that handle async incoming data from external sources like webhooks and event streams.
Listen for HTTP callbacks or webhooks sent from your application.
Connect to a Kinesis event stream.
Assertions are validation rules that test whether your API responses, webhook payloads, or event data meet your expectations. They allow you to verify data values, check response structure, validate business logic, and ensure your integrations work correctly. Tasks can have multiple assertions to validate different aspects of the received data.
The response body or payload data. Most commonly used for validating API response content. Default source for events from event streams.
{"userId": 123, "name": "John", "orders": [...]}
HTTP headers or event metadata. Useful for validating content types, authentication headers, or custom metadata.
content-type: application/json x-api-version: v2
HTTP response metadata like status codes. Only available for HTTP request tasks.
status: 200 ok: true statusText: "OK"
Navigate nested objects using dot notation:
user.profile.email
Accesses: {"user": {"profile": {"email": "..."}}}}
Access array elements with bracket notation:
users[0].name orders[1].total
Gets the first user's name or second order's total
For responses that are arrays at the root:
[0].userId [2].status
Access items directly from root array: [{"userId": 1}, ...]
Leave path empty to work with the entire response:
Path: (empty) Type: length
Validates the length of the entire response array
Script assertions allow you to write custom JavaScript logic for complex validation scenarios. They provide access to the extracted data and variables.
function(context) { const data = context.data; // Extracted value const variables = context.variables; // Environment vars // Your validation logic here // Return boolean for simple pass/fail return true; // or false // Or return object for advanced control return { passed: true, errorMessage: "Optional custom error message", setVariables: { "key": "value" } }; }
Variables are available as a plain JavaScript object:
// Access with bracket notation const apiKey = variables["API_KEY"]; const userId = variables["currentUserId"]; // Access with dot notation const apiKey = variables.API_KEY; const userId = variables.currentUserId;
Scripts can return a boolean or an object with additional options:
// Simple boolean return return data.userId === 1; // Object return with advanced features return { passed: data.userId === 1, setVariables: { "currentUserId": data.userId, "timestamp": Date.now(), "isValidUser": data.status === "active" }, errorMessage: "Custom error message when failed" };
passed: boolean - Whether the assertion should pass
setVariables: object - Variables to set for use in later tasks and assertions.
errorMessage: string - Custom error message shown when assertion fails
Flows organize your tasks into coherent testing scenarios.
Tasks run one after another in order. Each task waits for the previous one to complete before starting.
Tasks are executed in two phases: all dispatchers run in parallel first, then all listeners run in parallel.
npx flurry-test --collection-id=YOUR_COLLECTION_ID --api-key=YOUR_API_KEY --environment=production
--collection-id- The collection ID to run (required). Find this in your collection's settings.
--api-key- Your API key for authentication (required). You can generate a new key in the API keys section of the collections page.
--environment- The environment to use (required)
--run-flow-id- Run a single flow by ID (optional)
--verbose- Set to true
for detailed output (optional)
--fail-fast- Set to true
to exit the test run as soon as an assertion fails (optional)