如何在 gauge bdd 中使用 "file:" 参数

How to use "file:" parameter in gauge bdd

我正在尝试使用仪表中的 "file" 特殊参数以便能够输入 json 文件。

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.

[关于如何在步骤定义级别使用这些特殊参数的文档并不清楚,并且围绕这些主题的仪表文档是高级别的而不是详细的。]

file 参数适用于文本文件,但有人可能会争辩说 json 也是一个文本文件(如果忽略类型)。

您可以将 json 读取为字符串,并在步骤实现中解组它。