improved location sharing handler

This commit is contained in:
Mauro Romito
2025-07-18 18:08:29 +02:00
committed by Mauro
parent 8654e01a13
commit 941385ba15
@@ -16,11 +16,11 @@ final class AccessibilityTests: XCTestCase {
app = Application.launch(viewID: name) app = Application.launch(viewID: name)
await client.waitForApp() await client.waitForApp()
defer { try? client.stop() } defer { try? client.stop() }
// To handle location sharing popup
allowLocationPermissions()
try client.send(.accessibilityAudit(.nextPreview)) try client.send(.accessibilityAudit(.nextPreview))
// To handle location sharing popup in CI
allowLocationPermissions()
forLoop: for await signal in client.signals.values { forLoop: for await signal in client.signals.values {
switch signal { switch signal {
case .accessibilityAudit(let auditSignal): case .accessibilityAudit(let auditSignal):
@@ -44,7 +44,7 @@ final class AccessibilityTests: XCTestCase {
private func allowLocationPermissions() { private func allowLocationPermissions() {
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
let notificationAlertAllowButton = springboard.buttons["Allow While Using App"].firstMatch let notificationAlertAllowButton = springboard.buttons["Allow While Using App"].firstMatch
if notificationAlertAllowButton.waitForExistence(timeout: 10.0) { if notificationAlertAllowButton.exists {
notificationAlertAllowButton.tap() notificationAlertAllowButton.tap()
} }
} }