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
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 |
Building and Capturing UI Commands
UseUITestAdapter to trigger a page build and capture the resulting commands:
Examples
Verify a SET command was sent
Verify a SET command was sent
Verify page structure with APPEND
Verify page structure with APPEND
Verify exact command count
Verify exact command count
Test with a mock capture
Test with a mock capture
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.Complete Example
Next Steps
- Networking — packet round-trip testing
- Command Testing — test commands with mock senders
- Event Testing — capture and verify events