# Reports Generation

## **Reporting Library Configuration**

To set up reporting capabilities, follow these steps:

<details>

<summary>Step 1: Install Dependencies</summary>

Run the following command to install necessary dependencies:

{% code lineNumbers="true" %}

```bash
npm install --save-dev mochawesome mochawesome-merge mochawesome-report-generator
```

{% endcode %}

</details>

<details>

<summary>Step 2: Create Config File</summary>

In your configuration file (`cypress.json`), define the reporting options:

{% code lineNumbers="true" %}

```javascript
const { defineConfig } = require('cypress')

module.exports = defineConfig({
  reporter: 'mochawesome',
  reporterOptions: {
    chart: true,
    reportDir: 'cypress/results',
    overwrite: false,
    html: false,
    json: true,
  },
})
```

{% endcode %}

</details>

## **HTML Report Generation**

Follow these steps to generate HTML reports:

<details>

<summary>Step 1: Execute Specification File</summary>

Run the following command to execute the specification file:

{% code lineNumbers="true" %}

```bash
cypress run --reporter mochawesome --reporter-options reportDir="cypress/results",overwrite=false,html=false,json=true
```

{% endcode %}

</details>

<details>

<summary>Step 2: Merge Resulting JSON Files</summary>

Use the following command to merge resulting JSON files:

```bash
npx mochawesome-merge "cypress/results/*.json" > mochawesome.json
```

</details>

<details>

<summary>Step 3: Generate HTML Report Files</summary>

Generate an HTML report file using the following command:

```bash
npx marge mochawesome.jsonSte
```

</details>

## **Testing Report Template**

{% hint style="info" %}
View the testing report template here: [Testing Report Template](https://docs.google.com/spreadsheets/d/165Ue0pMUPD3S1CLCej64tfRJNk5Rf6bhTqiL29j81h4/edit?usp=sharing)

or

Download a testing report template using the link below.&#x20;
{% endhint %}

{% file src="/files/zEwIZcPClqICkGIGi8r0" %}

## **Testing Results Analysis**

Perform thorough analysis of testing results to identify insights, trends, and areas for improvement in the testing process.<br>

<figure><img src="https://lh7-us.googleusercontent.com/9vmQNXw3SsBBzsEApZYM2yvHPh1sFbKFKn5DSqRZLJvZDg-ltTJ_uVeQtLWW2n1kLKpXf-ov-Dv0uFHXGII4w7Sk1KTQ5E1Z8xVJEKHAn-P7gKBNk6AH2uqDekdQouRqxd_F3yhYEPjqEymPsx-JMw" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://processmaker.gitbook.io/quick-start-guides/processmaker-automated-testing/process-testing-automation/reports-generation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
