Built-in functions reference

To know more about variables and built-in functions, please refer to this article.

randomString(length = 10, pools = [‘alphanumeric’])

Returns a random string.

  => 'aGaQs32sdF'

The string will contain any of the characters contained in the pools specified

  alphanumeric = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
  symbols = '!@#$%^&*()[]{}~|`;:\"'<>?/=+-_'

randomWord(length = 10)

Returns a lowercase, semi-pronounceable, random word

  => 'junofse'

randomSentence(words = 5)

Returns a random sentence with semi-pronounceable random (nonsense) words.

  => 'Alrurme junofse meleic cazepek joneceun.'

randomEmail(domain = ‘example.com’)

Returns a random email.

  => 'ersdfim@example.com'

now(format = ‘YYYYMMDDmmss’)

Returns the current date/time using the formatted using the specified template. The format follows the rule of MomentJS.

  => '20190509'


We're always happy to help with test creation or other questions you might have! Search our documentation, contact support by email or on chat, or connect with our sales team.