Skip to content

Commit 59553a6

Browse files
committed
Document how to hook up Element to the resultant homeservers from Complement
Spawned from #68
1 parent 91b0879 commit 59553a6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

ONBOARDING.md

+30
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,36 @@ For Goland:
188188
* Under "Run"->"Edit Configurations..."->"Templates"->"Go Test", add `COMPLEMENT_BASE_IMAGE=complement-dendrite:latest`
189189
* Then you can right-click on any test file or test case and "Run <test name>".
190190

191+
192+
### How do I hook up a Matrix client like Element to the homeservers spun up by Complement after a test runs?
193+
194+
It can be useful to view the output of a test in Element to better debug something going wrong or just make sure your test is doing what you expect before you try to assert everything.
195+
196+
1. In your test comment out `defer deployment.Destroy(t)` and replace with `defer time.Sleep(2 * time.Hour)` to keep the homeserver running after the tests complete
197+
1. Start the Complement tests
198+
1. Save the Element config as `~/Downloads/riot-complement-config.json` and replace the port according to the output from `docker ps` (`docker ps -f name=complement_` to just filter to the Complement containers)
199+
```json
200+
{
201+
"default_server_config": {
202+
"m.homeserver": {
203+
"base_url": "http://localhost:55449",
204+
"server_name": "my.complement.host"
205+
}
206+
},
207+
"brand": "Element"
208+
}
209+
```
210+
1. Start up Element (your matrix client)
211+
```
212+
docker run -it --rm \
213+
--publish 7080:80 \
214+
--volume ~/Downloads/riot-complement-config.json:/app/config.json \
215+
--name riot-complement \
216+
vectorim/riot-web:v1.7.8
217+
```
218+
1. Now you can visit http://localhost:7080/ and register a new user and explore the rooms from the test output
219+
220+
191221
### What do I need to know if I'm coming from sytest?
192222

193223
Sytest has a concept of a `fixture` to configure the homeserver or test in a particular way, these are replaced with a `Blueprint` in Complement.

0 commit comments

Comments
 (0)