-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Custom Parameter Type in DataTables #669
Comments
This would be a really good feature. |
@NielsFeldtmannKALO are you looking for a feature or reporting a bug? You can parameterize steps using |
@amitguptagwl this would be a new feature. I am aware that we can parametrize "simple" steps. This feature would allow to use the parameters in datatables also. |
Hmm.. ok. But the purpose of data tables is to provide the data. how would you define the type there. I believe, I'm missing something here. |
The dataTable would provide the data to check in the test. Assume you want to check the content of a html table after editing one of the entries in on row, by putting a variable content. After that we want to check all the displayed rows in the table. Therefore we provide the data in the test as "dataTable". |
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far. Read more about the transfer of ownership here. The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so. |
Any chance we can "revive" this issue? |
No, this is completely nonsensical and not at all what parameters are. |
Stop thinking that steps themselves have to vary. Instead, the interpretation of them can vary. Here's some pseudo code to get you going. Feature:
Scenario:
When I enter date "today" in "Birthday" defineParameterType({
name: "date",
regexp: /"([^\"])"/,
transformer(s: string) {
if (DATE_EXPR.test(s)) {
return Temporal.PlainDate.from(s);
} else if (s === "today") {
return Temporal.Now.plainDateISO();
} else {
throw new Error("Unable to parse expression: " + s);
}
},
});
When("I enter date {date} in {string}", (date: Temporal.PlainDate, label: string) => {
// ...
}); |
Still the ckeck of variable content with data tables is not possible.
With current implementation you qould have to check like
|
Current behavior
Desired behavior
When i use custom parameter types like in https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/blob/master/cypress/support/step_definitions/customParameterTypes.js
I want them to be replaced in Data Tables
Test code to reproduce
custom parameter in cucumber runner
Versions
The text was updated successfully, but these errors were encountered: