> For the complete documentation index, see [llms.txt](https://cypress.visual-image-diff.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cypress.visual-image-diff.dev/getting-started/cypress-integration.md).

# Cypress integration

Follow the steps below to have access to the comparison command so you can build visual regression tests

### Setup

Install Cypress:

```sh
npm i -D cypress
```

Install the core package and the HTML report:

```sh
npm i -D cypress-image-diff-js cypress-image-diff-html-report
```

Then initialise Cypress if you don't have a project:

```sh
npx cypress open
```

Finally follow a suitable option for you below:

* [Typescript](/getting-started/cypress-integration/typescript.md)
* [Javascript](/getting-started/cypress-integration/javascript.md)
* [Cypress < v10](/getting-started/cypress-integration/cypress-less-than-v10.md)

Once the above is complete, you will be all set to [write a test](/getting-started.md#writing-a-test)!

If you have any struggles with integration, please refer to [these examples](https://github.com/kien-ht/cypress-image-diff-html-report/tree/1aad688d5f4806be82a85c8bce1461cb0dbe4d79/examples).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://cypress.visual-image-diff.dev/getting-started/cypress-integration.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.
