public static class ParameterConverters.FluentEnumConverter extends ParameterConverters.EnumConverter
ParameterConverters.EnumConverter allowing stories prose to be more natural.
Before performing the actual conversion, it transforms values to upper-case,
with any non-alphanumeric character replaced by an underscore ('_').
Example:
assuming we have defined the step "Given I am on the $page"
which is mapped to the method iAmOnPage(PageEnum page),
we can then write in a scenario:
Given I am on the login page
instead of:
Given I am on the LOGIN_PAGE
Warning. This requires enum constants to follow the standard conventions for constant names, i.e. all uppercase letters, with words separated by underscores.
| Constructor and Description |
|---|
FluentEnumConverter() |
| Modifier and Type | Method and Description |
|---|---|
Object |
convertValue(String value,
Type type) |
acceptpublic Object convertValue(String value, Type type)
convertValue in interface ParameterConverters.ParameterConverterconvertValue in class ParameterConverters.EnumConverterCopyright © 2003–2016. All rights reserved.