{
 "schema_version": 1,
 "generated": "2026-10-24",
 "id": "thebanri-limoni--write-ui-tests-by-widget-role",
 "repo": "thebanri/limoni",
 "repo_url": "https://github.com/thebanri/limoni",
 "repo_slug": "thebanri-limoni",
 "title": "Write UI tests that click widgets by role and label",
 "page_title": "How to write UI tests that click widgets by role and label with Limoni",
 "summary": "Test a Go terminal app by widget role and label instead of screen coordinates, using uitest.",
 "who": "A Go developer maintaining a terminal app whose tests break every time a layout shifts by a column.",
 "problem": "Tests that parse the character grid fail when the layout moves, so each small change breaks the suite.",
 "outcome": "A test suite that finds buttons, inputs and lists by their semantic role and label, waits for conditions instead of sleeping, and prints the widget tree of the last frame when it fails.",
 "steps": [
  "Run `go run github.com/thebanri/limoni/cmd/limoni@latest new myapp -template counter` (inferred, check the README)",
  "Run `cd myapp && go mod tidy`",
  "Run `go test ./...` and confirm the uitest test passes",
  "Open the generated test file and replace the checks with page.GetByRole(\"button\", \"<label>\").Click() and page.Expect(...) calls for your own widgets",
  "Run `go test ./...` again after each change to the UI"
 ],
 "agent_prompt": "In the Go project at <path>, using the github.com/thebanri/limoni module, add a uitest test that clicks the button labelled <label> and expects a widget with id status to contain the text <expected text>. Run go test ./... and report whether it passes; if it fails, include the printed widget tree.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README describes uitest as in-process testing with no terminal needed, but the API is pre-1.0 and the README warns the project has no stable 1.0 API yet.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "go",
 "requirements": [
  "Go toolchain installed (for go install, go get, go run and go test)",
  "A terminal that supports the app's output (images and some features depend on the terminal)",
  "For the MCP use case: an MCP client such as Claude Code or Cursor, and limoni-mcp available on PATH (the README does not show how to install it)",
  "For the backdrop use case: curl, sh, and a terminal emulator"
 ],
 "risk": "dual-use",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/thebanri-limoni/write-ui-tests-by-widget-role/",
 "md": "https://dedupedai.com/use-cases/thebanri-limoni/write-ui-tests-by-widget-role/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/thebanri-limoni--write-ui-tests-by-widget-role.json",
 "api_version": "v1"
}
