Built-in functions reference

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

randomString(length = 10)

Returns a random string.

  randomString()
  => 'aG&Qsa&sd'

The string will contain any of the following characters.

  'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()[]'

randomWord(length = 10)

Returns a lowercase, semi-pronounceable, random word

  randomWord()
  => 'junofse'

randomSentence(words = 5)

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

  randomSentence()
  => 'Alrurme junofse meleic cazepek joneceun.'

randomEmail(domain = ‘example.com’)

Returns a random email.

  randomEmail()
  => '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.

  now()
  => '20190509'

Questions?

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.