0

Can we change helper configuration options on the fly from a test? I saw the Dynamic configuration settings, gave the below command

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

but when i run at i get the below error

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)

Can someone help me?

1 Answers1

0

Looks like you use Windows with CMD tool.

That tool works with strings in double quotes. Don't forget to escape JSON double quotes with \"

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

Or you can try shell/linux builder.