Skip to content

feat(core): detect ios alerts and permission prompts for screen.on('dialog') - #361

Open
gmegidish wants to merge 1 commit into
feat/dialog-eventsfrom
feat/dialog-events-ios
Open

gmegidish wants to merge 1 commit into
feat/dialog-eventsfrom
feat/dialog-events-ios

Conversation

@gmegidish

Copy link
Copy Markdown
Member

Stacked on #360. Adds iOS to screen.on('dialog').

Detection

mobilecli's iOS tree shows both app alerts and system permission prompts (from SpringBoard) as an Alert node: label = title, flat children = title and message StaticTexts, an optional TextField, and Buttons.

  • type: prompt if there's a TextField, confirm if more than one button, otherwise alert
  • permission / isSystem(): nothing in the tree marks a system alert, so this checks for the app name in curly quotes in the title (“Playground” would like to access the Camera.). A locale that quotes differently reads as an app alert.
  • accept / dismiss follow Apple's button layout, not labels:
    • side by side: accept = right, dismiss = left (Cancel/OK, Don't Allow/Allow)
    • stacked: dismiss = bottom; accept = top for app alerts, the one above Don't Allow for permission prompts (Allow While Using App)

WDA instead always uses last = accept and first = dismiss, which would tap "Don't Allow" when accepting the iOS location prompt.

accept(text) now finds the OK button again by re-detecting the dialog, so it works on both platforms (iOS buttons have no ids).

e2e

e2e/src/android/dialogs.test.ts → e2e/src/dialogs/dialogs.test.ts, which now runs on both platforms:

  • uses getByTestId
  • scrolls buttons into view, since iOS Form only lists rendered rows

Known gap

On iOS simulators, clearAppData() doesn't reset permissions. Today that needs simctl privacy reset all <bundle>, and notifications only reset on reinstall. The e2e permission tests therefore need a fresh install on iOS. Documented in the guide.

Test plan

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: d6c14391-8c58-4ff5-9481-06a5987f5822

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant