Run a configured browser scenario in CI.

Use the Molar Guard GitHub Action to run a scenario your project already defines. Start with a task you can reproduce locally, such as signing in or completing checkout in a test environment.

The CI runner needs access to the application URL, the Molar project, and any test accounts or services the scenario uses. Configure those before adding the command to your workflow.

Register the scenario, then add the Action.

  1. Write the scenario. Add a .molar.md file to .molar/scenarios/ and run it locally against your test environment until it passes. Configure clones if the scenario changes payment, email or account state.
  2. Register it in Guard. Create the scenario in the Guard dashboard and copy its ID.
  3. Add the Action. Store your Molar API key as a repository secret, then add the step below after your preview deployment is ready.
  4. Make it required. Start with mode: advisory, which comments on the pull request. Switch to mode: required to fail the job on a failed check, then mark that job as required in your repository settings.
# .github/workflows/guard.yml (step)
- uses: pratikranaa/guard-action@v1
  with:
    api-key: ${{ secrets.MOLAR_API_KEY }}
    scenario-id: ${{ vars.CHECKOUT_SCENARIO_ID }}
    base-url: ${{ steps.deploy.outputs.url }}
    mode: advisory

The Action runs on pull_request and workflow_dispatch events. It starts one run of the scenario against base-url, waits for the result and reports it. It doesn’t write the scenario or change your branch protection. If you install the Molar GitHub App instead, Guard finds Vercel preview URLs for you.

Read the failure before deciding to merge.

Review the scenario status and any captured steps, screenshots, or trace links. Check whether the app failed an assertion, the test environment was unavailable, or the account could not sign in. These require different fixes.

For example, a checkout scenario should verify the expected account access as well as the confirmation page. If the browser succeeds but the configured service check fails, investigate the payment callback or account update before treating the run as passed.

Guard is in beta. Explore Guard or talk to us. Automatic repair through Mender remains a preview capability.

Ask about your CI setup