1.0.8 • Published 10 months ago

@wix-pilot/detox v1.0.8

Weekly downloads
-
License
-
Repository
github
Last release
10 months ago

@wix-pilot/detox 📱

Detox driver for Wix Pilot - React Native testing with natural language

Overview

The @wix-pilot/detox package provides Detox integration for Wix Pilot, enabling:

  • React Native app testing
  • Native UI automation
  • Component-based testing
  • Cross-platform mobile testing

Installation

# npm
npm install --save-dev @wix-pilot/detox detox @wix-pilot/core

# yarn
yarn add -D @wix-pilot/detox detox @wix-pilot/core

Usage

1. Set up your LLM Handler

import { PromptHandler } from '@wix-pilot/core';

class CustomPromptHandler implements PromptHandler {
  async runPrompt(prompt: string, image?: string): Promise<string> {
    // Integrate with your preferred LLM service
    const response = await yourLLMService.complete({
      prompt,
      imageUrl: image, // Optional: for visual testing support
    });
    return response.text;
  }

  isSnapshotImageSupported(): boolean {
    return true; // Set to true if your LLM supports image analysis
  }
}

2. Create and Run Tests

import pilot from '@wix-pilot/core';
import { DetoxFrameworkDriver } from '@wix-pilot/detox';

describe('React Native App Testing', () => {
  beforeAll(async () => {
    pilot.init({
      driver: new DetoxFrameworkDriver(),
      promptHandler: new CustomPromptHandler(),
    });
  });

  beforeEach(() => pilot.start());
  afterEach(() => pilot.end());

  it('should handle login flow', async () => {
    await pilot.perform([
      'Launch the app',
      'Tap the "Login" button',
      'Enter "test@example.com" in the email field',
      'Enter "password123" in the password field',
      'Tap the "Submit" button',
      'The dashboard should be visible'
    ]);
  });
});

Related Packages

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.2

10 months ago

1.0.4

10 months ago

1.0.1

11 months ago

1.0.0

11 months ago