Hytale’s server-side UI system sends commands to the client to build and update pages. HRTK intercepts these commands during tests, letting you verify that your UI logic sends the correct instructions without needing a real client connection. UI testing catches layout bugs, missing sections, and incorrect data bindings before they reach players. Since the server drives the UI through commands, you can verify the complete page structure without rendering anything.Documentation Index
Fetch the complete documentation index at: https://docs.hrtk.frotty27.com/llms.txt
Use this file to discover all available pages before exploring further.
Core Concepts
- UICommandCapture - records all UI commands (SET, APPEND, REMOVE) sent during a test
- UIAssert - asserts on the captured commands
- UITestAdapter - server-side adapter that creates captures from page builds
Complete Example Suite
UICommandCapture Interface
| Method | Description |
|---|---|
getCommands() | Get all captured UI command records |
hasCommand(path, operation) | Check if a command was sent for the path with the operation |
hasSet(path, value) | Check if a SET command was sent with the given value |
getCount() | Total number of captured commands |
UIAssert Methods
| Method | Description |
|---|---|
assertCommandSent(capture, path, operation) | Assert a command was sent for path + operation |
assertCommandSentWithValue(capture, path, value) | Assert a SET command with specific value |
assertPageAppended(capture, pagePath) | Assert an APPEND operation at the path |
assertHasCommands(capture) | Assert at least one command was captured |
assertCommandCount(capture, expected) | Assert exact number of captured commands |
UITestAdapter
TheUITestAdapter on the server side bridges between your page-building code and the test capture system. It intercepts the PageManager command stream and records every command that would normally be sent to the client.
In your test code, you typically do not interact with
UITestAdapter directly. Instead, write helper methods in your test suite that invoke your page-building logic and return the captured commands.When to Test UI
UI tests are most useful when:- Your mod builds complex server-driven UI pages
- You need to verify page structure without a connected client
- You want regression tests for UI layout changes
- You implement data-binding where server values populate UI fields
Next Steps
- Networking - packet round-trip testing
- Command Testing - test commands with mock senders
- Event Testing - capture and verify events