tui-test

โดย microsoft

ขับเคลื่อน ตรวจสอบ ยืนยัน บันทึก และเฝ้าดูเทอร์มินัลจริงจากบรรทัดคำสั่งด้วย tui-test cli ใช้เมื่อรันเชลล์ (bash, zsh, fish, PowerShell, …)

npx skills add https://github.com/microsoft/tui-test --skill tui-test

tui-test

Use tui-test to control and test a real terminal.

Pick an API

ContextUseReference
Agent or shell workflowCLICLI
Python codetui_testPython
JavaScript or TypeScript@microsoft/tui-testJavaScript
Rust codetui-test-rsRust
Common tasksCurrent project languageRecipes

Use the library that matches the project. Use the CLI when the terminal must persist across separate commands or be watched with monitor.

CLI and library sessions do not share state.

CLI

tui-test run my-app
tui-test expect text "Ready"
tui-test click text "Continue"
tui-test expect text "Done"
tui-test close

Run tui-test agent-context for exact command and option names.

Python

from tui_test import TuiTest

async with TuiTest.ephemeral() as terminal:
    await terminal.run("my-app")
    await terminal.get_by_text("Ready").expect()
    await terminal.get_by_text("Continue").click()

JavaScript

import { TuiTest } from "@microsoft/tui-test";

const terminal = TuiTest.ephemeral();
try {
  await terminal.run("my-app");
  await terminal.getByText("Ready").expect();
  await terminal.getByText("Continue").click();
} finally {
  await terminal.closeQuiet();
}

Locators

Use text and style locators for visible terminal state.

save = (
    terminal
    .get_by_text("Settings")
    .get_by_text("Save", direction="after")
    .unique()
)

await save.click()
  • Use first(), last(), nth(), or unique() before an action when text repeats.
  • Use get_by_style() or getByStyle() for colors and attributes.
  • Use direction="within", "after", or "before" for relative matches.
  • Use locations() or count() for immediate reads.
  • Use wait(), expect(), or click() when the app may still be changing.

Wait for state

NeedUse
Visible or hidden textLocator wait() or expect()
Submitted command finishedwait command, wait_command(), waitCommand()
Program exitedwait exit, wait_exit(), waitExit()
Shell prompt readywait ready, wait_ready(), waitReady()
Screen stopped changingwait idle, wait_idle(), waitIdle()
Clipboard changed or matchedwait clipboard, wait_clipboard(), waitClipboard()
Bell firedwait bell, wait_bell(), waitBell()

Do not use a fixed sleep when a wait can describe the state.

Keep tests stable

  • Give parallel tests unique sessions.
  • Use open for shell commands and run for an app.
  • Assert the exit code separately from visible text.
  • Keep the shell, terminal size, cwd, environment, and timeouts explicit when they affect output.
  • Use semantic mouse buttons: left, middle, or right.
  • Close every session. Prefer the Python and JavaScript test helpers.

Capture output

Use screenshot for text or SVG. Use record for APNG, GIF, MP4, or asciinema. Use recording mode on-failure for test artifacts.

References

Skills เพิ่มเติมจาก microsoft

oss-growth
microsoft
บุคลิกภาพนักเติบโตโอเอสเอส
agent-framework-azure-ai-py
microsoft
สร้างเอเจนต์ Azure AI Foundry โดยใช้ Microsoft Agent Framework Python SDK (agent-framework-azure-ai) ใช้เมื่อสร้างเอเจนต์แบบถาวรด้วย AzureAIAgentsProvider ใช้เครื่องมือที่โฮสต์ไว้ (ตัวแปลโค้ด การค้นหาไฟล์ การค้นหาเว็บ) ผสานรวมเซิร์ฟเวอร์ MCP จัดการเธรดการสนทนา หรือใช้งานการตอบสนองแบบสตรีมมิ่ง ครอบคลุมเครื่องมือฟังก์ชัน ผลลัพธ์แบบมีโครงสร้าง และเอเจนต์แบบหลายเครื่องมือ
development
airunway-aks-setup
microsoft
ตั้งค่า AI Runway บน AKS — จากคลัสเตอร์เปล่าสู่การรันโมเดล ครอบคลุมการตรวจสอบคลัสเตอร์ การติดตั้งคอนโทรลเลอร์ การประเมิน GPU การตั้งค่าผู้ให้บริการ และการปรับใช้ครั้งแรก เมื่อ: "ตั้งค่า AI Runway", "เริ่มใช้งานคลัสเตอร์ AKS", "ติดตั้ง AI Runway", "ตั้งค่า airunway", "ปรับใช้โมเดลกับ AKS", "อนุมานด้วย GPU บน AKS", "ตั้งค่า KAITO บน AKS", "รัน LLM บน AKS", "vLLM บน AKS", "ตั้งค่าการให้บริการโมเดลบน AKS", "AI Runway controller
devops
appinsights-instrumentation
microsoft
Guidance for instrumenting webapps with Azure Application Insights. Provides telemetry patterns, SDK setup, and configuration references. WHEN: how to instrument app, App Insights SDK, telemetry patterns, what is App Insights, Application Insights guidance, instrumentation examples, APM best practices.
devops
applicationinsights-web-ts
microsoft
ใช้เครื่องมือวัดแอปเบราว์เซอร์/เว็บด้วย Application Insights JavaScript SDK (@microsoft/applicationinsights-web) ใช้สำหรับ Real User Monitoring (RUM) — การดูหน้าเว็บ คลิก ดีเพนเดนซี AJAX/fetch ข้อยกเว้น อีเวนต์ที่กำหนดเอง และเทรซเอเจนต์ GenAI ฝั่งเบราว์เซอร์ที่เชื่อมโยงกับเทรซ OpenTelemetry ฝั่งแบ็กเอนด์ ครอบคลุมการตั้งค่า SDK Loader Script และ npm ส่วนขยายเฟรมเวิร์ก (React, React Native, Angular), Click Analytics, ตัวเริ่มต้นเทเลเมทรี และหลักการตั้งชื่อเชิงความหมาย OTel GenAI สำหรับสแปนเอเจนต์/เครื่องมือ/โมเดลที่ส่งจากเบราว์เซอร์
devops
azure-ai-anomalydetector-java
microsoft
สร้างแอปพลิเคชันตรวจจับความผิดปกติด้วย Azure AI Anomaly Detector SDK สำหรับ Java ใช้เมื่อต้องการนำการตรวจจับความผิดปกติแบบตัวแปรเดียว/หลายตัวแปร การวิเคราะห์อนุกรมเวลา หรือการตรวจสอบที่ขับเคลื่อนด้วย AI ไปใช้
development
azure-ai-language-conversations-py
microsoft
ใช้ Conversational Language Understanding (CLU) ด้วย Python SDK ของ azure-ai-language-conversations ใช้เมื่อทำงานกับ ConversationAnalysisClient เพื่อวิเคราะห์เจตนาและเอนทิตีของการสนทนา สร้างฟีเจอร์ NLP หรือผสานความเข้าใจภาษาเข้ากับแอปพลิเคชัน
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 สำหรับ Python ใช้สำหรับพื้นที่ทำงาน ML งาน โมเดล ชุดข้อมูล คอมพิวต์ และไปป์ไลน์ ทริกเกอร์: "azure-ai-ml", "MLClient", "workspace", "model registry", "training jobs", "datasets
development