EEF / rules
Cursor rule21 starsChanged 2 months agoMITView on GitHub
End-to-end testing for Windows native desktop applications (WPF, WinForms, Win32/MFC, Qt 5/6) using pywinauto over the Windows UI Automation API. The native-automation driver that e2e-testing-edho-ferdian's Phase 0 detects as option 4 but has no content behind — journey mapping and the Page Object Model come from there; the pywinauto mechanics live here. Use when the target is a desktop .exe rather than a browser page, when a desktop GUI test suite is being set up or is flaky, or when adding AutomationIds to make an app testable. Trigger phrases: \"test aplikasi desktop\", \"pywinauto\", \"WPF/WinForms/Qt test\", \"UI Automation\", \"test .exe ini\".
- Installs packages
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository115 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/api-design-edho-ferdian.mdcCursor rule
- .cursor/rules/backend-engineering-edho-ferdian.mdcCursor rule
- .cursor/rules/billing-ops-edho-ferdian.mdcCursor rule
- .cursor/rules/build-fix-edho-ferdian.mdcCursor rule
- .cursor/rules/click-path-audit-edho-ferdian.mdcCursor rule
- .cursor/rules/code-quality-tooling-edho-ferdian.mdcCursor rule
- .cursor/rules/code-review-edho-ferdian.mdcCursor rule
- .cursor/rules/code-simplification-edho-ferdian.mdcCursor rule
- .cursor/rules/communications-triage-edho-ferdian.mdcCursor rule
- .cursor/rules/config-hygiene-edho-ferdian.mdcCursor rule
- .cursor/rules/container-ops-edho-ferdian.mdcCursor rule
- .cursor/rules/counterparty-comms-edho-ferdian.mdcCursor rule
- .cursor/rules/data-layer-patterns-edho-ferdian.mdcCursor rule
- .cursor/rules/dead-code-cleanup-edho-ferdian.mdcCursor rule
- .cursor/rules/deployment-ops-edho-ferdian.mdcCursor rule
- .cursor/rules/dev-kickoff-edho-ferdian.mdcCursor rule
- .cursor/rules/docs-sync-edho-ferdian.mdcCursor rule
- .cursor/rules/e2e-testing-edho-ferdian.mdcCursor rule
- .cursor/rules/frontend-engineering-edho-ferdian.mdcCursor rule
- .cursor/rules/gan-harness-edho-ferdian.mdcCursor rule
- .cursor/rules/git-and-release-ops-edho-ferdian.mdcCursor rule
- .cursor/rules/language-code-review-edho-ferdian.mdcCursor rule
- .cursor/rules/legal-ops-edho-ferdian.mdcCursor rule
- .cursor/rules/marketing-edho-ferdian.mdcCursor rule
- .cursor/rules/networking-ops-edho-ferdian.mdcCursor rule
- .cursor/rules/opensource-release-edho-ferdian.mdcCursor rule
- .cursor/rules/performance-audit-edho-ferdian.mdcCursor rule
- .cursor/rules/research-ops-edho-ferdian.mdcCursor rule
- .cursor/rules/safe-execution-edho-ferdian.mdcCursor rule
- .cursor/rules/security-review-edho-ferdian.mdcCursor rule
- .cursor/rules/seo-audit-edho-ferdian.mdcCursor rule
- .cursor/rules/skill-audit-edho-ferdian.mdcCursor rule
- .cursor/rules/skill-authoring-edho-ferdian.mdcCursor rule
- .cursor/rules/spec-mining-edho-ferdian.mdcCursor rule
- .cursor/rules/system-design-edho-ferdian.mdcCursor rule
- .cursor/rules/test-authoring-edho-ferdian.mdcCursor rule
- .cursor/rules/video-style-edho-ferdian.mdcCursor rule
- api-design-edho-ferdianSkill
- backend-engineering-edho-ferdianSkill
- billing-ops-edho-ferdianSkill
- build-fix-edho-ferdianSkill
- click-path-audit-edho-ferdianSkill
- code-quality-tooling-edho-ferdianSkill
- code-review-edho-ferdianSkill
- code-simplification-edho-ferdianSkill
- communications-triage-edho-ferdianSkill
- config-hygiene-edho-ferdianSkill
- container-ops-edho-ferdianSkill
- counterparty-comms-edho-ferdianSkill
- data-layer-patterns-edho-ferdianSkill
- dead-code-cleanup-edho-ferdianSkill
- deployment-ops-edho-ferdianSkill
- desktop-e2e-edho-ferdianSkill
- dev-kickoff-edho-ferdianSkill
- docs-sync-edho-ferdianSkill
- e2e-testing-edho-ferdianSkill
- frontend-engineering-edho-ferdianSkill
- gan-harness-edho-ferdianSkill
- The first 60 shown.
The file
We split this desktop-e2e-edho-ferdian.mdc into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
All four are driver-agnostic and apply unchanged here — do not restate or fork them.
- Very specific: line 62
If UIA is unreachable, or the target turns out to be Electron/WebView2, stop and say so — report VERIFIED: NO — no usable native automation …
- Distinctive: line 116
Redact typed text in traces: Never enable trace text capture on a login or payment flow.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: "End-to-end testing for Windows native desktop applications (WPF, WinForms, Win32/MFC, Qt 5/6) using pywinauto over the Windows UI Automation API. The native-automation driver that e2e-testing-edho-ferdian's Phase 0 detects as option 4 but has no content behind — journey mapping and the Page Object Model come from there; the pywinauto mechanics live here. Use when the target is a desktop .exe rather than a browser page, when a desktop GUI test suite is being set up or is flaky, or when adding AutomationIds to make an app testable. Trigger phrases: \"test aplikasi desktop\", \"pywinauto\", \"WPF/WinForms/Qt test\", \"UI Automation\", \"test .exe ini\"."
globs:
alwaysApply: false
---
# Desktop E2E (Windows) — Edho Ferdian Mode
## Where this sits
`e2e-testing-edho-ferdian` owns the *process*: Phase 1 journey mapping,
Phase 2 Page Object Model, Phase 3 flake quarantine, Phase 4 artifact capture.
All four are driver-agnostic and apply unchanged here — do not restate or fork
them. This skill supplies only what changes when the driver is native Windows
automation instead of a browser:
| Concept | Browser (Playwright) | Here (pywinauto + UIA) |
|---|---|---|
| Locator | role / `data-testid` / CSS | AutomationId → Name → ClassName+index |
| Wait | auto-waiting locators | `spec.wait("visible")` / `wait_until(...)` |
| Artifact | screenshot / video / trace | window capture / ffmpeg `gdigrab` / step trace |
| Isolation | browser context | fresh process + redirected `APPDATA`/`TEMP` |
**Not for:** web apps (use Playwright), Electron/CEF/WebView2 (the HTML layer
needs browser automation, UIA only sees the shell), mobile, or anything that
does not need a running GUI.
## How it works
Everything routes through Windows UI Automation, an accessibility API built
into Windows. Each UI framework ships a UIA provider of varying quality:
```
pytest → pywinauto (uia backend) → Windows UI Automation API → app's UIA provider → running .exe
```
| Framework | AutomationId source | Reliability |
|---|---|---|
| WPF | `x:Name` maps directly | Excellent |
| UWP / WinUI 3 | native | Excellent |
| Qt 6.x | `setAccessibleName`; accessibility on by default | Excellent |
| WinForms | `AccessibleName` | Good |
| Qt 5.15+ | needs `QT_ACCESSIBILITY=1` | Good |
| Qt 5.7–5.14 | needs `QT_ACCESSIBILITY=1`; manual objectName | Fair |
| Win32 / MFC | resource control IDs appear as numeric strings | Fair |
## Phase 0′ — Environment check (before anything else)
```bash
pip install pywinauto pytest pytest-html pytest-timeout Pillow
```
```python
from pywinauto import Desktop
Desktop(backend="uia").windows() # must list top-level windows
```
Install **Accessibility Insights for Windows** (free, Microsoft) — it is the
DevTools equivalent for this stack. Inspect the UIA tree there *before*
writing a locator; guessing at AutomationIds is the main time sink here.
If UIA is unreachable, or the target turns out to be Electron/WebView2, stop
and say so — report `VERIFIED: NO — no usable native automation driver`, the
same convention the rest of this ecosystem uses. Never fabricate a run.
## Testability first
The single highest-leverage action is giving every interactive control a
stable AutomationId **before** writing tests. Per framework:
- **WPF** — `x:Name="btnLogin"` in XAML; nothing else needed.
- **WinForms** — `btnLogin.AccessibleName = "btnLogin";`
- **Qt** — set both, via one helper, and centralize the string constants in a
header so tests and app cannot drift:
```cpp
void setTestId(QWidget* w, const char* id) {
w->setObjectName(id);
w->setAccessibleName(id); // becomes the UIA Name property
}
```
- **Win32 / MFC** — resource IDs surface as numeric AutomationId strings;
prefer `SetWindowText` for a readable Name.
A test suite written against `ClassName + index` because the app has no
AutomationIds will be rewritten within a release. Fixing testability in the app
is cheaper than the flakiness it prevents — say so when the app owner resists.
## References
- **`references/pywinauto-harness.md`** — the Page Object base class, locator
priority, wait patterns, artifact capture, the opt-in per-step trace, and the
flaky-cause table.
- **`references/isolation-and-ci.md`** — the three isolation tiers (tmp_path
env redirect / Job Object / Windows Sandbox), hang prevention, and the GitHub
Actions `windows-latest` workflow.
- **`references/qt-and-fallback.md`** — Qt-specific quirks (combo popups,
dialogs as top-level windows, table cells, self-drawn widgets) and the
screenshot-matching fallback with its DPI rules.
## Language routing (fixed — see skill-authoring-edho-ferdian's canonical contract)
Communication to the user in Bahasa Indonesia; test code, page-object names,
and assertions in English — fixed, never ask. Full contract:
`skill-authoring-edho-ferdian` §7.
## Global rules
1. **AutomationId first, always.** Name second, ClassName+index only when
forced, coordinates never as a primary strategy.
2. **Never `time.sleep()` as synchronization.** `wait_visible` / `wait_gone` /
`wait_until` exist for exactly this.
3. **Fresh process per test.** A session-scoped app fixture leaks state between
tests and turns every failure into an archaeology exercise.
4. **Assert content and state, never pixel geometry.** `lblStatus == "Logged
in"` is a test; `btn.rectangle().left == 120` is a trap.
5. **Redact typed text in traces.** Never enable trace text capture on a login
or payment flow.
6. **Quarantine, don't delete** — the protocol in
`e2e-testing-edho-ferdian/references/flake-quarantine.md` applies verbatim;
the Python spelling is `@pytest.mark.skip(reason="...")` /
`@pytest.mark.skipif(os.environ.get("CI") == "true", reason="...")`.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

