API Docs for: 0.0.2
Show:

Reporter Class

Defined in: index.js:34
Module: Reporter

The JSON reporter can produce a file with the results of your testrun.

The reporter can be installed with the following command:

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

The file will follow the following format. This is a first draft and will definitly change in future versions.

{
  "tests": [
        {
          "id": "test806",
          "name": "Can get !url (OK, TDD style, message, chained)",
          "browser": "Chrome",
          "status": true,
          "passedAssertions": 1,
          "failedAssertions": 0,
          "actions": [
              {
                  "value": "http://localhost:5000/index.html",
                  "type": "open",
                  "uuid": "6ea84fc0-58bf-4e1f-bb9c-f035c6e6fae2",
                  "kind": "action",
                  "isAction": true
              },
              {
                  "success": true,
                  "expected": "http://localhost:5000/guinea.html",
                  "value": "http://localhost:5000/index.html",
                  "message": "Url is not whatever",
                  "type": "url",
                  "kind": "assertion",
                  "isAssertion": true
              }
          ]
      }
  ],
  "elapsedTime": {
      "minutes": 1,
      "seconds": 43.328535046
  },
  "status": true,
  "assertions": 1,
  "assertionsFailed": 0,
  "assertionsPassed": 1
}

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

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

Constructor

Reporter

()

Defined in index.js:34

Methods

_recursiveMakeDirSync

(
  • path
)

Defined in index.js:283

Helper method to generate deeper nested directory structures

Parameters:

  • path String

    PAth to create

action

(
  • data
)
chainable

Defined in index.js:161

Generates JSON for an action

Parameters:

  • data Object

    Event data

assertion

(
  • data
)
chainable

Defined in index.js:175

Generates JSON for an assertion

Parameters:

  • data Object

    Event data

assertion

(
  • data
)
chainable

Defined in index.js:251

Generates JSON for a message.log

Parameters:

  • data Object

    Event data

assertion

(
  • data
)
chainable

Defined in index.js:268

Generates JSON for a screenshot

Parameters:

  • data Object

    Event data

runBrowser

(
  • browser
)
chainable

Defined in index.js:148

Stores the current browser name

Parameters:

  • browser String

    Browser name

runnerFinished

(
  • data
)
chainable

Defined in index.js:224

Serializes JSON and writes file to the file system

Parameters:

  • data Object

    Event data

startListening

() chainable

Defined in index.js:129

Connects to all the event listeners

testFinished

(
  • data
)
chainable

Defined in index.js:203

Writes data for a finished testcase

Parameters:

  • data Object

    Event data

testStarted

(
  • data
)
chainable

Defined in index.js:189

Sets up a new testcase

Parameters:

  • data Object

    Event data