gauge-ts icon indicating copy to clipboard operation
gauge-ts copied to clipboard

Add support for enum parameters

Open BugDiver opened this issue 5 years ago • 1 comments

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

BugDiver avatar Jun 04 '19 06:06 BugDiver

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 avatar Aug 12 '20 13:08 pesoklp13

@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.

BugDiver avatar Jun 17 '24 14:06 BugDiver