Skip to content

Commit 08c1002

Browse files
Document how to hook up Element to the resultant homeservers from Complement (#164)
Spawned from #68
1 parent 136fd60 commit 08c1002

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
@@ -194,6 +194,36 @@ For Goland:
194194
* Under "Run"->"Edit Configurations..."->"Templates"->"Go Test", add `COMPLEMENT_BASE_IMAGE=complement-dendrite:latest`
195195
* Then you can right-click on any test file or test case and "Run <test name>".
196196

197+
198+
### How do I hook up a Matrix client like Element to the homeservers spun up by Complement after a test runs?
199+
200+
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.
201+
202+
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
203+
1. Start the Complement tests
204+
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)
205+
```json
206+
{
207+
"default_server_config": {
208+
"m.homeserver": {
209+
"base_url": "http://localhost:55449",
210+
"server_name": "my.complement.host"
211+
}
212+
},
213+
"brand": "Element"
214+
}
215+
```
216+
1. Start up Element (your matrix client)
217+
```
218+
docker run -it --rm \
219+
--publish 7080:80 \
220+
--volume ~/Downloads/riot-complement-config.json:/app/config.json \
221+
--name riot-complement \
222+
vectorim/riot-web:v1.7.8
223+
```
224+
1. Now you can visit http://localhost:7080/ and register a new user and explore the rooms from the test output
225+
226+
197227
### What do I need to know if I'm coming from sytest?
198228

199229
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)