From qa-desktop
Legacy reference for Spectron - Electron's original ChromeDriver-based testing framework, officially deprecated 2022-02-01 at v19.0.0. Documents what Spectron was, the architectural reason it became unmaintainable, the migration path to Playwright `_electron`, and the residual support contract for projects still on Spectron. Use only when auditing a legacy suite or planning a migration off Spectron - for new work use `electron-playwright` in this plugin.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qa-desktop:electron-spectronThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Spectron was a Node.js library that drove Electron applications
Spectron was a Node.js library that drove Electron applications
through ChromeDriver + the legacy WebDriverIO API. It shipped from
the official electron-userland org and was - for several years -
the only sanctioned end-to-end driver for Electron apps.
Per the Spectron repository:
"Spectron is officially deprecated as of February 1, 2022."
The final release was v19.0.0 (published 2022-02-02), pinned to
Electron ^19.0.0 (spectronrepo). The repository is
archived read-only with 233 open issues and 31 unmerged pull
requests as of the deprecation snapshot (spectronrepo).
This skill is a pure reference. There are no "run these commands" steps because no new project should start on Spectron.
For new projects: stop here and read electron-playwright in this
plugin instead.
The Spectron repository announcement itself does not enumerate reasons (spectronrepo), but the architectural context is observable from the surrounding ecosystem at the deprecation moment:
Per Electron's official tutorial, the three current recommendations are:
| Tool | Approach |
|---|---|
| Playwright | _electron.launch() returns an ElectronApp handle; expose main-process modules via electronApp.evaluate(...) |
| WebdriverIO (WDIO) | npm init wdio@latest ./ → wizard asks "Desktop Testing - of Electron Applications" |
| Selenium | WebDriver API bindings; lower-level than the above |
Playwright is the de-facto replacement most projects migrate to -
see electron-playwright in this plugin for the implementation
SKILL.
For pattern-recognition during a migration audit, Spectron tests followed this shape:
// Legacy Spectron — DO NOT use for new code
const Application = require('spectron').Application;
const app = new Application({
path: '/path/to/electron/MyApp.app/Contents/MacOS/MyApp',
});
before(async () => {
await app.start();
});
after(async () => {
if (app && app.isRunning()) {
await app.stop();
}
});
it('opens a window', async () => {
const count = await app.client.getWindowCount();
assert.strictEqual(count, 1);
});
The equivalent in modern Playwright _electron (per
electrontest):
// Modern replacement
const { _electron: electron } = require('playwright');
let electronApp;
beforeAll(async () => {
electronApp = await electron.launch({ args: ['.'] });
});
afterAll(async () => {
await electronApp.close();
});
test('opens a window', async () => {
const windowCount = electronApp.windows().length;
expect(windowCount).toBe(1);
});
See electron-playwright in this plugin for the full Playwright
_electron authoring + running + CI workflow.
A Spectron-to-Playwright migration touches:
| Spectron concept | Playwright _electron replacement |
|---|---|
new Application({ path }) | electron.launch({ args: ['.'] }) (electrontest) |
app.start() / app.stop() | electronApp.launch() / electronApp.close() |
app.client.<webdriver-method> | page = await electronApp.firstWindow(); then standard page.<method> (electrontest) |
app.browserWindow.<method> (sync RPC into main process) | electronApp.evaluate(({ BrowserWindow }) => { … }) - typed handle (electrontest) |
Window counting via app.client.getWindowCount() | electronApp.windows().length |
| ChromeDriver binary lifecycle | Implicit - Playwright bundles Chromium and exposes packaged-app launch directly |
Plan migration test-file-by-test-file, not big-bang. Per Step 7
of the migration playbook (kept implicit here - see your project's
test-strategy doc): tag each file as migrated, run both suites in
CI until the Spectron set is empty, then delete spectron from
package.json.
If a project must remain on Spectron in the short term:
spectron: 19.0.0 (the final release per
spectronrepo) and electron: ^19.0.0. Newer
Electron versions will break.| Anti-pattern | Why it fails | Fix |
|---|---|---|
| Starting a new Electron test project on Spectron in 2026 | Archived; no Electron 20+ support | Use electron-playwright |
| "Just upgrade Electron" without migrating off Spectron | Spectron pinned to Electron 19; newer Electron breaks Spectron's ChromeDriver bridge | Migrate to Playwright _electron |
| Big-bang Spectron → Playwright migration in one PR | High risk; no fall-back if behaviour differs | File-by-file migration with both suites green |
| Patching the archived Spectron repository upstream | Repository is read-only; PRs aren't being merged (spectronrepo) | Fork; or invest the same effort into migration |
| Citing Spectron's deprecation as the only reason to migrate | Stakeholders ask "but it still works" | Cite (1) Electron-version lock, (2) no security updates, (3) no support - all in the deprecation notice (spectronrepo) |
app.electron.<…>)
doesn't have a 1:1 mapping to Playwright's
electronApp.evaluate() for every case - some tests need a
small refactor.wdio-electron-service may be a
better migration target than Playwright _electron. This SKILL
documents the Playwright path because it's the most common
successor; WDIO path is out of scope.electron-playwright.desktop-test-strategy-reference (this plugin)
describes the Electron-renderer + Electron-main two-surface
architecture that made ChromeDriver-only drivers like Spectron
structurally insufficient.npx claudepluginhub testland/qa --plugin qa-desktopGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.