colin_dev256
colin_dev256

Reputation: 815

Protractor screenshot tests error code 105

Protractor tests were running well till I messed around with my config.js file to include screenshot testing.

Errors from running protractor conf.js

C:\Users\hhhhhh\mmmm\tests\e2e>protractor conf.js

[10:50:13] E/configParser - error code: 105

[10:50:13] E/configParser - description: failed loading configuration file conf.js

C:\Users\hhhhhh\AppData\Roaming\npm\node_modules\protractor\built\configParser.js:130 throw new exitCodes_1.ConfigError(logger, 'failed loading configuration file ' + filename);`

package.json

{
  "name": "e2e",
  "version": "1.0.0",
  "description": "yup yup yup",
  "main": "conf.js",
  "dependencies": {
  "protractor-jasmine2-screenshot-reporter": "^0.3.1",
  "protractor": "3.3.0"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

conf.js

  var ScreenShotReporter = require('protractor-screenshot-reporter');

  exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub',

    capabilities: {
      'browserName': 'chrome'
    },

    directConnect: true,

    framework: 'jasmine2',

    specs: ['specs/*spec.js'],

    onPrepare: function() {
       jasmine.getEnv().addReporter(new ScreenShotReporter({
          baseDirectory: 'target/screenshots'
       }));
    }

  };

Many seem to be having issues with this. Anyone found a sound solution?

Upvotes: 0

Views: 2302

Answers (1)

Ram Pasala
Ram Pasala

Reputation: 5231

It looks from your package.json that you are using protractor-jasmine2-screenshot-reporter but you are using protractor-screenshot-reporter in your conf.js. Both are different modules, please use one of those and try again!

Upvotes: 1

Related Questions