E2E Testing

E2E testing for any desktop app

Test desktop applications end-to-end, including Citrix virtual apps, remote desktop sessions, and legacy software. Works with any GUI technology—no source code access required.

invoice.test.ts
import {
    mouse, Button, keyboard, Key, straightTo, centerOf, getActiveWindow
} from "@nut-tree/nut-js";
import { useElementInspector } from "@nut-tree/element-inspector";
import { elements } from "@nut-tree/element-inspector/win";
import { describe, it, expect } from "vitest";

useElementInspector();

describe("Invoice Application", () => {
    it("should create a new invoice", async () => {
        const window = await getActiveWindow();

        // Click "New Invoice" button by its title
        const newBtn = await window.find(
            elements.button({ title: "New Invoice" })
        );
        await mouse.move(straightTo(centerOf(newBtn.region)));
        await mouse.click(Button.LEFT);

        // Find and fill the customer field
        const customerInput = await window.find(
            elements.textInput({ label: "Customer" })
        );
        await mouse.move(straightTo(centerOf(customerInput.region)));
        await mouse.click(Button.LEFT);
        await keyboard.type("Acme Corporation");

        // Save and verify
        await keyboard.pressKey(Key.LeftControl, Key.S);
        const successMsg = await window.find(
            elements.staticText({ title: "Invoice saved" })
        );
        expect(successMsg).toBeDefined();
    });
});

Solve your toughest testing challenges

nut.js tackles the desktop testing problems that other tools can't handle.

🏛️

Legacy Applications

Test apps with no API using UI elements, images, text OCR, or pixel colors

☁️

Citrix/Virtual Apps

Test applications running in Citrix, RDP, or VMware environments seamlessly

💻

Cross-Platform

Same test code runs on Windows, macOS, and Linux without modification

🔧

Technology Agnostic

Test any GUI framework: WinForms, WPF, Java Swing, Qt, Electron, and more

Citrix & Remote Desktop

Test applications in virtual environments

Many enterprise applications run in Citrix, VMware Horizon, or Windows Remote Desktop environments. Traditional automation tools struggle with these scenarios—nut.js doesn't.

Works with any remote desktop protocol

Citrix, RDP, VMware Horizon, VNC, and more

Same code for local and remote

Write once, test anywhere without modification

Visual recognition handles latency

Built-in wait mechanisms handle network delays

citrix-test.ts
import {
    screen, mouse, Button, straightTo, centerOf, imageResource
} from "@nut-tree/nut-js";

// Works identically whether app is local, in Citrix, or via RDP
async function testInCitrixEnvironment() {
    // Connect to Citrix session (handled by your Citrix client)
    await screen.waitFor(imageResource("citrix-desktop.png"));

    // Now test just like any other application
    const appIcon = await screen.find(imageResource("erp-icon.png"));
    await mouse.move(straightTo(centerOf(appIcon)));
    await mouse.doubleClick(Button.LEFT);

    // Wait for ERP to load
    await screen.waitFor(imageResource("erp-main-menu.png"), 30000);

    // Continue with your test...
    // The same code works for local apps, Citrix, RDP, VMware, etc.
}
jest.config.js
// jest.config.js - Works with Jest, Vitest, Mocha, etc.
module.exports = {
    testTimeout: 60000, // Desktop tests may need more time
    setupFilesAfterEnv: ["./setup.ts"],
};

// setup.ts
import { keyboard, mouse } from "@nut-tree/nut-js";

// Configure for natural, human-like interactions
keyboard.config.autoDelayMs = 50;
mouse.config.autoDelayMs = 100;
mouse.config.mouseSpeed = 1000;

Integrates with your existing workflow

nut.js works with the testing frameworks and CI/CD tools you already use. No need to change your workflow—just add desktop testing capabilities.

Jest
Vitest
Mocha
GitHub Actions
Jenkins
Azure DevOps
See Jest integration example

Start testing your desktop apps today

Add comprehensive E2E testing to your desktop applications in minutes. Works with any GUI technology, including Citrix and remote desktop environments.