tui-test

Conduisez, inspectez, exécutez des assertions sur, enregistrez et surveillez un vrai terminal depuis la ligne de commande avec le CLI tui-test. À utiliser lors de l'exécution de shells (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

Plus de skills de microsoft

oss-growth
microsoft
Persona de growth hacker OSS
agent-framework-azure-ai-py
microsoft
Créez des agents Azure AI Foundry à l’aide du SDK Python Microsoft Agent Framework (agent-framework-azure-ai). À utiliser lors de la création d’agents persistants avec AzureAIAgentsProvider, de l’utilisation d’outils hébergés (interpréteur de code, recherche de fichiers, recherche web), de l’intégration de serveurs MCP, de la gestion de fils de conversation ou de l’implémentation de réponses en streaming. Couvre les outils de fonction, les sorties structurées et les agents multi-outils.
development
airunway-aks-setup
microsoft
Configurez AI Runway sur AKS — du cluster nu au modèle en cours d'exécution. Couvre la vérification du cluster, l'installation du contrôleur, l'évaluation GPU, la configuration du fournisseur et le premier déploiement. QUAND : « configurer AI Runway », « intégrer un cluster AKS », « installer AI Runway », « configuration airunway », « déployer un modèle sur AKS », « inférence GPU sur AKS », « configuration KAITO sur AKS », « exécuter LLM sur AKS », « vLLM sur AKS », « configurer le service de modèles sur AKS », « contrôleur AI Runway ».
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
Instrumentez les applications navigateur/web avec le SDK JavaScript Application Insights (@microsoft/applicationinsights-web). Utilisez-le pour la surveillance des utilisateurs réels (RUM) — vues de page, clics, dépendances AJAX/fetch, exceptions, événements personnalisés et traces d’agents GenAI côté navigateur corrélées aux traces OpenTelemetry backend. Couvre le script de chargement du SDK et la configuration npm, les extensions de framework (React, React Native, Angular), Click Analytics, les initialiseurs de télémétrie et les conventions sémantiques OTel GenAI pour les spans d’agents/outils/modèles émises depuis le navigateur.
devops
azure-ai-anomalydetector-java
microsoft
Créez des applications de détection d'anomalies avec le SDK Azure AI Anomaly Detector pour Java. Utilisez-le lors de l'implémentation de la détection d'anomalies univariées/multivariées, de l'analyse de séries temporelles ou de la surveillance basée sur l'IA.
development
azure-ai-language-conversations-py
microsoft
Implémentez la compréhension du langage conversationnel (CLU) à l’aide du SDK Python azure-ai-language-conversations. Utilisez-le lorsque vous travaillez avec ConversationAnalysisClient pour analyser l’intention et les entités d’une conversation, créer des fonctionnalités de NLP ou intégrer la compréhension du langage dans des applications.
development
azure-ai-ml-py
microsoft
SDK v2 d’Azure Machine Learning pour Python. Utiliser pour les espaces de travail ML, les tâches, les modèles, les jeux de données, le calcul et les pipelines. Déclencheurs : « azure-ai-ml », « MLClient », « espace de travail », « registre de modèles », « tâches d’entraînement », « jeux de données ».
development