Random sentence from provided charset and range
Generate random sentence
On this page
I generate a random sentence having from “(\d+)” to “(\d+)” of “(ASCII|UNICODE|polish|english|russian|japanese|emoji)” words and save it as “([^”]*)"
This step generates sentence and save it in scenario cache. To obtain once saved value, use syntax from text/template package. This step is something like lorem-ipsum generator.
First two arguments from "(\d+)" to "(\d+)" of
allows to pick length of sentence - number of words in it.
Argument of "(ASCII|UNICODE|polish|english|russian|japanese|emoji)" words
determine charset from which each word will be generated. Last argument save it as "([^"]*)"$
allows to pick name under which randomly generated sentence will be saved in scenario cache.
In default setup, each word is defined to have between 3 and 10 characters. You can change it, by passing another values to step's definition method in 'main_test.go'
Examples:
Given I generate a random sentence having from "2" to "2" of "english" words and save it as "NAME_AND_SURNAME"
Given I generate a random sentence having from "1" to "4" of "polish" words and save it as "RANDOM_DESCRIPTION"