Autokin Generators
Small set of keywords to help in generation of data
In some cases we want to include auto generated data as part of the API request, some of these are emails, ids, names, and maybe passwords. With Autokin Generators, this can be done as well with minimal syntax to understand.

Generate Email Addresses

1
Scenario: Login to the system
2
Given that a secure endpoint is up at {host}
3
Given I set Content-Type header to application/json
4
Given I set the JSON body to
5
"""
6
{
7
"username": "{generate:email(gmail.com)}",
8
"password": "p3dr0"
9
}
10
"""
11
When I POST /login
Copied!

Generate Passwords

1
Scenario: Login to the system
2
Given that a secure endpoint is up at {host}
3
Given I set Content-Type header to application/json
4
Given I set the JSON body to
5
"""
6
{
7
"username": "[email protected]",
8
"password": "{generate:any(8,numbers,uppercase,lowercase)}"
9
}
10
"""
11
When I POST /login
Copied!
This will generate password with length of 8 characters that can be either numbers, uppercase letters, or lowercase letters. If you want symbols just add it from the list.

Generate Names

1
Scenario: Create Customer to the system
2
Given that a secure endpoint is up at {host}
3
Given I set Content-Type header to application/json
4
Given I set the JSON body to
5
"""
6
{
7
"username": "{generate:emails(gmail.com)}",
8
"password": "{generate:any(8,numbers,uppercase,lowercase)}",
9
"firstname": "{generate:firstname(male)}",
10
"lastname": "{generate:lastname}"
11
}
12
"""
13
When I POST /create
Copied!

Generators References

GENERATOR
DESCRIPTION
{generate:email(domain)}
Generate random emails, with specified domain name. If not supplied it will have autokinjs.com as email domain.
{generate:firstname()}
Generate firstname base on existing name list, it can be either male or female.
{generate:firstname(male)}
Generate male firstname.
{generate:firstname(female)}
Generate female firstname.
{generate:lastname}
Generate lastname base on existing list.
{generate:words(language,suffix)}
Generate random adjective words in English (en) or Chinese (zh) For example: {generate:words(en,hello)}
{generate:uuid}
Generate UUID v4.
{generate:any(length, ...options )}
Generate random characters based on length and options. Options can be numbers, lowercase, uppercase, or symbols. To generate only symbols: {generate:any(10,symbols)}. If you want both numbers and symbols: {generate:any(10,numbers,symbols)}
{generate:timestamp(offset)}
Generate timestamp value. To generate timestamp 5 minutes ago, pass a -5 as an offset. Make it non negative value and it will generate that minutes ahead of the current time.
Last modified 5mo ago