Allow mapping of ExamplesTable rows to annotated custom types

Description

The idea is to map the ExamplesTable rows to match a business object.

So, instead of having a method like this:

@Given("some $table")
public void givenAnExamplesTable(ExamplesTable table){ ... }

We'd have something like this:

@Given("some $table")
public void givenACustomBusinessObject(MyCustomObject myObject){ ... }

Or a List of business objects:
@Given("some $table")
public void givenACustomBusinessObject(List<MyCustomObject> myObjectList){ ... }

This can be done in two ways:

  • Annotation-based mapping:

@AsParameters
public class MyCustomObject{
@Parameter(name="column1")
private String col1;

@Parameter(name="column2")
private Boolean col2;
}

  • Named-based mapping, using the name of the field as the parameter name.

Assignee

Mauro Talevi

Reporter

Ghislain Nadeau

Labels

Components

Fix versions

Priority

Major
Configure