Inline javascript
Steps and variable definition can call inline javascript, with the {{foo()}}
syntax.
Inline javascript is limited to a single line of code and is ran in isolation (they don't have access to the test browser). If you need to run bigger code blocks, or if you need to run in the test session, use javascript steps.
Inline javascript can access the following library:
Examples:
- Type text
{{faker.internet.email()}}
onthe email field
- Type text
{{faker.person.firstName()}}
onthe first name input
- Click on the
{{faker.helpers.arrayElement(['Pr.', 'Dr.', 'Mr.'])}} button in the title section
- Type text
a variable: {{var1}} and another variable: {{var2}}
onthe input field
Localizing faker
By default, faker is localized to generate US data. You can also use any supported localized faker:
{{new FakerModule.Faker({ locale: [FakerModule.de_CH] }).phone.number()}}