# Configuring Lighthouse reports in NeetoPlaydash

- **Author**: S Varun
- **Category**: Lighthouse reports
- **URL**: https://help.neetoplaydash.com/articles/configuring-lighthouse-reports-in-neetoplaydash

---

Playwright can audit the Lighthouse scores of a page with the help of the [playwright-lighthouse](https://www.npmjs.com/package/playwright-lighthouse), which lets you analyze the performance and get insights on the best practices used on your web applications. To know more details about setting up and using this package, refer to [this link](https://www.npmjs.com/package/playwright-lighthouse#usage).

NeetoPlaydash allows you to save the Lighthouse HTML reports for the runs. To do this, the following pre-requisites are needed.

1. [@bigbinary/neeto-playwright-reporter](https://www.npmjs.com/package/@bigbinary/neeto-playwright-reporter) package version \>= 1.7.1
2. The [playwright-lighthouse](https://www.npmjs.com/package/playwright-lighthouse) package setup and working properly

We have added a few additional Playwright fixtures in the neeto-playwright reporter package to help make the setup easier. To do this, use the test module from neeto-playwright-reporter

```
- import test from "@playwright/test"
+ import { test } from "@bigbinary/neeto-playwright-reporter"
```

Once this is done all the additional fixtures in the neeto-playwright-reporter will be available for use. To add the Lighthouse HTML reports in NeetoPlaydash do the following setup.

```
// Sample test to verify Lighthouse reports

import { chromium } from "@playwright/test";
import { test } from "@bigbinary/neeto-playwright-reporter";

test("test title", async ({
    generateLighthouseMetaData,
    attachLighthouseReport,
  }) => {
    const { playAudit } = await import("playwright-lighthouse"); // Import the playwright-lighthouse package.
    // const { playAudit } = require("playwright-lighthouse"); // If cjs scripts are used
    const context = await chromium.launchPersistentContext(`${__dirname}/persistentContext`, {
        args: ["--remote-debugging-port=9222"],
      })

    const lighthouseMetadata = generateLighthouseMetaData(); // Used to get the metadata for generating the Lighthouse report

    const page = await context.newPage();
    await page.goto("/");

    await playAudit({
      page,
      port: 9222, // Use the port number open in the context for remote debugging
      thresholds: { // Set threshold values acceptable for your application
        performance: 0, 
        accessibility: 0,
        "best-practices": 0,
        seo: 0,
        pwa: 0,
      },
      reports: lighthouseMetadata,
    });

    await attachLighthouseReport(lighthouseMetadata.pathToLightHouseHTMLReport);
})
```

The `generateLighthouseMetadata` and `attachLighthouseReport` methods ensure that the lighthouse reports generated by `playwright-lighthouse` is accessible by the `neeto-playwright-reporter` while reporting the test results to NeetoPlaydash.

### Viewing results in NeetoPlaydash

Once `playwright-lighthouse` is configured and the test is reported to NeetoPlaydash, you will be able to see a new section in the test results action pane called **Lighthouse reports** as seen below:

[![Screenshot 2025-02-06 at 16.24.05.png](https://assets-cdn.neetokb.com/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6ImQ0OGZmNzI2LTkwYjUtNGRiMS04ZDNlLTEwNTM4MDU4NWQyZSIsInB1ciI6ImJsb2JfaWQifX0=--7d150cf959ca53cedc1fb7f9cd8c7acd7637bc0f/Screenshot%202025-02-06%20at%2016.24.05.png)](https://assets-cdn.neetokb.com/rails/active_storage/blobs/proxy/eyJfcmFpbHMiOnsiZGF0YSI6ImQ0OGZmNzI2LTkwYjUtNGRiMS04ZDNlLTEwNTM4MDU4NWQyZSIsInB1ciI6ImJsb2JfaWQifX0=--7d150cf959ca53cedc1fb7f9cd8c7acd7637bc0f/Screenshot%202025-02-06%20at%2016.24.05.png)
_Lighthouse reports section in test results_

From here you will be able to see all the lighthouse reports you reported in a test attempt and view the HTML report

**Demo**

https://s-varun.neetorecord.com/embeds/d87efa51bc0abb640a8a