Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for enum parameters #5

Closed
BugDiver opened this issue Jun 4, 2019 · 2 comments
Closed

Add support for enum parameters #5

BugDiver opened this issue Jun 4, 2019 · 2 comments

Comments

@BugDiver
Copy link
Member

BugDiver commented Jun 4, 2019

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 getgauge/gauge-java#70

@BugDiver BugDiver changed the title Add iipport for enum paraters Add support for enum parameters Jun 4, 2019
@pesoklp13
Copy link
Contributor

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

BugDiver added a commit that referenced this issue Jun 16, 2024
* Parse primitive paramters
* Support custom parameter parser

Signed-off-by: BugDiver <[email protected]>
@BugDiver
Copy link
Member Author

@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 added a commit that referenced this issue Jun 17, 2024
* Enhance step parameter types #5
* Pass correct instance to hooks #138

---------

Signed-off-by: BugDiver <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants