@@ -46,3 +46,52 @@ yarn upgrade --latest
4646## Release
4747
4848TBD
49+
50+
51+ ### E2E Tests
52+ There are serval ways to run the e2e tests.
53+ Make sure to have a up to date ` dist/ ` folder using ` yarn build ` .
54+
55+ #### Local development use case
56+ ``` BASH
57+ cd tests/
58+ docker-compose up -d checkmk grafana
59+ yarn run cypress open
60+ ```
61+ This will show you a nice interactive GUI to run and debug your E2E tests.
62+ See the official [ docs] ( https://docs.cypress.io/guides/overview/why-cypress ) for more information.
63+
64+ #### No Interactivity use case (e.g. CI)
65+ ``` BASH
66+ cd tests/
67+ docker-compose up --exit-code-from=cypress
68+ ```
69+ This will run all tests without any further interaction necessary.
70+
71+ #### No docker use case
72+ If you don't want to or can't use docker at all, make sure you have a Grafana and a CheckMK instance running somewhere.
73+ The Plugin you want to test needs to be installed in you Grafana instance.
74+
75+
76+ You also need to set serval environment variables.
77+
78+ | Variable | Description |
79+ | -----------------------------| -------------|
80+ | CYPRESS_baseUrl | The URL to your Grafana instance |
81+ | CYPRESS_grafanaUsername | The username used to log into Grafana |
82+ | CYPRESS_grafanaPassword | the password used to log into Grafana|
83+ | CYPRESS_grafanaToCheckmkUrl | The url from which grafana can reach CheckMK |
84+ | CYPRESS_cypressToCheckmkUrl | The url from which cypress can reach CheckMK |
85+ | CYPRESS_cmkUsername | The username of a CheckMK admin |
86+ | CYPRESS_cmkPassword | The password of that CheckMK admin |
87+
88+ If everything is set up, just start cypress the usual way.
89+ ``` BASH
90+ yarn run cypress open
91+
92+ # or if you just want to see the results
93+ yarn run cypress run
94+ ```
95+
96+ Please note that the test have side effects on your Grafana and CheckMK instance,
97+ such as creating a new automation user.
0 commit comments