# Tesults Service

> wdio-tesults-service is a 3rd party package, for more information please see [GitHub](https://github.com/tesults/wdio-tesults-service) | [npm](https://www.npmjs.com/package/wdio-tesults-service)

Report WebdriverIO test results to Tesults, write them to a local JSON file, or do both in the same run. The service supports WebdriverIO's Mocha, Jasmine, and Cucumber frameworks.

## Installation[​](#installation "Direct link to Installation")

```
npm install --save-dev wdio-tesults-service
```

## Configuration[​](#configuration "Direct link to Configuration")

Register the service in `wdio.conf.js`. Supply a Tesults target token to upload results:

```
exports.config = {

  services: [

    ['tesults', { target: 'token' }]

  ]

};
```

Existing target-only configurations continue to upload results as before.

## Write results locally[​](#write-results-locally "Direct link to Write results locally")

Set `TESULTS_OUTPUT_FILE` to write the consolidated Tesults JSON payload without uploading it:

```
TESULTS_OUTPUT_FILE=./test-results/tesults-results.json npx wdio run ./wdio.conf.js
```

Parent directories are created automatically. The local payload has an empty `target` value. When both `target` and `TESULTS_OUTPUT_FILE` are configured, the service writes the local payload and uploads the results to Tesults.

## GitHub Actions reporting[​](#github-actions-reporting "Direct link to GitHub Actions reporting")

The [Test Automation Reporting for GitHub Actions](https://github.com/tesults/test-automation-reporting) action supplies `TESULTS_OUTPUT_FILE` automatically. Place the action before the WebdriverIO test step:

```
- name: Set up test automation reporting

  uses: tesults/test-automation-reporting@v1



- name: Run WebdriverIO tests

  run: npm test
```

Keep `wdio-tesults-service` registered in `wdio.conf.js`. A target token is optional.

## Documentation[​](#documentation "Direct link to Documentation")

Complete documentation about installation, configuration and usage is available at <https://www.tesults.com/docs/wdio>.

## Testing[​](#testing "Direct link to Testing")

```
npm test
```

## Support[​](#support "Direct link to Support")

<support@tesults.com>

## License[​](#license "Direct link to License")

Distributed under the terms of the MIT license, "wdio-tesults-service" is free and open source software

## Issues[​](#issues "Direct link to Issues")

If you encounter any problems, please contact <help@tesults.com> or visit <https://www.tesults.com/contact>
