Some months ago, I wanted to generate a modern html report from my selenoid json reports using Go. I tried to find something good for me already ready to use, but I didn't. So I've created the GOCURE.
GOCURE is a library written in pure Go providing the possibility to generate html reports from cucumber json reports.
Import
Is it possible to use gocure by importing in a project
import (
"gitlab.com/rodrigoodhin/gocure/pkg/htmlreport"
)
Generate html report file with charts
htmlreport.Generate("cucumber_report.json", "output/", true)
Generate report html file without charts
htmlreport.Generate("cucumber_report.json", "output/", false)
Generate report html text with charts
htmlReport, _ := htmlreport.Export("cucumber_report.json", true)
Generate report html text without charts
htmlReport, _ := htmlreport.Export("cucumber_report.json", false)
Build and Execute
If you don't want to import, you can build the project and execute
git clone git@gitlab.com:rodrigoodhin/gocure.git
cd gocure
go build gocure.go
Usage of gocure
Example:
./gocure -j <CucumberJSONFile> -o <OutputFolder> -c
-j = Cucumber Json File. MANDATORY
-o = Output Folder
-c = Set if chart will be included
Example:
./gocure -j /path/to/json/file.json
./gocure -j /path/to/json/file.json -o output/folder/
./gocure -j /path/to/json/file.json -o output/folder/ -c
HTML Report Screenshot
Example of a html report generated with gocure
Top comments (0)