Skip to content

Commit a7b9459

Browse files
authored
test: selectively activate, always launch ui tests (#5467)
1 parent 40da768 commit a7b9459

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Samples/iOS-Swift/iOS-Swift-UITests/BaseUITest.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,17 @@ extension BaseUITest {
4242
app.launchEnvironment[k] = v
4343
}
4444

45-
// App prewarming can sometimes cause simulators to get stuck in UI tests, activating them
46-
// before launching clears any prewarming state.
47-
app.activate()
48-
4945
// Calling activate() and then launch() effectively launches the app twice, interfering with
50-
// local debugging. Check for attached debuggers first.
46+
// local debugging. Only call activate if there isn't a debugger attached, which is a decent
47+
// proxy for whether this is running in CI.
5148
if !isDebugging() {
52-
app.launch()
49+
// App prewarming can sometimes cause simulators to get stuck in UI tests, activating them
50+
// before launching clears any prewarming state.
51+
app.activate()
5352
}
54-
53+
54+
app.launch()
55+
5556
waitForExistenceOfMainScreen()
5657
}
5758

0 commit comments

Comments
 (0)