actions / runner-images

GitHub Actions runner images
MIT License
10.02k stars 3.03k forks source link

Facing issues with desktop screen interaction on macOS 13 runner image. #8951

Closed mohan-dope closed 10 months ago

mohan-dope commented 10 months ago

Description

We plan to transition our GitHub Actions test environment from macOS 12 to 13 runner image but have encountered screen capture/interaction issues. We are using Robot Framework for our tests execution, and our tests involve desktop screen interaction. The problem is that captured screenshots do not display opened apps, the Dock, and 'Status Menu'.

I attempted to replicate this issue on my local macOS 13 test system. The problem occurs only when 'Screen Recording' permission is not granted for the 'Terminal' app, where I execute my Robot script for desktop screen interaction. Despite experimenting with various permissions on GitHub runner image, the issue persists. Here are my observations -

  1. Granting 'Screen Recording' permission to the 'Terminal' app on the GitHub Actions runner image doesn't seem to take effect, possibly because 'Terminal' is not used to execute commands and scripts on the runner image. sudo sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" "INSERT OR REPLACE INTO access VALUES('kTCCServiceScreenCapture','com.apple.Terminal',0,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1700820626);"
  2. While 'Screen Recording' permission is granted to /usr/local/opt/runner/provisioner/provisioner, the issue persists even after granting permission to the script /usr/local/opt/runner/runprovisioner.sh.
  3. Providing permission to 'Python' and 'robot' programs also does not address the problem.

I'm currently unsure which app requires Screen Recording permission on macOS 13 runner image. Could someone test this and inform me about the app needing permission? Alternatively, if possible, please include the fix in the default runner image for macOS 13.

Note that we don't face this issue on macOS 12 runner image; we don't have to add any explicit permission for any app there.

Platforms affected

Runner images affected

Image version and build link

Image: macos-13 Version: 20231025.2 Image Release: https://github.com/actions/runner-images/releases/tag/macos-13%2F20231025.2

Is it regression?

No

Expected behavior

The screenshot should display the entire desktop screen with the Dock, Status Menus, and any other opened app. Refer to the image below for reference (captured using test script on my local test system).

image

Actual behavior

The problem is that captured screenshots do not display opened apps, the Dock, and 'Status Menu' (refer to the screenshot).

image

Repro steps

  1. Install Robot Framework. pip install robotframework

  2. Create a test.robot script file with the content below.

     *** Settings ***
     Library    Screenshot
    
    *** Test Cases ***
    Test Screen Capture
        Take Screenshot
  3. Run the script using the command below. robot -d /tmp/robot_logs/ test.robot

  4. Collect logs from the /tmp/robot_logs/ folder as artifacts.

  5. Download artifacts and open the 'log.html' file in a browser.

  6. Observe the 'screenshot' from the opened logs.

erik-bershel commented 10 months ago

Hello @mohan-dope! Thank you for the info. We are already working on this issue as I see: https://github.com/actions/runner-images/issues/8782. Please track progress in the mentioned item. I'll close this item as a duplicate, but feel free to ask questions or to open new issue case of other concerns.