Docs/Advanced Features

Generating Text

Some tests need realistic but distinct input on every run: email addresses, order references, search strings. Assrt can generate these inline with the generate helper.

yaml
- type:
    element: email input
    text: "qa+{{ generate.uuid }}@example.com"

- type:
    element: order reference
    text: "{{ generate.string(10) }}"

Helpers

FieldTypeDescription
generate.uuid() => stringA fresh v4 UUID.
generate.string(n)(n: number) => stringRandom alphanumeric of length n.
generate.email() => stringA unique, routable test email under the workspace domain.
generate.now() => stringISO 8601 timestamp for the current moment.