<commit_before>[![Build Status](https://travis-ci.org/dhis2/api-tests.svg?branch=master)](https://travis-ci.org/dhis2/api-tests)

# DHIS2 API Testing

Repository for DHIS2 API Testing.

## Run tests locally

Make sure you have the required NPM dependencies installed:

```sh
$ npm install
```

Run tests with the default API endpoint:

```sh
$ npm test
```

Run tests overriding the default API endpoint:

```sh
$ npm test -- --world-parameters "{\"apiEndpoint\":\"https://play.dhis2.org/demo/api/27\",\"generateHtmlReport\":false}"
```

Available parameters are:

| Name | Default value | Description |
| --- | --- | --- |
| `apiEndpoint` | Defined inside `utils.js` file | The API endpoint to use to run the tests  |
| `generateHtmlReport` | `true` | Whether an HTML report should be generated or not |

## Run tests with Docker

Set the environment variable `DHIS2_GENERATE_HTML_REPORT` to `false` to skip the HTML report generation:

```sh
$ export DHIS2_GENERATE_HTML_REPORT=false
```

Start Docker:<commit_msg>Api updated to 26 as defined on scope<commit_after>[![Build Status](https://travis-ci.org/dhis2/api-tests.svg?branch=master)](https://travis-ci.org/dhis2/api-tests)

# DHIS2 API Testing

Repository for DHIS2 API Testing.

## Run tests locally

Make sure you have the required NPM dependencies installed:

```sh
$ npm install
```

Run tests with the default API endpoint:

```sh
$ npm test
```

Run tests overriding the default API endpoint:

```sh
$ npm test -- --world-parameters "{\"apiEndpoint\":\"https://play.dhis2.org/demo/api/26\",\"generateHtmlReport\":false}"
```

Available parameters are:

| Name | Default value | Description |
| --- | --- | --- |
| `apiEndpoint` | Defined inside `utils.js` file | The API endpoint to use to run the tests  |
| `generateHtmlReport` | `true` | Whether an HTML report should be generated or not |

## Run tests with Docker

Set the environment variable `DHIS2_GENERATE_HTML_REPORT` to `false` to skip the HTML report generation:

```sh
$ export DHIS2_GENERATE_HTML_REPORT=false
```

Start Docker:
{'fraction_non_alphanumeric': 0.13813229571984437, 'fraction_numerical': 0.009727626459143969, 'mean_word_length': 4.274358974358974, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2782128', 'n_tokens_mistral': 682, 'n_tokens_neox': 635, 'n_words': 208}