| 1 |
# Home Assistant End-to-End Tests |
| 2 |
|
| 3 |
This directory contains end-to-end tests for the Home Assistant notification service. |
| 4 |
The tests send real notifications to a local Home Assistant container and verify persistent notifications through the websocket `persistent_notification/get` command. |
| 5 |
|
| 6 |
## Overview |
| 7 |
|
| 8 |
`setup.sh` starts Home Assistant, completes onboarding, and writes `SHOUTRRR_HOMEASSISTANT_URL` to `.env`. |
| 9 |
|
| 10 |
## Test Coverage |
| 11 |
|
| 12 |
- Persistent notification create |
| 13 |
- Title |
| 14 |
- Notification ID replace |
| 15 |
- HTTP (`disabletls=yes`) |
| 16 |
- Unauthorized token |
| 17 |
|
| 18 |
## Setup Requirements |
| 19 |
|
| 20 |
- Go 1.27+ |
| 21 |
- Docker and Docker Compose |
| 22 |
- curl |
| 23 |
- python3 |
| 24 |
- Linux OS |
| 25 |
|
| 26 |
### Quick Start |
| 27 |
|
| 28 |
```bash |
| 29 |
cd testing/e2e/homeassistant |
| 30 |
./setup.sh setup-all |
| 31 |
go test -v . |
| 32 |
``` |
| 33 |
|
| 34 |
To stop the server: |
| 35 |
|
| 36 |
```bash |
| 37 |
./setup.sh stop-server |
| 38 |
``` |
| 39 |
|
| 40 |
## Environment |
| 41 |
|
| 42 |
`setup.sh` writes `.env`: |
| 43 |
|
| 44 |
```bash |
| 45 |
SHOUTRRR_HOMEASSISTANT_URL=homeassistant://TOKEN@localhost:8123/?disabletls=yes |
| 46 |
``` |
| 47 |
|
| 48 |
The access token is created during onboarding. Run `setup-all` again if the token has expired. |