Skip to content

Execution & Request Lifecycle

When you trigger a test in RouteCase, each test case passes through a well-defined 9-step execution pipeline.


01
Load Workspace Environment Scans for .rcase.env, .rcase.env.json & workspace settings
02
Merge Context & Chained Variables Combines environment entries with runtime capture store
03
Substitute Template Placeholders Expands {{VAR}} in params, query, body & headers
04
Generate Dynamic Test Data Computes fresh values for {{$uuid}}, {{$timestamp}}, {{$randomEmail}}
05
Construct WHATWG URL & Merge Headers Encodes path & query parameters safely; cascades headers (File < Endpoint < Case)
06
Dispatch HTTP/HTTPS Socket Transmits payload via native Node.js client with timeout & size safety guards
07
Evaluate Multi-Level Assertions Validates status code, bodyContains, bodyEquals, headers, and maxDurationMs SLA
08
Extract & Store Captured Tokens Extracts JSON properties via dot notation into shared session context
09
Emit Synchronous Results Updates inline CodeLens badges, Activity Bar tree view, and Webview results panel

The engine scans for .rcase.env and .rcase.env.json in the active workspace root, merging them with any VS Code routecase.env settings. The internal captureStore carries forward any variables extracted from earlier test cases within the same suite run.

Step 3 & 4: Variable Resolution & Dynamic Generators

Section titled “Step 3 & 4: Variable Resolution & Dynamic Generators”

Template placeholders ({{VAR}}) are resolved. Any built-in generator tags ({{$uuid}}, {{$randomEmail}}, etc.) are computed with fresh values.

The target URL is assembled. Request headers are merged hierarchically:

  1. Root-level headers (e.g. User-Agent, Accept)
  2. Endpoint-level headers (e.g. Content-Type)
  3. Case-level headers (e.g. Authorization: Bearer {{token}})

Node’s native client executes the request. The timeout timer begins (configurable via routecase.requestTimeout, default: 10,000ms). If the response exceeds routecase.maxResponseSize (default: 5MB), execution is aborted for safety.

The response status code, headers, body, and round-trip duration are validated against the expect block.

If the test case succeeded and defines a capture block, dot-notation expressions extract values from the JSON body and store them in the suite’s shared session store.

Status badges (✓ PASS or ✗ FAIL), Activity Bar tree nodes, and Webview results are updated simultaneously.