Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

don't work with protractor 2.0.0 #25

Open
bessdsv opened this issue Mar 24, 2015 · 7 comments
Open

don't work with protractor 2.0.0 #25

bessdsv opened this issue Mar 24, 2015 · 7 comments
Labels

Comments

@bessdsv
Copy link

bessdsv commented Mar 24, 2015

No description provided.

@swissmanu
Copy link
Owner

please provide further information (logs, error messages).

@eddiemonge
Copy link

  onPrepare: ->
    jasmine.getEnv().addReporter new ScreenShotReporter
      baseDirectory: path.resolve __dirname, 'results-e2e/screenshots'
      pathBuilder: ( spec, desc, results, capabilities ) ->
        path.join capabilities.caps_.browser, desc.join '-'

No images are stored in the baseDirectory and nothing in the protractor output relates to screenshots

@kovpack
Copy link

kovpack commented Jun 3, 2015

Yes, I've got the same problem.

@eddiemonge
Copy link

@swissmanu is that enough? I wonder if its because of jasmine 2 though

@nervgh
Copy link

nervgh commented Aug 29, 2015

Same here with protractor 2.2.0

@SteveAquino
Copy link

I don't know if it's helpful, but I've written my own reporter that works with the current version of protractor (3.0). It's very simple, but it could be used as a basis to update this project.

var fs = require('fs');

function writeScreenShot(data, filename) {
  var stream = fs.createWriteStream(filename);
  stream.write(new Buffer(data, 'base64'));
  stream.end();
}

function ScreenshotReporter(config) {
  this.config = config;
};

/*
 *  Create tmp/screenshots if it doesn't exist
 */
ScreenshotReporter.prototype.jasmineStarted = function(suiteInfo) {
  if(!fs.existsSync('tmp/screenshots')) { fs.mkdirSync('tmp/screenshots'); }
};

/*
 *  Take a screenshot and write it to the a
 *  parameterized file name based on the spec.
 */
ScreenshotReporter.prototype.specDone = function(result) {
  name = result.fullName.replace(/\W+/g, "-").replace(/^\W+/, '');
  browser.takeScreenshot().then(function (png) {
    writeScreenShot(png, 'tmp/screenshots/' + name + '.png');
  });
};

module.exports = ScreenshotReporter;

@arnaugm
Copy link

arnaugm commented May 9, 2016

I'm having the same issue and @SteveAquino's reporter seems to work fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants