Skip to main content

Agent tool for controlling desktop app WebViews via Chrome DevTools Protocol (CDP) and WebDriver

Project description

NomoE2E

Control WebViews in desktop applications through a unified API, supporting both CDP and WebDriver protocols

Python 3.13+ License: Apache 2.0 Version: v0.9.1

๐ŸŽฏ Project Goals

Provide AI Agents with a practical, scalable, and cross-platform consistent desktop WebView automation capability.

  • ๐Ÿ”— Dual Protocol Support: Automatic switching between CDP and WebDriver.
  • ๐Ÿ–ฑ๏ธ Unified API: click, type_text, screenshot, execute_script, etc.
  • โœ… Out of the Box: Built on Playwright, no need to worry about protocol differences.
  • ๐Ÿ“ธ Observability: Error collection, diagnostic snapshots, screenshots.
  • ๐Ÿš€ Global Installation: Like npm, install with one command and use anywhere.

๐Ÿ“ฆ Supported Scenarios

Environment Protocol Description
Electron CDP Use --remote-debugging-port
Windows WebView2 CDP Enable remote debugging
Tauri (tauri-plugin-webdriver) WebDriver Standard WebDriver endpoint

๐Ÿš€ Quick Start

Installation (Recommended)

# Install globally with uv (like npm i -g)
uv tool install -e .
# or Install from PyPI
uv tool install nomo_e2e

# After installation, use directly from any directory
nomo-e2e --help

Or use pip

# Install from source
pip install -e .

# Or from PyPI (after release)
pip install nomo-e2e

Install Playwright Browser Driver

# Required for CDP/WebDriver connection
playwright install chromium

CLI Quick Start

# CDP mode (Electron/WebView2) - Auto-detects CDP endpoints
nomo-e2e open http://localhost:9222
nomo-e2e snapshot
nomo-e2e click "#login"
nomo-e2e fill "#username" "admin"
nomo-e2e screenshot --filename result.png

# WebDriver mode (Tauri2) - Requires --driver flag
nomo-e2e open --driver webdriver http://localhost:4445
nomo-e2e click "button.submit"
nomo-e2e eval "document.title"

# View all commands
nomo-e2e --help

For the complete CLI command reference, see the Skills Package.

Python API

from nomo_e2e import WebViewController

# CDP mode (Electron/WebView2) - Auto-detect
controller = WebViewController.connect("http://localhost:9222")

# Or specify driver explicitly
controller = WebViewController.connect(
    "http://localhost:9222",
    driver="cdp"
)

# WebDriver mode (Tauri)
controller = WebViewController.connect(
    "http://127.0.0.1:4445",
    driver="webdriver"
)

# Perform actions
controller.click("#submit-btn")
controller.type_text("#username", "admin")
controller.screenshot("/tmp/page.png")

# Get page info
print(controller.title)
print(controller.url)

# Diagnostic snapshot
snapshot = controller.diagnostics_snapshot()

# Disconnect
controller.disconnect()

Using Context Manager

from nomo_e2e import WebViewController

# Automatic connection lifecycle management
with WebViewController.connect("http://localhost:9222") as controller:
    controller.click("#login")
    controller.type_text("#username", "admin")
    controller.screenshot("./login.png")
# Automatically disconnected

๐Ÿ”ง Environment Configuration

Enable CDP for Electron

Electron apps only need to add the --remote-debugging-port parameter at startup to enable the CDP debugging port.

Startup command:

# macOS/Linux
npx electron . --remote-debugging-port=9222

# Windows
.\node_modules\.bin\electron . --remote-debugging-port=9222

Configure in package.json:

{
  "scripts": {
    "start:dev": "electron . --remote-debugging-port=9222"
  }
}

Verify CDP port:

# Check if port is open
lsof -i :9222

# Or access the debug endpoint
curl http://localhost:9222/json

E2E test connection:

# Auto-detect CDP
nomo-e2e open http://localhost:9222

# Or specify explicitly
nomo-e2e open --driver cdp http://localhost:9222

Enable WebDriver for Tauri2

Tauri2 requires installing the tauri-plugin-webdriver plugin and enabling the WebDriver endpoint.

1. Install the Plugin

# Add plugin (interactive)
cd your-tauri-app
cargo tauri add webdriver

# Or manually add dependency to Cargo.toml
[dependencies]
tauri-plugin-webdriver = "2"

2. Configure the Plugin

src-tauri/src/lib.rs:

use tauri_plugin_webdriver::init;

fn run() {
    tauri::Builder::default()
        .plugin(init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

3. Configure Permissions

src-tauri/capabilities/main.json:

{
  "permissions": [
    "core:default",
    "webdriver:default"
  ]
}

4. Start Dev Server

Tauri2 dev mode automatically enables the WebDriver endpoint:

# Start dev server (default port 4445)
cd your-tauri-app
cargo tauri dev

# Or specify port
WEBDRIVER_PORT=4445 cargo tauri dev

Note: WebDriver port is only enabled in debug/dev builds, release builds will not expose it.

5. Verify WebDriver Endpoint

# Check if endpoint is ready
curl http://127.0.0.1:4445/status

# Expected response
# {"value":{"ready":true,"message":"Ready."}}

6. E2E Test Connection

nomo-e2e open --driver webdriver http://localhost:4445

Quick Reference Table

Application Protocol Startup Parameter Endpoint URL Auto-detect
Electron CDP --remote-debugging-port=9222 http://localhost:9222 โœ…
Tauri2 WebDriver cargo tauri dev (auto) http://127.0.0.1:4445 โŒ
WebView2 CDP --remote-debugging-port=9222 http://localhost:9222 โœ…

๐Ÿ“ Project Structure

nomo-e2e/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ nomo_e2e/
โ”‚       โ”œโ”€โ”€ __init__.py          # Public exports
โ”‚       โ”œโ”€โ”€ controller.py        # Unified controller
โ”‚       โ”œโ”€โ”€ adapters/            # Protocol adapters
โ”‚       โ”‚   โ”œโ”€โ”€ base.py         # Abstract base class
โ”‚       โ”‚   โ”œโ”€โ”€ cdp.py          # CDP adapter
โ”‚       โ”‚   โ””โ”€โ”€ webdriver.py    # WebDriver adapter
โ”‚       โ”œโ”€โ”€ cli/                 # CLI commands
โ”‚       โ”œโ”€โ”€ exceptions.py        # Exception definitions
โ”‚       โ”œโ”€โ”€ models.py            # Data models
โ”‚       โ””โ”€โ”€ skills/              # Skills package
โ”‚           โ””โ”€โ”€ nomo_e2e_skills/
โ”‚               โ”œโ”€โ”€ SKILL.md     # Main skill package
โ”‚               โ””โ”€โ”€ references/   # Reference docs
โ”œโ”€โ”€ tests/                      # Tests
โ”œโ”€โ”€ INSTALL.md                  # Installation guide
โ”œโ”€โ”€ ROADMAP.md                 # Development roadmap
โ””โ”€โ”€ AGENTS.md                  # AI development guidelines

๐Ÿ“– Documentation

Document Description
INSTALL.md Detailed installation and usage guide
src/nomo_e2e_skills/ Skills package (for LLM Agents)
ROADMAP.md Development roadmap and milestones
AGENTS.md AI development guidelines

๐Ÿ”ง Development

# Install dev dependencies
uv sync

# Code linting
uv run ruff check src/ tests/

# Code formatting
uv run ruff format src/ tests/

# Run tests
uv run pytest tests/ -v

# Type checking
uv run mypy src/

โš ๏ธ Notes

  • WebDriver port is only allowed in debug/dev builds
  • Electron's --remote-debugging-port can be used in any build
  • CDP endpoints (like localhost:9222) are auto-detected as CDP protocol
  • WebDriver endpoints require --driver webdriver flag
  • Ensure you have proper authorization before using on any application
  • Some applications may have anti-debugging mechanisms

๐Ÿ“ License

Apache License 2.0 - see LICENSE for details.

Copyright (c) 2026 NomoAiT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nomo_e2e-0.9.2.tar.gz (62.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nomo_e2e-0.9.2-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file nomo_e2e-0.9.2.tar.gz.

File metadata

  • Download URL: nomo_e2e-0.9.2.tar.gz
  • Upload date:
  • Size: 62.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nomo_e2e-0.9.2.tar.gz
Algorithm Hash digest
SHA256 cf2bcb15019dcff440250c301f8e8776a93bdf50ca409ee5fbe2937c8ce6a720
MD5 4ad3413cc30e4479da0cf3c9e5c69452
BLAKE2b-256 8667fae6e713ec40758b83abaf100bd13576ef89fb6f95e0a014d19fa5da303a

See more details on using hashes here.

File details

Details for the file nomo_e2e-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: nomo_e2e-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nomo_e2e-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6d782034119d7009fcd6e8c7f4022a51bfd4e51a7692ba8150fe7904a7bac1f
MD5 13d3c8507c58479054f0a0845261ba84
BLAKE2b-256 ec8aff92d9a47041d2333fc1fe6bf02b2244573814be9a6cfdd9d9349d862679

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page