windows-desktop-e2e
Fungsinya
Alat ini membantu Anda menguji program komputer yang dibuat untuk Windows. Alat ini memeriksa apakah tombol, kotak teks, dan bagian lain dari program bekerja sebagaimana mestinya, dengan menggunakan teknologi bernama UI Automation.
Kapan dipakai
- βKetika Anda sedang membuat pengujian untuk program Windows.
- βKetika pengujian otomatis untuk program Windows Anda gagal.
- βKetika ingin membuat program Windows menjadi lebih mudah diuji.
Link skill
https://github.com/affaan-m/ECC/blob/main/skills/windows-desktop-e2e/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBagaimana cara menguji apakah tombol login pada program Windows saya berfungsi?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Alat ini menggunakan UI Automation, yaitu fitur bawaan Windows, untuk menemukan dan berinteraksi dengan elemen visual pada program. Dengan cara ini, pengujian dapat mengklik tombol dan mengetik teks, sama seperti yang dilakukan pengguna.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Windows Desktop E2E Testing
End-to-end testing for Windows native desktop applications using pywinauto backed by Windows UI Automation (UIA). Covers WPF, WinForms, Win32/MFC, and Qt (5.x / 6.x) β with Qt-specific guidance as a dedicated section.
When to Activate
- Writing or running E2E tests for a Windows native desktop application
- Setting up a desktop GUI test suite from scratch
- Diagnosing flaky or failing desktop automation tests
- Adding testability (AutomationId, accessible names) to an existing app
- Integrating desktop E2E into a CI/CD pipeline (GitHub Actions
windows-latest)
When NOT to Use
- Web applications β use
e2e-testingskill (Playwright) - Electron / CEF / WebView2 apps β the HTML layer needs browser automation, not UIA
- Mobile apps β use platform-specific tools (UIAutomator, XCUITest)
- Pure unit or integration tests that don't need a running GUI
Core Concepts
All Windows desktop automation relies on UI Automation (UIA), a Windows-built-in accessibility API. Every supported framework exposes a tree of UIA elements with properties Claude can read and act on:
Your test (Python)
βββ pywinauto (UIA backend)
βββ Windows UI Automation API β built into Windows, framework-agnostic
βββ App's UIA provider β each framework ships its own
βββ Running .exe
UIA quality by framework:
| Framework | AutomationId | Reliability | Notes |
|---|---|---|---|
| WPF | 5/5 | Excellent | x:Name maps directly to AutomationId |
| WinForms | 4/5 | Good | AccessibleName = AutomationId |
| UWP / WinUI 3 | 5/5 | Excellent | Full Microsoft support |
| Qt 6.x | 5/5 | Excellent | Accessibility enabled by default; class names change to Qt6* |
| Qt 5.15+ | 4/5 | Good | Improved Accessibility module |
| Qt 5.7β5.14 | 3/5 | Fair | Needs QT_ACCESSIBILITY=1; objectName manual |
| Win32 / MFC | 3/5 | Fair | Control IDs accessible; text matching common |
Setup & Prerequisites
# Python 3.8+, Windows only
pip install pywinauto pytest pytest-html Pillow pytest-timeout
# Optional: screen recording
# Install ffmpeg and add to PATH: https://ffmpeg.org/download.html
Verify UIA is reachable:
from pywinauto import Desktop
Desktop(backend="uia").windows() # lists all top-level windows
Install Accessibility Insights for Windows (free, from Microsoft) β your DevTools equivalent for inspecting the UIA element tree before writing any test.
Testability Setup (by Framework)
The single most impactful thing you can do is give every interactive control a stable AutomationId before writing tests.
WPF
<!-- XAML: x:Name becomes AutomationId automatically -->
<TextBox x:Name="usernameInput" />
<PasswordBox x:Name="passwordInput" />
<Button x:Name="btnLogin" Content="Login" />
<TextBlock x:Name="lblError" />
WinForms
// Set in designer or code
usernameInput.AccessibleName = "usernameInput";
passwordInput.AccessibleName = "passwordInput";
btnLogin.AccessibleName = "btnLogin";
lblError.AccessibleName = "lblError";
Win32 / MFC
// Control resource IDs in .rc file are exposed as AutomationId strings
// IDC_EDIT_USERNAME -> AutomationId "1001"
// Prefer SetWindowText for Name; add IAccessible for richer support
Qt β see dedicated section below
Page Object Model
tests/
βββ conftest.py # app launch fixture, failure screenshot
βββ pytest.ini
βββ config.py
βββ pages/
β βββ __init__.py # required for imports
β βββ base_page.py # locators, wait, screenshot helpers
β βββ login_page.py
β βββ main_page.py
βββ tests/
β βββ __init__.py
β βββ test_login.py
β βββ test_main_flow.py
βββ artifacts/ # screenshots, videos, logs
base_page.py
import os, time
from pywinauto import Desktop
from config import ACTION_TIMEOUT, ARTIFACT_DIR
class BasePage:
def __init__(self, window):
self.window = window
# --- Locators (priority order) ---
def by_id(self, auto_id, **kw):
"""AutomationId β most stable. Use as first choice."""
return self.window.child_window(auto_id=auto_id, **kw)
def by_name(self, name, **kw):
"""Visible text / accessible name."""
return self.window.child_window(title=name, **kw)
def by_class(self, cls, index=0, **kw):
"""Control class + index β fragile, avoid if possible."""
β¦
Pertanyaan umum
Apakah saya bisa menggunakan ini untuk menguji situs web?
Tidak. Alat ini hanya untuk program yang terpasang di Windows. Untuk situs web, gunakan alat pengujian browser.
Apakah saya harus menjadi programmer berpengalaman untuk menggunakannya?
Tidak perlu. Alat ini dirancang agar sederhana dan membantu mengotomatisasi tugas pengujian yang sebelumnya membutuhkan pengetahuan teknis yang mendalam.
Apa itu 'UI Automation'?
Itu adalah teknologi Windows yang memungkinkan program (dan alat pengujian) memahami dan berinteraksi dengan elemen visual program lain, seperti tombol dan kotak teks.
Detail
Deskripsi asli dari pembuat
E2E testing for Windows native desktop apps (WPF, WinForms, Win32/MFC, Qt) using pywinauto and Windows UI Automation. Use when writing E2E tests for a Windows native desktop app with pywinauto or UI Automation.
repo: affaan-m/ECC
Popularitas
- Bintang GitHub
- 280k
- Peringkat
- #435
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
accessibility
280kMembantu agent Anda membuat antarmuka yang ramah untuk semua orang. Memastikan website dan aplikasi tetap bisa dipakai penyandang disabilitas, seperti tunanetra.
agent-architecture-audit
280kMembuat agent Anda memeriksa apakah semuanya berjalan dengan benar. Agent akan menemukan dan memperbaiki masalah pada sistem AI agar bekerja sesuai harapan.
agent-eval
280kMembantu agent Anda membandingkan berbagai alat coding AI. Mengukur mana yang lebih cepat, lebih murah, dan lebih andal untuk tugas tertentu.
agent-harness-construction
280kMembuat agent Anda lebih memahami cara menyelesaikan tugas. Agent mengoptimalkan alat dan instruksi yang digunakan agar peluang berhasilnya lebih besar.
Skill serupa
test-driven-development
311kMengajari agent Anda menulis tes yang gagal dulu, melihatnya gagal, lalu menulis kode terkecil yang lulus, sebelum membangun fitur atau perbaikan apa pun.
verification-before-completion
311kMengajari agent Anda menjalankan pemeriksaan nyata dan membaca keluarannya sebelum menyatakan tugas, perbaikan, atau build sudah selesai atau lulus.
migrate-to-shoehorn
310kMengganti type cast berisiko di file tes Anda dengan pustaka shoehorn, sehingga tes bisa memakai data parsial dan tetap lulus pemeriksaan tipe.