testapilocally.com

Signoff Studio Docs

Tests & scripts

  • Platform Availability: Windows App · VS Code Extension (shared shell)
  • Overview: Pre-request scripts and tests run in a QuickJS sandbox with the qa.* dialect (plus pm.* / bru.* / pw.* aliases). Collection and folder scopes use Scope Script Studio.

Windows - Tests tab

How It Works (Windows App)

  1. Open a request → Pre-request Script and/or Tests.
  2. Write assertions with qa.test / qa.expect.
  3. Send or run via Runner — failures show in Checks / Runner report.
  4. For folder/collection scripts, open Open Scripts from the tree context menu.

Windows - Pre-request

How It Works (VS Code Extension)

Same editors and sandbox inside the webview. Host-gated APIs (qa.ui, some file/DB helpers) follow the VS Code host bridge.

VS Code - Tests

Code / Configuration Examples

// Pre-request: set a timestamp variable
qa.variables.set("ts", String(Date.now()));

// Tests
qa.test("status 200", () => {
  qa.expect(qa.response.code).to.equal(200);
});

qa.test("json has url", () => {
  const body = qa.response.json();
  qa.expect(body.url).to.be.a("string");
});

// Extract for later requests
qa.variables.set("gotUrl", qa.response.json().url);

Postman-style alias:

pm.test("status is 200", function () {
  pm.response.to.have.status(200);
});

Edge Cases, Troubleshooting & Pro-Tips

  • Prefer qa.* in new scripts; aliases exist for migration.
  • qa.sendRequest nests HTTP from scripts — avoid infinite loops.
  • qa.db / qa.load / qa.files / qa.ui are host-gated; behavior can differ slightly by runtime.

GAP IDENTIFIED: Some scripting host APIs are gated per runtime (Electron vs VS Code). If a qa.ui call no-ops, run that flow on Windows desktop or use variables/tests only.

Next