{"id":15012774,"url":"https://github.com/microsoft/tui-test","last_synced_at":"2026-03-09T02:04:03.750Z","repository":{"id":221776001,"uuid":"748361025","full_name":"microsoft/tui-test","owner":"microsoft","description":"An end-to-end terminal testing framework for CLI and TUI experiences","archived":false,"fork":false,"pushed_at":"2024-12-02T09:51:55.000Z","size":316,"stargazers_count":122,"open_issues_count":10,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-04T14:29:47.939Z","etag":null,"topics":["automation","bash","cli","e2e-testing","fish","powershell","pwsh","terminal","testing","tui","tui-test"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-25T20:11:22.000Z","updated_at":"2026-02-28T18:06:26.000Z","dependencies_parsed_at":"2024-02-15T22:24:48.137Z","dependency_job_id":"e2138f71-a37e-425d-931a-5c485ac3418b","html_url":"https://github.com/microsoft/tui-test","commit_stats":null,"previous_names":["microsoft/tui-test"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/microsoft/tui-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftui-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftui-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftui-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftui-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/tui-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Ftui-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30280352,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T01:43:35.720Z","status":"online","status_checked_at":"2026-03-09T02:00:08.011Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bash","cli","e2e-testing","fish","powershell","pwsh","terminal","testing","tui","tui-test"],"created_at":"2024-09-24T19:43:12.238Z","updated_at":"2026-03-09T02:04:03.677Z","avatar_url":"https://github.com/microsoft.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# TUI Test\n\nTUI Test is a framework for testing terminal applications. It provides a rich API for writing tests that interact with a terminal application across macOS, Linux, and Windows with a wide range of shells. It is built to be **fast**, **reliable**, and **easy to use**.\n\n## Requirements\n\n- Node.js 20.X, 18.X, 16.X (16.6.0 \u003e=)\n\n## Installation\n\nInstall TUI Test as using `npm`:\n\n```sh\nnpm i -D @microsoft/tui-test\n```\n\nor `yarn`\n\n```sh\nyarn add --dev @microsoft/tui-test\n```\n\nor `pnpm`\n\n```sh\npnpm add -D @microsoft/tui-test\n```\n\n## Running Tests\n\nRunning tests is as simple as running TUI Test from the command line after installation:\n\n```sh\nnpx @microsoft/tui-test\n```\n\n## Capabilities\n\n### Resilient • No flaky tests\n\n**Auto-wait** TUI Test provides a rich API for interacting with the terminal. It waits for the terminal to be ready before executing commands, and it provides tooling for waiting for terminal renders before executing assertions.\n\n**Tracing**. Configure test retry strategy, capture stdout \u0026 stderr, and create detailed terminal snapshots to eliminate flakes.\n\n### Full isolation • Fast execution\n\n**Terminal contexts**. TUI Test creates a new 'terminal context' for each test, which includes a new terminal and new underlying pty. This delivers full test isolation with zero overhead. Creating new terminal contexts only takes a handful of milliseconds.\n\n### Multi-platform / Multi-shell • No more \"it works in my shell\"\n\n**Multi-platform**. TUI Test supports testing on macOS, Linux, and Windows with a wide range of shells when installed: `cmd`, `windows powershell`, `powershell`, `bash`, `git-bash`, `fish`, `zsh`, and `xonsh`.\n\n**Wide-support**. TUI Test uses [xterm.js](https://xtermjs.org/) to render the terminal, which is a widely used terminal emulator in projects like [VSCode](https://github.com/microsoft/vscode) and [Hyper](https://github.com/vercel/hyper).\n\n## Examples\n\nTo find more TUI Test examples [check out the examples folder](./examples) or in TUI Test's [e2e tests](./test/).\n\n### Terminal Program\n\nThis code snippet shows how to start the terminal with a specific program running.\n\n```ts\nimport { test, expect } from \"@microsoft/tui-test\";\n\ntest.use({ program: { file: \"git\" } });\n\ntest(\"git shows usage message\", async ({ terminal }) =\u003e {\n  await expect(terminal.getByText(\"usage: git\", { full: true })).toBeVisible();\n});\n```\n\n### Terminal Screenshot\n\nThis code snippet shows how to take a screenshot of the terminal.\n\n```ts\nimport { test, expect } from \"@microsoft/tui-test\";\n\ntest(\"take a screenshot\", async ({ terminal }) =\u003e {\n  terminal.write(\"foo\")\n\n  await expect(terminal.getByText(\"foo\")).toBeVisible();\n  await expect(terminal).toMatchSnapshot();\n});\n```\n\n### Terminal Assertions\n\nThis code snippet shows how to use rich assertions of the terminal.\n\n```ts\nimport { test, expect } from \"@microsoft/tui-test\";\n\ntest(\"make a regex assertion\", async ({ terminal }) =\u003e {\n  terminal.submit(\"ls -l\")\n\n  await expect(terminal.getByText(/total [0-9]{3}/g)).toBeVisible();\n});\n```\n\n## Traces\n\nTUI Test provides a rich tracing system to help you debug and diagnose issues with your tests. You can enable traces by setting the `trace` value in your `tui-test.config.ts` to `true` or by running the cli with the `-t/--trace` flag.\n\nTraces are contain a replay of everything the terminal received and can be used to diagnose issues with your tests, especially when issues happen on different machines. Traces are stored in by default in the `tui-traces` folder in the root of your project and can be replayed via the `show-trace` command.\n\n## Configuration\n\nTUI Test can be configured via the `tui-test.config.[ts|js]` file in the root of your project. The following is an example of a configuration file:\n\n```ts\nimport { defineConfig } from \"@microsoft/tui-test\";\n\nexport default defineConfig({\n  retries: 3,\n  trace: true\n});\n\n```\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft\ntrademarks or logos is subject to and must follow\n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Ftui-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Ftui-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Ftui-test/lists"}