Testing Minecraft inventory GUIs is a core feature of the framework.
The API uses live handles and locators, inspired by Playwright, for reactive and reliable GUI interactions.
Quick Start
test('interact with shop GUI', async ({ player }) => { player.chat('/shop'); // Get a live handle to the GUI const gui = await player.gui({ title: /Shop/ }); // Create a locator for an item const diamondItem = gui.locator(item => item.name.includes('diamond')); // Click the item (with automatic retry) await diamondItem.click(); await expect(player).toHaveReceivedMessage('Purchased');});
Core Concepts
Live Handles vs Snapshots
Live Handle (LiveGuiHandle) - Always reflects the player’s current GUI state:
Returned by player.gui({ title })
Automatically updates when GUI changes
Use for dynamic, reactive testing
Snapshot (GuiWrapper) - Captures GUI state at a specific moment:
Legacy API, now deprecated
Use live handles for new code
Locators
Locators are queries that re-evaluate each time they’re used: