Skip to content

Commit 52e5ce7

Browse files
committed
fix: stabilize Settings replay selectors
1 parent e84df93 commit 52e5ce7

5 files changed

Lines changed: 11 additions & 8 deletions

File tree

ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ extension RunnerTests {
273273
: Date.distantFuture
274274
var seen = Set<String>()
275275
var candidates: [SnapshotNode] = []
276-
for element in flatFallbackElements(app: app, options: options) {
276+
for element in flatFallbackElements(app: app, options: options, deadline: deadline) {
277277
if Date() >= deadline {
278278
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_FLAT_FALLBACK_DEADLINE")
279279
break
@@ -822,7 +822,11 @@ extension RunnerTests {
822822
safely("SNAPSHOT_QUERY", [], fetch)
823823
}
824824

825-
private func flatFallbackElements(app: XCUIApplication, options: SnapshotOptions) -> [XCUIElement] {
825+
private func flatFallbackElements(
826+
app: XCUIApplication,
827+
options: SnapshotOptions,
828+
deadline: Date
829+
) -> [XCUIElement] {
826830
let queries: [XCUIElementQuery] = options.interactiveOnly ? [
827831
app.buttons,
828832
app.links,
@@ -866,7 +870,6 @@ extension RunnerTests {
866870
}
867871
}
868872

869-
let deadline = Date().addingTimeInterval(Self.flatInteractiveFallbackBudget)
870873
var elements: [XCUIElement] = []
871874
for query in queries {
872875
if Date() >= deadline {

test/integration/replays/ios/device/01-physical-lifecycle.ad

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
context platform=ios target=mobile
33
open com.apple.Preferences --relaunch
44
snapshot
5-
click "role=button label=General"
5+
click "role=cell label=General || role=button label=General"
66
wait "label=About || label=\"Software Update\"" 5000
77
back
8-
is exists "role=button label=General"
8+
is exists "role=cell label=General || role=button label=General"

test/integration/replays/ios/simulator/01-settings.ad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ open com.apple.Preferences --relaunch
44
screenshot "./test/screenshots/replays/ios-settings.png"
55
snapshot -i
66
appstate
7-
click "role=button label=General"
7+
click "role=cell label=General || role=button label=General"
88
wait "label=About || label=\"Software Update\" || text=\"Manage your overall setup and preferences\"" 5000
99
snapshot
1010
is exists "label=About || label=\"Software Update\" || text=\"Manage your overall setup and preferences\""

test/integration/replays/ios/simulator/02-deep-navigation.ad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
context platform=ios target=mobile
33

44
open com.apple.Preferences --relaunch
5-
click "role=button label=General"
5+
click "role=cell label=General || role=button label=General"
66
wait 1000
77
find text "About" exists
88

test/integration/replays/macos/01-system-settings.ad

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ open "System Settings" --relaunch
44
screenshot "./test/screenshots/replays/macos-system-settings.png"
55
appstate
66
snapshot -i
7-
click "role=button label=General"
7+
click "role=cell label=General || role=button label=General"
88
wait "role=button label=About" 5000
99
snapshot -i
1010
is exists "role=button label=About"

0 commit comments

Comments
 (0)