Use Randomized Values with Faker
BlinqIO integrates Faker.js to generate realistic randomized test data at runtime. This is useful for registrations, forms, invoices, and any flow where repeated static values cause collisions or weak coverage.
Syntax
Use Faker expressions in this format:
{{faker:<module>.<method>}}
If the Faker method takes arguments, include them in parentheses:
{{faker:string.numeric(5)}}{{faker:string.alphanumeric(10)}}
Common Faker Expressions
| Expression | Description |
|---|---|
{{faker:person.firstName}} | Random first name |
{{faker:person.lastName}} | Random last name |
{{faker:internet.email}} | Random email address |
{{faker:internet.username}} | Random username |
{{faker:company.name}} | Random company name |
{{faker:commerce.price}} | Random price |
{{faker:location.city}} | Random city |
{{faker:string.numeric(5)}} | Random 5-digit numeric string |
Building Full Strings with Faker
When you need a full string composed of multiple Faker values, use helpers.fake(...):
text
{{faker:helpers.fake("{{person.firstName}} {{person.lastName}}")}}
{{faker:helpers.fake("{{person.firstName}}.{{person.lastName}}@example.com")}}Example
You can use Faker values directly in scenario examples, parameter values, or test data fields:
gherkin
Examples:
| first_name | last_name | email |
| {{faker:person.firstName}} | {{faker:person.lastName}} | {{faker:helpers.fake("{{person.firstName}}.{{person.lastName}}@example.com")}} |Tip
Use Faker for values that should change on every run. For logic such as numeric ranges or calculations, use ${...} instead.
