zerocode icon indicating copy to clipboard operation
zerocode copied to clipboard

Ability to write a message to HTML report

Open johnc2017 opened this issue 4 years ago • 5 comments

In the Zerocode Interactive Report noticed that if a test is passed there is no request body posted but is present when a test is failed. Need a way to print the request/response body or any custom text onto the Passed Report as well from a test step? This forms the test evidence for auditing that the correct data was posted/received

Perhaps something like a keyword called "print2html" or just "print"

"print2html": "Some message" 
"print2html": "${somevariable}"
"print2html": "${abc.request.body}"
etc.

johnc2017 avatar Nov 09 '20 16:11 johnc2017

Hi @johnc2017 is the issue still available I would like to work on it.

2022H1030042G avatar Sep 08 '22 04:09 2022H1030042G

@2022H1030042G , you can introduce a "meta" section to the core "scenario->step" and have the below provision inside the "step".

"print2html": "Some message" 
"print2html": "${somevariable}"
"print2html": "${abc.request.body}"
etc.

That might do the job.

nirmalchandra avatar Sep 13 '22 12:09 nirmalchandra

@nirmalchandra , where exactly do I have to make these changes?

2022H1030042G avatar Sep 26 '22 15:09 2022H1030042G

@2022H1030042G , into the DSL section, you can add the above lines e.g.

{
  "scenario": {
    "steps": [
       //... do nothing
    ],
    // Add this extra section so that the report is amended with the extra information from the "meta" section.
    "meta": {
      "print2html": "Some message",
      "print2html": "${somevariable}",
      "print2html": "${abc.request.body}"
    }
  }
}

I think this way we can keep this section optional.

But in case of doubts or if it can be done differently, please collaborate/discuss with the developer/tester who raised this issue. There could be a better solution possible to suit the requirement.

nirmalchandra avatar Sep 27 '22 09:09 nirmalchandra

@sparrowV @johnc2017 @nirmalchandra what I mean is where in the repository (under which folder/file) , do I have to make the changes?

2022H1030042G avatar Sep 27 '22 10:09 2022H1030042G