# Zafira Listener Service

> wdio-zafira-listener-service is a 3rd party package, for more information please see [GitHub](https://github.com/shashidharus/wdio-zafira-listener-service) | [npm](https://www.npmjs.com/package/wdio-zafira-listener-service) A custom service for WDIO to report tests to [Zafira Dashboard](http://demo.qaprosoft.com/zafira/)

## How to use[​](#how-to-use "Direct link to How to use")

### Requirements[​](#requirements "Direct link to Requirements")

* Node.js 10.x +

### Install[​](#install "Direct link to Install")

* npm install wdio-zafira-listener-service

### Example wdio config[​](#example-wdio-config "Direct link to Example wdio config")

```
const ZfService = require('wdio-zafira-listener-service')



exports.config = {

  specs: [

    './test/e2e/*.js'

  ],

  capabilities: [

    { browserName: 'chrome' }

  ],

  services: ['chrome', new ZfService(

    { // Service Options

      refreshToken: 'eyJhbGci....', // http://demo.qaprosoft.com/zafira-ws/swagger-ui.html#!/auth-api-controller/login

      username: 'admin',

      testSuite: {

        fileName: 'test.xml',

        name: 'example_test',

      },

      job: { // Jenkins Settings

        "jenkinsHost": process.env.HOST || 'demo.qaprosoft.com',

        "jobURL": process.env.BUILD_URL || 'http://demo.qaprosoft.com/jenkins/job/shashidemo/5/', //  // Jenkins Build URL

        "name": process.env.JOB_NAME || 'shashidemo',

      },

      run: {

        buildNumber: process.env.BUILD_NUMBER || 6,

        startedBy: process.env.BUILD_CAUSE_MANUALTRIGGER ? 'HUMAN' : 'SCHEDULER' // One of  "SCHEDULER", "UPSTREAM_JOB", "HUMAN"

      }

    }

  )],

...

}
```
