Testing Windows desktop apps has long been one of the most requested features from customers, because no one had infrastructure to run thousands of these tests in parallel each month. Web testing is comparatively easy: a headless browser starts in a Linux container in seconds, costs a fraction of a cent, and is discarded when the test ends. Windows desktop testing has no equivalent. Every test needs a full virtual machine, since Windows containers lack a graphical desktop. A cold Windows VM takes 2 to 3 minutes to boot, and someone must be logged in, because Windows UI Automation only works inside an active desktop session. Machines also retain installed files, registry keys, user profiles and saved logins between runs, while each app brings its own installers, admin prompts and first-run dialogs. Remote Windows machines offer no built-in traces, logs or screenshots, and most test infrastructure was designed around Linux.
The team's answer was to treat Windows machines like phones: a device that one test claims, uses once, and throws away. The architecture borrows from its mobile testing infrastructure. A custom device scheduler in Kubernetes hands out a Windows VM on Google Compute Engine through a Device Claim, and the test controls it remotely with WebdriverIO and Appium. Two extensions to the device model were needed: devices can live outside the cluster, and claims can return desktop connection addresses, including CDP for browsers.
The system has three parts: a controller that maintains a warm pool of Windows VMs, a Linux runner pod that executes the test code, and the Windows VM itself, which runs the app under test and a small desktop agent. The runner connects over Playwright's CDP for browser content, Appium for native apps, and a WebRTC stream that lets people watch tests live and review recordings afterward.
Each VM is disposable. Nobody logs in, patches it or keeps it running for weeks, and a fresh machine replaces each one after use.
Source: Hacker News · Summarized by HeadlinesBriefing