Skip to main content
Beta Feature — Browser automation is currently in beta. Please report any issues to founders@morphllm.com.
Automatically test your preview deployments with Morph’s AI-powered browser automation. When a PR is opened, Morph tests your preview URL and posts results directly to the PR as a comment.

Quick Start

You can also tag @morph or @glance in a PR comment to trigger a test without any CI config.

Setup

1

Install the Morph GitHub App

Go to morphllm.com/dashboard/integrations/github and install the app on your repository. This allows Morph to post test results as PR comments.
2

Get your API key

Get your API key from morphllm.com/dashboard/api-keys.
3

Add secrets to your repository

Go to your repository’s Settings → Secrets and variables → Actions and add:

Inputs & Outputs

Inputs

Outputs

Testing with Credentials

For apps that require login, pass credentials via GitHub secrets and reference them in your instructions using x_user and x_pass placeholders.
Never hardcode credentials in your workflow file. Always use GitHub secrets and environment variables.

Setting Up Test Credentials

  1. Go to Settings → Secrets and variables → Actions
  2. Add repository secrets:
    • TEST_USERNAME - Test account email/username
    • TEST_PASSWORD - Test account password
    • ADMIN_USERNAME - Admin test account (if needed)
    • ADMIN_PASSWORD - Admin test password (if needed)

Testing Multiple User Roles

Test different user types by running parallel jobs with different credentials:

Testing Multiple Flows

Run comprehensive test suites by testing different user journeys:

Platform Integrations

Vercel

Netlify

Railway

Custom Infrastructure (EKS, GKE, Self-hosted)

Handling Third-Party Auth (Clerk, Auth0, Supabase)

Third-party auth providers may block automated browsers. Solutions:

Option 1: Add Preview URL to Allowed Origins

Configure your auth provider to accept requests from preview URLs:
  • Clerk: Dashboard → API Keys → Allowed origins
  • Auth0: Applications → Settings → Allowed Origins
  • Supabase: Authentication → URL Configuration
Add a wildcard pattern like https://*.vercel.app or your specific preview URL pattern.

Option 2: Use Test/Development Mode

Many auth providers have development modes that are more permissive:

Option 3: Test Public Pages Only

For previews, you may choose to only test unauthenticated flows:

Writing Effective Test Instructions

Good Instructions

Be specific and actionable:

Bad Instructions

Avoid vague descriptions:

Tips for Better Tests

  • Number your steps - Makes it easier to identify where failures occur
  • Be explicit about expected outcomes - “Verify X appears” rather than “check X”
  • Use specific selectors when helpful - “Click the green ‘Submit’ button”
  • Include negative tests - “Verify error message appears for invalid input”

Conditional Testing

Only Test on Specific Files Changed

Skip Tests for Draft PRs

Complete Production Example

A full workflow with all best practices:

Troubleshooting

Cause: Morph GitHub App not installed or lacks permissions.Fix:
  1. Install the app at morphllm.com/dashboard/integrations/github
  2. Ensure it has access to your repository
  3. Check the app has “Pull requests: Read and write” permission
Cause: Invalid or missing API key.Fix:
  1. Verify MORPH_API_KEY is set in repository secrets
  2. Check the key is valid at morphllm.com/dashboard/api-keys
  3. Ensure you have available credits
Cause: Preview not deployed yet or URL incorrect.Fix:
  1. Add a wait/health check step before running tests
  2. Verify the preview URL is publicly accessible
  3. Check deployment logs for errors
Cause: Third-party auth blocking automated browsers.Fix:
  • Add preview URL pattern to auth provider’s allowed origins
  • Use development/test mode credentials
  • Test only public pages in preview tests
See Handling Third-Party Auth for details.
Cause: Complex tests exceeding default timeout.Fix:
  1. Break complex tests into smaller focused tests
  2. Run tests in parallel jobs
  3. Increase job timeout: timeout-minutes: 15

How It Works

  1. Your CI/CD deploys to your infrastructure (Vercel, Netlify, EKS, etc.)
  2. Action triggers and sends the preview URL to Morph
  3. Morph’s AI browser executes your test instructions
  4. Results posted directly to your PR as a comment
The action uses the same browser automation engine as the SDK, optimized for CI/CD workflows.

Requirements

  • Morph GitHub App installed on your repository
  • Valid Morph API key with available credits
  • Publicly accessible preview URL (cannot test localhost)

See Also