# Test Reporting

Gondola is built on top of Mocha test framework. This means you're free to use any test reporters supported by Mocha.

  • We've tested Mochawesome and encourage its use with Gondola.
  • Allure is another test reporter you can use with Gondola. It's integrated using Gondola's plugin mechanism.
  • Junit Reporter for Mocha Is helpful for users who wish to integrate Gondola with their pipelines(like Jenkins, TFS,etc)
  • Mocha-Multi allows you to Mocha with multiple reporters at the same time.

# Gondola

Gondola's built-in test reporter is still under development. Currently, it provides an overview of what passed or failed and a summary of the test-run for stakeholders. Gondola report Overview

# Using Gondola Reporter

To use the built-in gondola reporter , add gondolareport after the reporter flag in scripts section of package.json. Example:

  "scripts": {
    "test:android": "./node_modules/.bin/gondola -c gondola.android.json run --steps --reporter gondolareport"
  }

# Mochawesome

Mochawesome is a designed to work in conjunction with Mocha Mocha Awesome

# Mochawesome Configuration

In gondola.json add Mochawesome to the list of helpers

 "helpers": {
//removed for brevity,
        "Mochawesome": {
        }
    }

And give mocha it's own section gondola.json

    "mocha": {
        "reporterOptions": {
            "reportDir": "results",
            "inlineAssets": true,
            "timestamp": "isoDateTime",
            "reportFilename": "gondola",
            "autoOpen": true,
            "reportPageTitle": "Gondola Test Result"
        }
    }

In packages.json add "test": "./node_modules/.bin/gondola run --steps --reporter mochawesome" to the scripts sections

"scripts": {
//removed for brevity
        "test": "./node_modules/.bin/gondola run --steps --reporter mochawesome"
    }

You'll need to add Mochawesome to the project by running this from the terminal

npm i mochawesome

TIP

if the project has previously been configured for Allure, remove any references to it.

# Mochawesome Usage

After your test has completed, the results will automatically be displayed in your browser.

# Allure

Allure creates reports that are useful to developers, testers and managers.

Allure Overview

Allure is great for Behavior Driven Development. You can see all the test steps laid out in an easy to read format.
Allure Overview

# Allure Configuration

To use Allure as your test reporter, add it to the plugins field in gondola.json

 "plugins": {
//code removed for brevity
      "allure": {},
//code removed for brevity
    }

The scripts section in packages.json should look like this:

 "scripts": {
    "compile": "./node_modules/.bin/tsc",
    "show-report": "./node_modules/.bin/allure serve results",
    "test": "./node_modules/.bin/gondola run --steps --plugins allure"
  }

WARNING

The default setting for output in gondola.json is ./results. If you've changed this you need to specify it in this line:

"show-report": "./node_modules/.bin/allure serve your-output-folder"

And you'll need to add Allure to project by running this from the terminal

npm i allure-commandline

TIP

If the project has previously been configured for Mochawesome, remove any references to it.

# Allure Usage

To see the an Allure report run npm run show-report from the terminal

Last Updated: 12/28/2020, 4:12:58 AM