Macros for Feature Files #1184
Replies: 1 comment 1 reply
-
The ability to chain transformers with Using external files as source for data tables in Cucumber is also an open issue. Any attempts at implementing a transformer should draw inspiration from said issue and perhaps SpecFlow's implementation. Furthermore, this tool is builder-agnostic, so you're going to have to find a way to do this with browserify, webpack and rollup as well.
I strongly suggest that you draw up a complete proposal to gain feedback from me, before implementing anything, as I won't merge a PR just because "anyone would like" it. |
Beta Was this translation helpful? Give feedback.
-
I was looking for a way to provide dynamic data for Scenario Outline Examples and came across this SO question: https://stackoverflow.com/questions/68349098/typescript-cypress-cucumber-preprocessor-writing-a-scenario-outline-with-dynam/78414225#78414225
No one had answered it, so I thought I would give it a go. It was relatively simple, all I needed to do was add a plugin argument to the EsBuildPlugin. These plugins will be passed content loaded from the feature flag and return a promise for a string, which is passed to the next plugin and so on. The final plugin will return the final feature content which is then passed to the compile function.
I think it could be quite useful to have these optional plugins in the product, as it allows users to add any arbitrary macros to their feature files should they need to, so I was wondering if anyone would like me to raise a PR for this complete with tests and documentation.
But I do understand we are now adding plugins, into plugins into plugins, so if we don't think that this is a good addition to the product no problem. I did look for an alternative way of achieving this without changing the esbuildPlugin, for example changing the file before esBuildPlugin would be called, but there didn't seem to be any way to do that from what I could see.
Beta Was this translation helpful? Give feedback.
All reactions