Snippets Panel
Every script editor in Atrahasis has a Snippetspanel docked to its right side. It is a small library of ready-to-use code examples for the current script context — click one and the code is appended to the editor, separated from any existing content by a blank line. The snippet set changes depending on where you are, so the suggestions are always relevant to the task at hand.
Opening and Collapsing the Panel
When the panel is collapsed, a thin vertical strip with a chevron sits on the right edge of the editor. Click the strip — or the Snippets button in the console bar at the bottom — to expand the panel. Click the same button again, or the close button in the panel header, to collapse it back down.
Pre-Script Snippets
Available on every pre-script editor — HTTP standalone, project request, flow step, and load test step:
- •Set header — adds or overrides a request header via at.request.setHeader.
- •Set flow variable — stores a value that later steps can read via {{flow.key}}.
- •Get flow variable — reads a previously stored flow variable.
- •Set environment — writes a persistent environment variable.
- •Console log — a bare console.log template to start instrumenting the script.
Post-Script Snippets
Available on every post-script editor:
- •Extract from response — parses the JSON body and stores a value in the flow store.
- •Log response status — logs the status code of the response.
- •Set flow variable — same as in pre-script.
- •Get flow variable — same as in pre-script.
- •Set environment — same as in pre-script.
- •Console log — a bare console.log template.
Before All Snippets
Available on both Flow and Load Test Before All editors. The set is the same in both places:
- •GET request — a basic await fetch that reads a JSON response.
- •POST request — a JSON body POST template.
- •Register user — registers a test user with a random username, a common shape for seeding test data.
- •Login & set token — logs in and stores the returned token in the flow store so every subsequent step can use it.
- •Set flow variable, Get environment, Set environment, Console log — the usual utility snippets.
After All Snippets
Available on both Flow and Load Test After All editors. This is the set that leans on at.export:
- •GET request, POST request — the same generic HTTP templates as Before All.
- •Slack notification — a ready-to-fill Slack webhook POST for a short run-finished message.
- •POST JSON report — calls at.export.json() and posts the result to an endpoint.
- •POST HTML report — calls at.export.html() and posts the result.
- •POST PDF report — await at.export.pdf() and posts the bytes.
- •Get flow variable, Console log — the usual utilities.
Autocomplete
The editor also offers inline autocomplete for the at API: start typing at. and a menu of available namespaces and methods appears. In pre-script and post-script editors the menu includes at.environment, at.flow, at.request, and at.response. In Before All it shows at.environment and at.flow. In After All it adds at.export on top of those.