jemishgopani/wdio-json-reporter

Unable to change the file extension for circleci builds

simonwilbert opened this issue · 1 comments

Hi there,

Not sure how else to ask this question other than create an issue.

I have a wdio project building in circleci. It runs cucumber tests, but i'm unable to get the output showing in the test results tab in circle ci. From their documentation it states i need to write test results to ${CIRCLE_TEST_REPORTS}\cucumber/*.cucumber files.

my wdio.conf has...

framework: 'cucumber',
...
reporters: ['dot', 'spec', 'json'],
    reporterOptions: {
        outputDir: './cucumber'
    },
...
cucumberOpts: {
        require: [
            './test/steps/given.js',
            './test/steps/then.js',
            './test/steps/when.js'
        ],        // <string[]> (file/dir) require files before executing features
        backtrace: false,   // <boolean> show full backtrace for errors
        compiler: [
            'js:babel-register'
        ],       // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
        dryRun: false,      // <boolean> invoke formatters without executing steps
        failFast: false,    // <boolean> abort the run on first failure
        format: ['pretty'], // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
        colors: true,       // <boolean> disable colors in formatter output
        snippets: true,     // <boolean> hide step definition snippets for pending steps
        source: true,       // <boolean> hide source uris
        profile: [],        // <string[]> (name) specify the profile to use
        strict: false,      // <boolean> fail if there are any undefined or pending steps
        tags: require('./test/tagProcessor'),           // <string[]> (expression) only execute the features or scenarios with tags matching the expression
        timeout: 20000,     // <number> timeout for step definitions
        ignoreUndefinedDefinitions: false, // <boolean> Enable this config to treat undefined definitions as warnings.
    },
...`

I also then have a circle.yml file which copies all files in cucumber folder to circleci build artifacts folder,

machine:
  node:
    version: 6.0.0
test:
  override:
    - mkdir -p ${CIRCLE_TEST_REPORTS}/cucumber
    - npm run testdev
    - cp -R ./cucumber ${CIRCLE_TEST_REPORTS}/

my packages.json has a script "testdev" as follows

"testdev": "wdio wdio.dev.conf.js"

I can see the json reporter has hard-coded .json extension. any way to change to .cucumber?

@simonwilbert I know this is old but though I should respond. I'm should be able to be a lot more responsive going forward.

I think it makes sense to keep the file extension as .json since that is what we produce.