SmoothDeploy Docs
Tests

Test Variables

Define named starting values for a visual test so steps can read and update them at run time using the {{vars.key}} syntax in any step field.

Variables are a set of named values for one test. You save their starting values. Steps can read them and write new values while the test runs. Variables apply to visual tests only.

Editing Variables

  1. Open the test in the Test Editor.
  2. Click the Parameters tab, then Variables.

Enter a JSON object:

{
  "start_date": "2025-01-01",
  "limit": 10,
  "filters": { "status": "open" }
}

Values can be any JSON: strings, numbers, booleans, null, arrays, and nested objects. An array or any other non-object value is rejected. Leave the editor empty for no starting values.

The values are static. They do not change between runs.

Limits

LimitValue
Size64 KB of JSON

Saving

Click Save Parameters & Variables. Invalid JSON, or a value that is not an object, shows an error under the editor and blocks the save.

Referencing Variables in Steps

Any step field with a reference picker supports variable tokens. Open the picker, choose a variable name, and it inserts {{vars.key}} into the field.

The generated Playwright script starts with your saved values as a local object, and {{vars.key}} reads from it:

const vars: Record<string, any> = {"start_date":"2025-01-01","limit":10};
// ...
await page.getByTestId('order-number').fill(vars['orderId']);

Writing Variables While the Test Runs

Steps that capture data write into the same vars object. For example, an extract-text step saves the captured value before the next step runs:

vars['confirmationCode'] = (await page.locator('[data-id="code"]').textContent()) ?? '';

Later steps read the new value. A code step can also assign vars['name'] = .... Values written during a run are not saved back to the test.

Next Steps