mlison / protractor-jasmine2-screenshot-reporter

Protractor screenshot reporter for Jasmine2
https://www.npmjs.com/package/protractor-jasmine2-screenshot-reporter
MIT License
81 stars 79 forks source link

Last screenshot not linked in report #120

Open antgel opened 6 years ago

antgel commented 6 years ago

Looks like the kludge doesn't always work. I wonder if it's because I have SELENIUM_PROMISE_MANAGER: false? Here's my conf.js:



var hsr = new HtmlScreenshotReporter({
  dest: 'screenshots',
  filename: 'index.html',
  inlineImages: false
  // TODO: Placeholder to fix CSS support.
  //userCss: 'html_screenshot_reporter.css'
});

var SpecReporter = require('jasmine-spec-reporter').SpecReporter;

const width = 1280;
const height = 1024;

exports.config = {
  baseUrl: 'https://app.MUNGED.com',
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  SELENIUM_PROMISE_MANAGER: false, // using async / await
  specs: ['spec.js'],
  // Commented on purpose - will be a nice bonus, but first let's
  // build up our test coverage.
  /* multiCapabilities: [{
    browserName: 'firefox'
  }, {
    browserName: 'chrome'
  }] */

  beforeLaunch: function() {
    return new Promise(function(resolve){
      hsr.beforeLaunch(resolve);
    });
  },

  onPrepare: function () {
    jasmine.getEnv().addReporter(hsr);
    jasmine.getEnv().addReporter(new SpecReporter({
      spec: {
        displayStacktrace: true
      }
    }));
    browser.driver.manage().window().setSize(width, height);
  },

  afterLaunch: function(exitCode) {
    return new Promise(function(resolve){
      hsr.afterLaunch(resolve.bind(this, exitCode));
    });
  },

  // Empty on purpose to remove default protractor dot reporter
  jasmineNodeOpts: {
    print: function() {}
  }
};```
mlison commented 6 years ago

I actually don't know, but this process.nextTick trick has been known not to work for everybody.