Namespace: reporters

hobs. reporters

Result formating utils

Name Type Description
TXT string

Human readable text format

HTML string

HTML format

JUNIT_XML string

XML format following You can use this format to get test result report in Jenkins CI.


<static> formatResult(result, format)

Processes Hobbes.js result objects into different formats

Name Type Description
result object

An Hobbes.js result object (see hobs.TestSuite, hobs.TestCase)

format hobs.utils.resultOutput

The format of the output hobs.utils.resultOutput


A String representation the test element result in the chosen format


Get formatted report of TestCase execution

var tc = new hobs.TestCase('tc')

var tcRes = null;

// Asynchronous execution of the TestCase
tc.exec().then(function() {
     tcRes = tc.result();

// Wait until the test case got executed, then

// TXT report
hobs.reporters.formatResult(tcRes, hobs.reporters.TXT);
// [TC] tc (duration: 0.182s.)
//   1 [V] navigateTo : URL[sample-iframe.html]
//   2 [V] click : clicked ELEMENT[button]
//   3 [V] asserts exists : assert ELEMENT[#b1] does [] exist in the DOM

// HTML report
hobs.reporters.formatResult(tcRes, hobs.reporters.HTML);

// JUNIT XML report
hobs.reporters.formatResult(tcRes, hobs.reporters.JUNIT_XML);