Search code examples
validationbddassertgetgauge

How to use "file:" parameter in gauge bdd


I'm trying to make use of the "file" special parameter in gauge to be able to feed in a json file.

is this feasible or does the file param only work for text files? are there any examples i could follow on how the file parameter flows downstream into the step definitions or is this not the case.

[it wasn't clear from the documentation on how these special parameters could be used at a step definition level and the gauge documentation around these topics are high level and not detailed.]


Solution

  • file parameters work for text files, but one could argue that json is also a text file (if you ignore the types).

    You could read the json as string, and unmarshall it in the step implementation.