【问题标题】:Running codecept using jenkins使用 jenkins 运行 codecept
【发布时间】:2020-07-26 08:06:59
【问题描述】:

我们可以在测试中即时更改助手配置选项吗?我看到了动态配置设置,给出了以下命令

npx codeceptjs run --override '{ "helpers": {"Protractor": {"browser": "firefox"}}}'

但是当我运行时我得到以下错误

undefined:1
{helpers:
 ^

SyntaxError: Unexpected token h in JSON at position 1
    at JSON.parse (<anonymous>)
    at Command.module.exports (D:\Finlevit_Codecept_Cucumber\node_modules\codeceptjs\lib\command\run.js:21:33)
    at Command.listener (D:\Finlevit_Codecept_Cucumber\node_modules\commander\index.js:315:8)
    at Command.emit (events.js:311:20)
    at Command.parseArgs (D:\Finlevit_Codecept_Cucumber\node_modules\commander\index.js:651:12)
    at Command.parse (D:\Finlevit_Codecept_Cucumber\node_modules\commander\index.js:474:21)
    at Object.<anonymous> (D:\Finlevit_Codecept_Cucumber\node_modules\codeceptjs\bin\codecept.js:228:9)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)

有人可以帮我吗?

【问题讨论】:

  • 与文档中的示例匹配(例如codecept.io/commands),您是否还有其他声称是 JSON 但不是的配置?
  • No.. 我传递的这个 JSON 值似乎是正确的。不知道是什么问题
  • 请描述你使用的codeceptjs版本,并配置

标签: codeceptjs


【解决方案1】:

看起来你使用 Windows 和 CMD 工具。

该工具适用于双引号中的字符串。不要忘记使用 \" 转义 JSON 双引号

npx codeceptjs run --override "{ \"helpers\": {\"Protractor\": {\"browser\": \"firefox\"}}}"

或者你可以试试shell/linux builder。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-03
    • 1970-01-01
    • 2013-04-04
    • 2012-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多