gauge-ts
gauge-ts copied to clipboard
Add support for enum parameters
Add support for Enum to be used as a parameter to Step implementations. Example:
export enum ShirtColor {
RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE;
}
@Step("Buy a <color> shirt")
public async buyAShirt(myColor: ShirtColor) {
// Implementation goes here
}
Refer https://github.com/getgauge/gauge-java/issues/70
I would say, there is also an issue with other types like number
. You always need to work with string
and explicitly parse it into the number
, that's why the template is using deprecated equal
assertion instead of strictEqual
. I will update and create PR also for the ts template as well
@pesoklp13 This should be addressed as part of #182
Since typescript support String
and Numerical
enums, and now we do primitive parsing of parameter,
The type should reflect in methods.