maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Simulator locks when running Maestro tests after setting notification permissions with applesimutils

Open zimimi opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and didn't find mine.

Steps to reproduce

  1. Boot the iOS simulator.
  2. Set notification permissions for the app using applesimutils: applesimutils --booted --bundle ${appId} --setPermissions notifications=YES
  3. Launch the app and run Maestro tests: maestro test <path_to_test_script>
  4. Observe that the simulator screen locks, and the Maestro tests fail.

Actual results

  • The simulator locks after running the maestro test command.
  • Screen displays the lock screen, and the simulator appears to be in a locked.
  • Maestro tests fail.

Expected results

  • The simulator should remain unlocked and responsive when running Maestro tests after setting permissions with applesimutils.
  • Maestro tests should execute successfully without the simulator locking.
  • The app should have notification permissions granted, and the tests should proceed without needing to handle the permission prompt within the test script.

About app

  • This is a React Native app on iOS and Android platforms.
  • The problem occurs only on iOS; Android tests run without issues.
  • The issue is observed when using the iPhone 15 simulator running iOS 17.5.

About environment

Maestro Version: 1.38.1 OS: Mac OS X OS Version: 14.7 Arch: aarch64 Java Version: 18 XCode Version: 15.4

Logs

Logs
<!-- Replace this line with your logs. *DO NOT* remove the backticks! -->

Maestro version

1.38.1

How did you install Maestro?

Homebrew

Anything else?

I found a workaround by handling notification permission in Maestro Script: Moved the notification permission handling into the Maestro test script using:

  tapOn:
    text: "Allow"

zimimi avatar Oct 21 '24 01:10 zimimi

Got any logs?

Out of interest, why not use Maestro's launchApp to set the permissions?

Fishbowler avatar Mar 23 '25 23:03 Fishbowler