# End-to-end tests

## Setup with docker

Are you running everything through docker? You're so lucky you don't have to setup anything!

Just:

```
docker-compose up
```

## Setup without docker

First, you have to tell cypress how to connect to your local neo4j database among other things. You can copy our template configuration and change the new file according to your needs.

To start the services that are required for cypress testing, run:

```bash
# in the top level folder Human-Connection/
$ yarn cypress:setup
```

## Install cypress

Even if the required services for testing run via docker, depending on your setup, the cypress tests themselves run on your host machine. So with our without docker, you would have to install cypress and its dependencies first:

```
# in the root folder /
yarn install
```

## Run cypress

After verifying that there are no errors with the servers starting, open another tab in your terminal and run the following command:

```bash
$ yarn cypress:run
```

![Console output after running cypress test](/files/-LeVN16CAd0PUCS0X7Ql)

### Open Interactive Test Console

If you are like me, you might want to see some visual output. The interactive cypress environment also helps at debugging your tests, you can even time travel between individual steps and see the exact state of the app.

To use this feature, instead of `yarn cypress:run` you would run the following command:

```bash
$ yarn cypress:open
```

![Interactive Cypress Environment](/files/-LclLonLGwOG0N5l5L0E)

## Write some Tests

Check out the Cypress documentation for further information on how to write tests: <https://docs.cypress.io/guides/getting-started/writing-your-first-test.html#Write-a-simple-test>


---

# 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://docs.human-connection.org/human-connection/testing/cypress.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.
