Health App Automated Testing Error Replicating Example

This repository demonstrates that the Health App on the iOS simulator instance running in a GitHub Action Runner environment does not display any content in the “Browse” section, making it impossible to test adding external HealthKit data such as EEG data in a UI test.

Expected Behaviour

  1. Download and install Xcode 14.1
  2. Reset the Simulator to get a completely clean instance
  3. Run the UI Tests in this Repo by opening TestApp.xcodeproj.
  4. The unit tests open the Health App and add Health Data using UI tests. You can observe the behavior in the iOS Simulator and see the Results in the Health App:

Observed Behaviour on GitHub Action Runners

  • The GitHub Action Runners run the same UI tests using the GitHub Action found in .github/workflows: build_and_test.yml.
  • The tests fail as the HealthKit’s “Browse” tab does not include any content, e.g.,:
  • The GitHub Action demonstrates this behavior as the UI tests create a screenshot on save and saves it in a .xcresult package.
  • You can download the results bundle as an artifact created by the UI test and observe its behavior in Xcode by opening the TestAppUITests.xcresult.
  • The following screenshot taken from the GitHub Action’s .xcresult file from the GitHub Action run demonstrates this behavior:


View Github