Prompt

How do I automate browser jobs in CI/CD so they run on every pull request?

Technology / Testing & QA1 observationLast seen Oct 26, 2026

Latest observation

Oct 26, 2026OpenAI APIWeb search: off

To automate browser jobs in CI/CD on every pull request, the common pattern is:

  1. Write browser tests
  2. Run them in headless mode
  3. Trigger them from your CI on PR events
  4. Upload artifacts on failure so you can debug

Typical setup

1) Pick a browser automation tool

Common choices:

  • Playwright — best modern default
  • Cypress — great DX, popular for web apps
  • Selenium/WebDriver — good for broad compatibility
  • Puppeteer — mostly Chrome-specific

If you’re starting fresh, Playwright is usually the easiest for CI.


2) Make sure tests can run headlessly

CI servers usually have no GUI, so tests should run without a visible browser.

Example for Playwright:

npx playwright test

Example for Cypress:

npx cypress run

3) Add a CI workflow for pull requests

GitHub Actions example with Playwright

Create .github/workflows/browser-tests.yml:

name: Browser Tests

on:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm

      - name: Install dependencies
        run: npm ci

      - name: Install Playwright browsers
        run: npx playwright install --with-deps

      - name: Run tests
        run: npx playwright test

      - name: Upload test report on failure
        if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: playwright-report
          path: playwright-report

4) Configure CI to fail the PR if tests fail

This happens automatically if your workflow exits non-zero. Most CI systems will mark the check failed, and you can require that check before merging.

In GitHub:

  • Go to Branch protection rules
  • Require the browser test workflow to pass before merge

5) Save useful artifacts

For debugging, upload:

  • screenshots
  • videos
  • HTML reports
  • logs

Playwright can be configured to capture these automatically:

// playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    screenshot: 'only-on-failure',
    video: 'retain-on-failure',
    trace: 'retain-on-failure',
  },
});

If you use Cypress

Example GitHub Actions workflow:

name: Cypress Tests

on:
  pull_request:

jobs:
  cypress-run:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: npm

      - run: npm ci

      - run: npx cypress run

      - name: Upload screenshots/videos
        if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: cypress-artifacts
          path: |
            cypress/screenshots
            cypress/videos

Best practices

  • Run only a smoke subset on every PR, and run the full suite nightly or on merge to main
  • Use stable selectors like data-testid
  • Keep tests independent from each other
  • Spin up the app in CI before tests run
  • Mock external services where possible
  • Use retries sparingly to reduce flaky failures, but don’t hide real issues

Example of starting your app in CI:

- run: npm run build
- run: npm run start &
- run: npx wait-on http://localhost:3000
- run: npx playwright test

If you tell me your stack, I can generate a ready-to-use CI file

For example:

  • GitHub Actions + Playwright
  • GitLab CI + Cypress
  • Jenkins + Selenium
  • Azure DevOps + Playwright

If you want, I can give you a copy-paste workflow for your exact setup.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.