API Docs for: 0.0.2
Show:

Reporter Class

Defined in: index.js:35
Module: Reporter

The jUnit reporter can produce a jUnit compatible file with the results of your testrun, this reporter enables you to use daleks testresults within a CI environment like Jenkins.

The reporter can be installed with the following command:

$ npm install dalek-reporter-junit --save-dev

The file will follow the jUnit XML format:

<?xml version="1.0" encoding="utf-8"?>
<resource name="DalekJSTest">
    <testsuite start="1375125067" name="Click - DalekJS guinea pig [Phantomjs]" end="1375125067" totalTests="1">
        <testcase start="1375125067" name="Can click a select option (OK, jQuery style, no message)" end="1375125067" result="pass">
            <variation start="1375125067" name="val" end="1375125067">
                <severity>pass</severity>
                <description>&lt;![CDATA[David is the favourite]]&gt;</description>
                <resource>DalekJSTest</resource>
            </variation>
            <variation start="1375125067" name="val" end="1375125067">
                <severity>pass</severity>
                <description>&lt;![CDATA[Matt is now my favourite, bow ties are cool]]&gt;</description>
                <resource>DalekJSTest</resource>
            </variation>
        </testcase>
    </testsuite>
 </resource>

By default the file will be written to report/dalek.xml, you can change this by adding a config option to the your Dalekfile

"junit-reporter": {
  "dest": "your/folder/your_file.xml"
}

If you would like to use the reporter (in addition to the std. console reporter), you can start dalek with a special command line argument

$ dalek your_test.js -r console,junit

or you can add it to your Dalekfile

"reporter": ["console", "junit"]

Constructor

Reporter

()

Defined in index.js:35

Methods

_checkNodeAttributes

(
  • testIdx
  • testCount
  • variationCount
)

Defined in index.js:330

Helper method to check if attributes should be set to an empty object literal

Parameters:

  • testIdx String

    Id of the test node

  • testCount String

    Id of the child node

  • variationCount String

    Id of the testCount child node

_recursiveMakeDirSync

(
  • path
)

Defined in index.js:306

Helper method to generate deeper nested directory structures

Parameters:

  • path String

    PAth to create

assertion

(
  • data
)
chainable

Defined in index.js:200

Generates XML skeleton for an assertion

Parameters:

  • data Object

    Event data

runBrowser

(
  • browser
)
chainable

Defined in index.js:154

Stores the current browser name

Parameters:

  • browser String

    Browser name

runnerFinished

(
  • data
)
chainable

Defined in index.js:280

Finishes XML and writes file to the file system

Parameters:

  • data Object

    Event data

startListening

() chainable

Defined in index.js:136

Connects to all the event listeners

testFinished

(
  • data
)
chainable

Defined in index.js:251

Finishes XML skeleton for a testcase

Parameters:

  • data Object

    Event data

testStarted

(
  • data
)
chainable

Defined in index.js:229

Generates XML skeleton for a testcase

Parameters:

  • data Object

    Event data

testsuiteFinished

() chainable

Defined in index.js:188

Finishes XML skeleton for testsuites

testsuiteStarted

(
  • name
)
chainable

Defined in index.js:167

Generates XML skeleton for testsuites

Parameters:

  • name String

    Testsuite name