Git Product home page Git Product logo

gulp-protractor-cucumber-html-report's People

Contributors

bill77 avatar danyc avatar mikewoudenberg avatar nicolaspayot avatar smuldr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gulp-protractor-cucumber-html-report's Issues

FYI cucumber-protractor does output json

If you're using Protractor in combination with CucumberJS there currently is no way to save the CucumberJS JSON output to a file.

The ticket to which that text links is closed as 'done'.

Certainly using the excellent protractor-cucumber, adding resultJsonOutputFile to the config does produce JSON as expected.

The "save screenshot" code needs changing

The "save screenshot" code needs changing. Node conversion from image to base64 was getting corrupted. Not entirely sure why, but it's related to newer version of Node. If you remove the mime type prior to base64 conversion, and omit the conversion to binary, it works fine. The following code works (tested!).

this.After(function (scenario, callback) {
        if (scenario.isFailed()) {
            browser.takeScreenshot().then(function (png) {
                var decodedImage = new Buffer(png.replace(/^data:image\/(png|gif|jpeg);base64,/,''), 'base64');
                scenario.attach(decodedImage, 'image/png');
                callback();
            });
        }
        else {
            callback();
        }
});

Screenshots end up being base64 encoded twice

It seems cucumber.js is now doing the encoding themselves when attaching pngs. I therefore had to decode twice to get the screenshot ending up viewable in the report:

browser.takeScreenshot().then(function (stream) {
        //double decode the image to workaround the double encoding that cucumber.js+report does
        scenario.attach(new Buffer(new Buffer(stream, 'base64'), 'base64'), 'image/png', function (err) {
          callback(err);
        });
      });

More discussion on this here: cucumber/cucumber-js#275

Here are the relevant packages I'm using:

"cucumber": "^1.2.1",
"gulp-protractor": "^2.4.0",
"gulp-protractor-cucumber-html-report": "^0.1.2",
"protractor": "^4.0.0",
"protractor-cucumber-framework": "^0.6.0",

I'm not sure which tool is doing the wrong thing here, as I don't understand Cucumber's conventions on how to encode embeddings...

Data Table for step not displayed in HTML report

While generating report Data Table not displayed in HTML report. While investigating the problem, I found that JSON generated by cucumberjs is different than expected in gulp-protractor-cucumber-html-report.

The Step function is expecting step.rows, however, cucumber js giving format as
step.arguments[i].rows. Therefore, data table not displayed in the report.

Get Step function -

/**

  • Return html code of step element based on step template
  • @param step - object which contains step data
  • @returns string
    */
    function getStep(step) {
    var template = fs.readFileSync(templates.stepTemplate),
    compiled = lodashTemplate(template.toString());
return compiled({
  status: step.result ? step.result.status : '',
  errorDetails: step.result ? toHtmlEntities(step.result.error_message) : '',
  name: step.keyword + (step.name ? step.name : ''),
  **dataTable: step.rows ? step.rows : ''**
});

}

CucumberJS Generated JSON -

{
"arguments": [
{
"rows": [
{
"cells": [
"user",
"password"
]
},
{
"cells": [
"dcadmin",
"dcadmin"
]
}
]
}
],
"keyword": "And ",
"name": "I enters credentials as below",
"result": {
"status": "passed",
"duration": 6060613
},
"line": 7,
"match": {
"location": "E:\Deployment_Center\Cucumber\Protractor\step_definitions\LoginStepDef.js:21"
}
}

Add sample screenshot to readme

It would be very useful to add a sample screenshot to readme.md to provide an early feedback about the capabilities of this package.

protractorReport is not defined error.

I follow the usage docs by making a gulp task:

gulp.task('cucumber-report', function () {
gulp.src('features/reports/cucumber_report.html.json')
.pipe(protractorReport({
dest: 'reports/'
}));
});

And then I run this task through the command line:
gulp cucumber-report

But it gives this error:
ReferenceError: protractorReport is not defined

What is "protractorReport" supposed to be? I thought this module was supposed to allow me to point to the output json file from cucumberjs and then it generates a nice html file. Is that true?

JSON file gets overwritten

I have two features each with 2 scenarios. With format: 'json' and the code snippet (without fs-extra) I noticed that my file gets overwritten and only the last run output survives.

I am using cucumber-tsflow

What can be causing the problem ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.