Script project
One of the main resource types on the Skybear.NET platform is the Script project. In our docs we often just use the term Script, omitting the word “project”.
The Skybear.NET Script is a collection of Hurl source files. The Script defines the whole sequence of requests and assertions to do in your workflow, potentially across many files.
Even though the dashboard UI editor only allows you to edit a single Hurl source file, when using the API to trigger a script run you can actually provide as many Hurl source files as you wish (see HTTP Hook trigger docs). We plan to expand the UI editor to support multi-file editing.
A Script is uniquely identified by an ID prefixed with s_
.
Example
A single Hurl source file can be the following:
And this is another one:
These are 2 Hurl source files, and can be part of a single Skybear.NET Script project.
Why Hurl
Comprehensive assertions
As you can see from the example script above, Hurl scripts allow you to do all sorts of assertions on the response body and headers. From exact matching of values, to nested JSON assertions, or even whole body checks.
Learn more about all the assertions you can do in Hurl’s documentation.
Automations and Workflows
Among the reasons we love Hurl is that it’s trivial to write sequences of API requests, to orchestrate wholesome workflows.
You can do tens or hundreds of requests in a single script, each one extracting and using information from all previous responses.
An example user journey to test:
- Create a resource (
POST
). - Modify the resource properties (
PUT
or/andPATCH
). - Assert that the resource is in the expected state (
GET
). - Repeat steps 2 and 3, as many times as necessary.
- Delete resource (
POST
).
As seen in the example scripts earlier, you can even write comments in your scripts, which is amazing. Comprehensive Hurl scripts with appropriate comments can be great documentation for your API.
The article Testing the Cloudflare D1 REST API with Hurl is a real-world example of a user journey tested with Hurl, and configured to run periodically every few minutes with Skybear.NET.