Skip to content

Reporters Not working #285

Closed

Description

@nathagey

What are you trying to achieve?

mochawesome html reporting.

What do you get instead?

An error saying the reporter is not valid.

invalid reporter "mochawesome"

Error:
    at Mocha.reporter (/Users/nhagey/work/fun-tests/node_modules/codeceptjs/node_modules/mocha/lib/mocha.js:164:13)
    at new Mocha (/Users/nhagey/work/fun-tests/node_modules/codeceptjs/node_modules/mocha/lib/mocha.js:88:8)
    at new Codecept (/Users/nhagey/work/fun-tests/node_modules/codeceptjs/lib/codecept.js:20:18)
    at Command.module.exports (/Users/nhagey/work/fun-tests/node_modules/codeceptjs/lib/command/run.js:14:20)
    at Command.listener (/Users/nhagey/work/fun-tests/node_modules/codeceptjs/node_modules/commander/index.js:301:8)
    at emitTwo (events.js:106:13)
    at Command.emit (events.js:191:7)
    at Command.parseArgs (/Users/nhagey/work/fun-tests/node_modules/codeceptjs/node_modules/commander/index.js:615:12)
    at Command.parse (/Users/nhagey/work/fun-tests/node_modules/codeceptjs/node_modules/commander/index.js:458:21)
    at Object.<anonymous> (/Users/nhagey/work/fun-tests/node_modules/codeceptjs/bin/codecept.js:88:9)

Running this command

node_modules/.bin/codeceptjs run --reporter mochawesome

Details

  • CodeceptJS version: 0.4.8
  • NodeJS Version: v6.2.0
  • Operating System: OSX 10.10.5
  • WebDriverIO
  • Configuration file:
{
  "tests": "./*_test.js",
  "timeout": 10000,
  "output": "./output",
  "helpers": {
    "WebDriverIO": {
      "url": "https://my-site.com",
      "browser": "chrome"
    }
  },
  "include": {
    "I": "./steps_file.js"
  },
  "bootstrap": false,
  "mocha": {
    "reporterOptions": {
      "reportDir": "output"
    }
   },
  "name": "fun-tests"
}

Package.json

{
  "name": "fun-tests",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Nat Hagey <nhagey@lb.com> (https://confluence.victoriassecret.com/users/viewuserprofile.action?username=NHagey)",
  "license": "ISC",
  "devDependencies": {
    "chromedriver": "^2.25.1",
    "codeceptjs": "^0.4.8",
    "mocha-junit-reporter": "^1.12.1",
    "mochawesome": "^1.5.3",
    "webdriverio": "^4.4.0"
  }
}

Activity

  1. DavertMik commented on Nov 12, 2016

    @DavertMik
    Contributor

    I tried to reproduce on demo repository and didn't succeed.

    npm i codeceptjs --save-dev
    npm i mochawesome --save-dev
    npm install --save-dev protractor@^4.0.0
    node_modules/.bin/codeceptjs run --reporter mochawesome
    
    
    [23:15:25] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
    [mochawesome] Generating report files...
    
    
    
      TodoMvc
        ✓ create todo item (1646ms)
        ✓ edit todo (599ms)
        ✓ enter todo (673ms)
        ✓ check todo item (561ms)
    
    
      4 passing (10s)
    
    
    [mochawesome] Report saved to mochawesome-reports/mochawesome.html
    

    My codecept.json:

    {
      "tests": "./*_test.js",
      "timeout": 10000,
      "output": "./output",
      "helpers": {
        "Protractor": {
          "url": "http://todomvc.com/examples/angularjs/",
          "driver": "hosted",
          "browser": "firefox",
          "rootElement": "body",
          "restart": false
        }
      },
      "include": {
        "I": "./steps_file.js"
      },
      "bootstrap": false,
      "mocha": {},
      "name": "todoangular"
    }

    my package.json

    {
      "name": "todoangular",
      "version": "1.0.0",
      "description": "Demonstrates scenario-driven approach to testing AngularJS apps with Protractor and CodeceptJS",
      "main": "TodoMvc_test.js",
      "dependencies": {},
      "devDependencies": {
        "codeceptjs": "^0.4.8",
        "mochawesome": "^1.5.3",
        "protractor": "^4.0.11"
      },
      "scripts": {
        "test": "mocha"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/DavertMik/codeceptjs-angular-todomvc.git"
      },
      "author": "",
      "license": "ISC",
      "bugs": {
        "url": "https://github.com/DavertMik/codeceptjs-angular-todomvc/issues"
      },
      "homepage": "https://github.com/DavertMik/codeceptjs-angular-todomvc#readme"
    }

    Probably something messed up with npm and maybe mochawesome is not installed. Could you ensure that the package is not only listed but actually installed?

  2. DavertMik commented on Nov 18, 2016

    @DavertMik
    Contributor

    No replies.. I'm closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions