Add support for expressions

Description

Add support for a mechanism of expressions which is a functional analogue to transform or generate data:

Expression syntax: #{expression(<arg1>, <arg2>, ..., <argN>)}

  • number of arguments will depend on actual expressions

1) When testing REST API with some endpoints requiring Base64 encoding, following the usual approach one would need to double all steps executing API requests: set of steps accepting String data and another set of steps doing Base64 encoding. It would be more concise to create a one set of steps like "When I send '$data' to '$destination'" and an expression. By doing this we can end up with a widely reusable expression and step: "When I send '#{encodeToBase64(Hello World!)}’ to ‘/some/endpoint’"

2) Instead of hardcoding test data in stories we can create expressions to generate that data, e.g.

  • #{currentDate()} - to generate current date

  • #{randomUUID()} - to generate random UUID
    etc.

3) It might be useful to have expressions for string manipulation, for example if we have data stored in examples table and we want that data to be typed somewhere in different forms, e.g.

  • #{toLowerCase(boB maN)} - produces "bob man"

  • #{toUpperCase(bob man)} - produces "BOB MAN"

  • #{capitalize(bob man)} - produces "Bob Man"
    etc.}}

Assignee

Unassigned

Reporter

Uladzislau Arlouski

Labels

Fix versions

Priority

High
Configure