Platform
Generating fake data
Generating fake data in Momentic tests
Momentic tests preloads faker.js. This library allows you to generate fake data for your tests. You can use it to generate random names, addresses, emails, and more.
Usage
To use faker.js in your tests, you can call the faker
function directly. Here’s an example:
This step will generate a random username and type it into the username input field.
You can also use faker.js inside JavaScript steps to generate more complex data. Here’s an example:
Was this page helpful?