Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

Run Sherlo

1.0.12

Run Sherlo

play

Run Sherlo

This is an action that uploads provided iOS & Android builds to Sherlo and starts a test run

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Run Sherlo

uses: sherlo-io/[email protected]

Learn more about this action in sherlo-io/sherlo

Choose a version

Sherlo Monorepo

Welcome to the Sherlo Monorepo, your comprehensive solution for integrating visual testing into your React Native projects. Sherlo streamlines the visual testing process, offering seamless integration with Storybook for React Native, automation through a CLI tool, and GitHub Actions for CI/CD pipelines.

Quick Guide

To integrate Sherlo with your React Native app and run tests via CLI or GitHub Actions, ensure you follow these steps:

Prerequisites

  • Ensure you have Storybook for React Native configured in your project. Sherlo requires Storybook version >=7.6.15. Sherlo integrates with Storybook but does not operate independently.

Step 1: Integrate with Storybook

  1. Install @sherlo/react-native-storybook to enable Sherlo's visual testing with Storybook in your React Native application.

    yarn add @sherlo/react-native-storybook
  2. Wrap Your Application with withStorybook to toggle between your app and Storybook based on Sherlo's testing environment.

    // App.tsx
    import { withStorybook } from '@sherlo/react-native-storybook';
    import StorybookUIRoot from './.storybook';
    
    export default withStorybook(AppRoot, StorybookUIRoot);
  3. Configure Storybook with withSherlo for development or testing modes, enabling control over the testing process.

    // .storybook/index.tsx
    import { withSherlo } from '@sherlo/react-native-storybook';
    import StorybookUI from './storybook';
    
    export default withSherlo(StorybookUI, {
      /* Configuration options */
    });

Step 2: Configure sherlo.config.ts

  1. Obtain a Project Token by signing up for early access at Sherlo.io.

  2. Set Up Your Configuration File, specifying your project token, devices, and app information.

    // sherlo.config.ts
    import { Config } from '@sherlo/react-native-storybook';
    
    const config: Config = {
      projectToken: 'your_project_token_here',
      android: {
        path: 'path/to/android/app.apk',
        packageName: 'com.yourapp.package',
        devices: [
          /* Your Android Devices Here */
        ],
      },
      ios: {
        path: 'path/to/ios/app.tar.gz',
        bundleIdentifier: 'your.ios.bundle.identifier',
        devices: [
          /* Your iOS Devices Here */
        ],
      },
    };
    
    export default config;

Step 3: Running Tests

  • Manually with CLI: Install @sherlo/cli and run it in your project directory to upload builds and start tests.

    yarn global add @sherlo/cli
    npx @sherlo/cli
  • Automate with GitHub Actions: Use @sherlo/sherlo-action in your .github/workflows to automate the testing process in your CI/CD pipeline.

Packages

Example

Contribution

Contributions are welcome! Please fork the repository, make your changes, and submit a pull request. For major changes, open an issue first to discuss what you would like to change.

License

Sherlo is released under the MIT License. See the LICENSE file in each package for more details.