Skip to content

feat: CrabNebula support#122

Merged
goosewobbler merged 2 commits intomainfrom
feat/crabnebula-support
Feb 3, 2026
Merged

feat: CrabNebula support#122
goosewobbler merged 2 commits intomainfrom
feat/crabnebula-support

Conversation

@goosewobbler
Copy link
Contributor

@goosewobbler goosewobbler commented Jan 29, 2026

Tauri service support for https://crabnebula.dev

Fixes #101 & #93

TODO:

  • CN E2E testing (if possible)
  • Docs

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

This PR adds comprehensive support for CrabNebula's commercial Tauri WebDriver solution, enabling macOS testing (previously unsupported) and providing an npm-based driver alternative to cargo installation.

Key Changes

  • CrabNebula Backend Management: New crabnebulaBackend.ts module manages the test-runner-backend process lifecycle with proper startup detection, health checks, and graceful shutdown
  • Driver Provider Abstraction: driverManager.ts now supports both 'official' (cargo) and 'crabnebula' (npm) driver providers with automatic detection from node_modules
  • macOS Platform Support: Platform validation enforces CrabNebula requirement for macOS, preventing unsupported configuration attempts
  • Configuration Options: Added driverProvider, crabnebulaDriverPath, crabnebulaManageBackend, and crabnebulaBackendPort options to both service and global configuration
  • Plugin Validation: New pluginValidator.ts utility checks for required tauri-plugin-automation in Cargo.toml and validates debug builds
  • Comprehensive Documentation: Added setup guide, configuration examples, and updated platform support matrix

The implementation follows existing patterns for process management and includes proper error handling, timeout mechanisms, and test coverage.

Confidence Score: 4/5

  • Safe to merge with one minor suggestion - the implementation is well-structured with proper error handling and comprehensive tests
  • The code quality is high with proper process management, error handling, and extensive test coverage. The changes are additive and don't break existing functionality. One minor improvement suggested for the console.log debugging statements.
  • packages/tauri-service/src/launcher.ts has debug console.log statements that should be removed before production

Important Files Changed

Filename Overview
packages/tauri-service/src/crabnebulaBackend.ts New file managing CrabNebula test-runner-backend lifecycle with proper process management, ready detection, and graceful shutdown
packages/tauri-service/src/driverManager.ts Added CrabNebula driver detection and management functions, supporting both npm and cargo-based driver installation paths
packages/tauri-service/src/launcher.ts Integrated CrabNebula backend lifecycle, added macOS platform validation, and implemented backend startup/shutdown logic
packages/tauri-service/src/pluginValidator.ts New utility for checking tauri-plugin-automation installation and debug build validation via Cargo.toml inspection
packages/tauri-service/src/types.ts Added CrabNebula-specific configuration options for driver provider, backend management, and port configuration
packages/native-types/src/tauri.ts Added CrabNebula configuration types to public API for driver provider selection and backend management options

Sequence Diagram

sequenceDiagram
    participant Test as Test Suite
    participant Launcher as TauriLaunchService
    participant DM as DriverManager
    participant Backend as test-runner-backend
    participant Driver as tauri-driver
    participant App as Tauri App

    Note over Test,App: CrabNebula macOS Testing Flow

    Test->>Launcher: onPrepare()
    Launcher->>Launcher: Check platform (macOS)
    Launcher->>Launcher: Validate driverProvider='crabnebula'
    Launcher->>DM: findTestRunnerBackend()
    DM-->>Launcher: backend path
    Launcher->>DM: findCrabNebulaDriver()
    DM-->>Launcher: driver path
    
    Note over Launcher,Backend: Start Backend Process
    Launcher->>Backend: startTestRunnerBackend(port=3000)
    Backend-->>Launcher: Process spawned
    Launcher->>Backend: waitTestRunnerBackendReady()
    Backend-->>Launcher: Health check OK
    Launcher->>Launcher: Set REMOTE_WEBDRIVER_URL env var

    Note over Launcher,Driver: Start Driver Process
    Launcher->>Driver: spawn tauri-driver
    Driver-->>Launcher: Process started
    
    Test->>Launcher: onWorkerStart(cid)
    Launcher->>Launcher: diagnoseEnvironment()
    Launcher-->>Test: Ready for testing

    Note over Test,App: Test Execution
    Test->>Driver: WebDriver commands
    Driver->>Backend: Forward to backend
    Backend->>App: Control app via automation
    App-->>Backend: Response
    Backend-->>Driver: Response
    Driver-->>Test: Test results

    Test->>Launcher: onComplete()
    Launcher->>Driver: Kill SIGTERM
    Driver-->>Launcher: Graceful shutdown
    Launcher->>Backend: stopTestRunnerBackend()
    Backend-->>Launcher: Process stopped
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 29, 2026

Additional Comments (1)

packages/tauri-service/src/launcher.ts
remove debug console.log statements

    // Ensure driver is available
    const workerOptions = options ?? mergeOptions(this.options, undefined);
    log.debug(`[worker-${workerId}] Worker options: ${JSON.stringify(workerOptions, null, 2)}`);

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/tauri-service/src/launcher.ts
Line: 703:708

Comment:
remove debug console.log statements

```suggestion
    // Ensure driver is available
    const workerOptions = options ?? mergeOptions(this.options, undefined);
    log.debug(`[worker-${workerId}] Worker options: ${JSON.stringify(workerOptions, null, 2)}`);
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

@goosewobbler
Copy link
Contributor Author

Additional Comments (1)

packages/tauri-service/src/launcher.ts remove debug console.log statements

    // Ensure driver is available
    const workerOptions = options ?? mergeOptions(this.options, undefined);
    log.debug(`[worker-${workerId}] Worker options: ${JSON.stringify(workerOptions, null, 2)}`);

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI

These are debug logs which only show up when the WDIO config log level is set to debug, they're fine.

@goosewobbler goosewobbler force-pushed the feat/crabnebula-support branch from eb664e7 to 88896cd Compare February 2, 2026 13:53
@goosewobbler goosewobbler changed the title feat: crabnebula support feat: CrabNebula support Feb 3, 2026
@goosewobbler goosewobbler merged commit e4ba553 into main Feb 3, 2026
135 of 136 checks passed
@goosewobbler goosewobbler deleted the feat/crabnebula-support branch February 3, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tauri Service - CrabNebula support

1 participant