Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Table for step not displayed in HTML report #22

Open
chormule opened this issue Feb 4, 2017 · 0 comments
Open

Data Table for step not displayed in HTML report #22

chormule opened this issue Feb 4, 2017 · 0 comments

Comments

@chormule
Copy link

chormule commented Feb 4, 2017

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"
}
}

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

No branches or pull requests

1 participant