name: Setup Chrome
description: Install real Chrome for browser testing (with xvfb on Linux)

outputs:
  chrome-path:
    description: Path to the installed Chrome binary
    value: ${{ steps.setup-chrome.outputs.chrome-path }}

runs:
  using: composite
  steps:
    - name: Install real Chrome for Testing
      uses: browser-actions/setup-chrome@v2
      id: setup-chrome
      with:
        chrome-version: latest

    - name: Verify Chrome installation
      shell: bash
      run: |
        echo "Chrome path: ${{ steps.setup-chrome.outputs.chrome-path }}"
        "${{ steps.setup-chrome.outputs.chrome-path }}" --version

    - name: Install xvfb (Linux only)
      if: runner.os == 'Linux'
      shell: bash
      run: sudo apt-get install -y xvfb
