Skip to content

iambalabharathi/nxgreport

Repository files navigation

Markdownify
Next Gen Report 💎

GitHub    Pipeline Status    Ruby Version    Gem Version

A simple light weighted gem to generate a beautiful e-mailable test report. (7500+ Downloads)

Generates a static site (Supports Dark 🌓 mode).

DemoInstallationUsageLicense

Demo

Markdownify

Markdownify

Installation

gem install nxgreport

Usage

require 'nxgreport'

$NxgReport.setup(location: "Absolute file path", title: "My Report")

$NxgReport.set_device(name: "iPhone X")
$NxgReport.set_os(name: "iOS 12.1")
$NxgReport.set_release(name: "M09 2020")
$NxgReport.set_app_version(no: "app0.9.1")
$NxgReport.set_environment(name: "QA")

$NxgReport.log_test(
        feature_name: "Feature Name",
        test_name: "This is a test",
        test_status: "Pass/Fail",
        comments: "Error message or additional comments about the test",
        tag: "critical")

$NxgReport.build()

Cucumber-Ruby Usage

In env.rb add the below line

require 'nxgreport'

$NxgReport.setup(location: "Absolute file path", title: "My Report")

$NxgReport.set_device(name: "iPhone X")
$NxgReport.set_os(name: "iOS 12.1")
$NxgReport.set_release(name: "M09 2020")
$NxgReport.set_app_version(no: "app0.9.1")
$NxgReport.set_environment(name: "QA")

In hooks.rb add the below block of code.

After do |scenario|

    feature_name = scenario.feature.name
    scenario_status = !scenario.failed?() ? "Pass" : "Fail"
    comments = (scenario.exception.nil?) ? "Success" : scenario.exception.message

    $NxgReport.log_test(
            feature_name: feature_name,
            test_name: scenario.name,
            test_status: scenario_status,
            comments: comments,
            tag: "critical")
end

at_exit do
    $NxgReport.build()
end

Like it?

Buy Me A Coffee

License

Copyright © 2020 MIT License