From 2f5d89957097b24db9e35fd53e21930b6d4123c1 Mon Sep 17 00:00:00 2001 From: Alejandro Maggi Date: Fri, 27 Feb 2026 15:23:21 -0300 Subject: [PATCH] Fix acceptAlertButtonSelector matching 'Don't Allow' instead of 'Allow' The CONTAINS[c] 'Allow' predicate matched both "Allow" and "Don't Allow" buttons, causing WDA to tap "Don't Allow" and reject permissions on real iOS devices. Changed to BEGINSWITH[c] 'Allow' to only match buttons starting with "Allow", plus an exact match for "OK" on older iOS dialogs. Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 1 + pkg/driver/wda/commands.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6d099..1a6605a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - `runFlow: when` conditions with variable expressions (e.g., `${output.element.id}`) were never expanded, causing conditions to always evaluate as false and silently skip conditional blocks +- iOS real device: `acceptAlertButtonSelector` matched "Don't Allow" instead of "Allow" — `CONTAINS[c] 'Allow'` matched both buttons, causing WDA to reject permission dialogs. Changed to `BEGINSWITH[c] 'Allow'` with `OK` fallback for older iOS versions ## [1.0.7] - 2026-02-20 diff --git a/pkg/driver/wda/commands.go b/pkg/driver/wda/commands.go index 70d51c1..9262d7b 100644 --- a/pkg/driver/wda/commands.go +++ b/pkg/driver/wda/commands.go @@ -751,7 +751,7 @@ func (d *Driver) launchApp(step *flow.LaunchAppStep) *core.CommandResult { "waitForIdleTimeout": 0, } if d.alertAction == "accept" { - sessionSettings["acceptAlertButtonSelector"] = "**/XCUIElementTypeButton[`label CONTAINS[c] 'Allow'`]" + sessionSettings["acceptAlertButtonSelector"] = "**/XCUIElementTypeButton[`label BEGINSWITH[c] 'Allow' OR label ==[c] 'OK'`]" } else if d.alertAction == "dismiss" { sessionSettings["dismissAlertButtonSelector"] = "**/XCUIElementTypeButton[`label CONTAINS[c] 'Don't Allow' OR label CONTAINS[c] 'Dont Allow'`]" }