gpt4 book ai didi

testing - 如何设置 TestCafe 以在 CLI 中指定的环境中运行?

转载 作者:行者123 更新时间:2023-12-04 13:59:58 25 4
gpt4 key购买 nike

如何设置 TestCafe 以在 CLI 中指定的环境中运行?
例如

testcafe chrome test.js --env=development

我想设置一个不同环境的列表 - 例如开发、集成等 - 在运行测试时我可以在其中调用 CLI。

配置中是否有默认设置?
有人有例子吗?

最佳答案

TEST_ENV=development npm run test:firefox
以上是运行测试的命令。
通过 process.env.Test_ENV 使用此环境变量,无论您需要将 'development' 或任何其他环境作为值传递。剧本,
 "scripts": {
"test:firefox": "testcafe firefox ./tests"}

关于testing - 如何设置 TestCafe 以在 CLI 中指定的环境中运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51274589/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com