Search code examples
javascripttestingautomated-testse2e-testingtestcafe

Testcafe - reporter does not read options from testcaferc.json


I've been scratching my head with this for quite a while. I want to move the reporter options from my cli/package.json command into the testcaferc.json file, e.g.

"test:chrome:all": "testcafe chrome:headless ./src/tests/*test.ts --skip-js-errors --concurrency 4"

testcaferc.json:

"reporter": [
    {
      "name": "json"
    },
    {
      "output": "./artifacts/reports",
      "pathPattern": "${DATE}/${USERAGENT}/${TIME}/${FIXTURE}/${TEST}.json"
    }

However when i run my script it doesn't pick up these options and therefore doesn't create the report in the specified directory.

However if I include the --reporter json command in my cli, e.g.

"test:chrome:all": "testcafe chrome:headless ./src/tests/*test.ts --reporter json:./artifacts/reports/chrome_results.json --skip-js-errors --concurrency 4"

When I run the test, it states The "reporter" options from the configuration file will be ignored. and the report is created correctly.

So it can see them but just doesn't use them when not including --reporter json in the cli


Solution

  • This behavior is a bug. There is a corresponding issue in the TestCafe GitHub repository: https://github.com/DevExpress/testcafe/issues/6665