如何从黄瓜功能文件传递柏树环境变量?
我想从Cucumber功能文件传递柏树环境变量。但是,在柏树中运行脚本时,找不到404的错误。
有什么想法吗? 使用的版本: “柏树”:“^9.5.4”, “赛普拉斯 - 核对象预处理”:“^4.3.1”
I want to pass cypress environment variables from cucumber feature file. But while running scripts in cypress runner getting 404 NOT FOUND error.
Any Ideas please?
Versions used:
"cypress": "^9.5.4",
"cypress-cucumber-preprocessor": "^4.3.1"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面,我向您展示如何在功能文件中使用任何变量。您只需通过环境变量替换示例中的变量(这是资产名称)。
注释:
在我的示例中,该部分示例中的变量和字段资产名称下方是引号,因为我的测试文件中的预期变量并与这些步骤链接在一起,这是一个字符串。如果您使用的是int,则必须跳过报价。
如果在ABCD0000000026以下添加更多值,则测试将与您添加的值一样多次运行,例如loop
Below, I show you how to use any variable within a feature file. You only have to replace the variable in the example (which is assetName) by your environment variable.
Notes:
In my example the variable within the section Examples and below the field assetName, it's in quotes because the expected variable in my test file and linked with those steps, it's a string. If you are using int you must skip the quotes.
If you add more values below ABCD0000000026, your test will run as many times as values you add, like a loop