Test Parameters
Run the same test against multiple data sets by defining a parameters function
Test parameters let you run the same test against multiple data sets without duplicating steps. Each object in the returned array becomes one execution of the test.
Editing Parameters
- Open the test in the test editor.
- Click the Parameters tab, then Test Parameters.
The editor shows this signature above the body you write:
function parameters(): Array<Record<string, unknown>> {Write the function body only. The function must return an array of objects:
return [
{ username: "testuser", email: "testuser@test.com", timeout: 30000 },
{ username: "testuser2", email: "testuser2@test.com", timeout: 30000 },
];Each object is passed as the _PARAMS fixture for one execution of the test. If the array is empty, or if no parameters source is saved, the test runs once with an empty _PARAMS object.
Allowed Values
Return values must be JSON-serializable. Accepted types: strings, finite numbers, booleans, null, arrays, and plain objects. These are rejected at save time:
undefined- functions, symbols, bigints
- non-finite numbers (
Infinity,NaN) - non-plain objects (class instances, circular references)
import and export statements are not available. If your code references faker, the faker library is automatically available.
Limits
| Limit | Value |
|---|---|
| Execution timeout | 250 ms |
| Memory | 64 MB |
| Max output size | 256 KB |
| Max rows | 1,000 |
| Source size | 64 KB |
Saving
Click Save Parameters & Variables. SmoothDeploy runs your code before saving. If it fails or returns invalid output, a toast error appears and the save is blocked. The button is disabled until you make a change.
Navigating away with unsaved changes triggers a confirmation prompt.
Referencing Parameters in Steps
Any step field with a reference picker supports parameter tokens. Open the picker, choose a parameter name, and it inserts {{params.key}} into the field.
In the generated Playwright script, {{params.key}} compiles to a lookup on _PARAMS:
await page.getByTestId('email').fill(_PARAMS['username']);Using Secrets in Steps
Secrets are not substituted inside parameter values. To use a secret in a step, open the reference picker and select from the Secrets group. This inserts {{secrets.NAME}}, which reads from an environment variable at run time. See Secrets.