Variables

Variables enable test scripts to be dynamically configured for different scenarios. Variables values can either be provided as an input parameter or generated dynamically as the test is run. When a test is run via the CLI, variables are passed in via CLI arguments.

Configuring a test action with a variable

When a new, unreferenced parameter is referenced in a string template, or via a "Create New" option in an action configuration, a variable is declared inline. Should that variable be no longer referenced in a test script after editing an action, the variable declaration is removed.

String Templates

A string template is any ES6-compatible template string. Everything possible in an ES6 template string is valid in a reflow string template. It will be evaluated as typescript (with the DOM library available), compiled into compatible browser javascript, and executed in the browser context. Any variables which would otherwise be unavailable in the browser DOM will be requested.

An example string template is the following: ${EMAIL_PREFIX}+${Math.floor(Math.random()*100)}@${EMAIL_SUFFIX}. This would evaluate variables EMAIL_PREFIX and EMAIL_SUFFIX, and add a random number between 0 and 100 after a + character to the prefix (Useful for creating a new email on every user registration).

${EMAIL_PREFIX}+${Math.floor(Math.random()*100)}@${EMAIL_SUFFIX}

© 2021 Resilient Software Ltd