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

Scenario: Login to the system
    Given that a secure endpoint is up at {host}
    Given I set Content-Type header to application/json
    Given I set the JSON body to 
    """
    {
        "username": "{generate:email(gmail.com)}",
        "password": "p3dr0"
    }
    """
    When I POST /login

Generate Passwords

Scenario: Login to the system
    Given that a secure endpoint is up at {host}
    Given I set Content-Type header to application/json
    Given I set the JSON body to 
    """
    {
        "username": "me@gmail.com",
        "password": "{generate:any(8,numbers,uppercase,lowercase)}"
    }
    """
    When I POST /login

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

Scenario: Create Customer to the system
    Given that a secure endpoint is up at {host}
    Given I set Content-Type header to application/json
    Given I set the JSON body to 
    """
    {
        "username": "{generate:emails(gmail.com)}",
        "password": "{generate:any(8,numbers,uppercase,lowercase)}",
        "firstname": "{generate:firstname(male)}",
        "lastname": "{generate:lastname}"
    }
    """
    When I POST /create

Generators References

Last updated