Skip to content

Commit 6947107

Browse files
committed
Add interruption handlers after we tap on the test case
Prevents other interruptions from erroneously triggering the handlers
1 parent 06b0a57 commit 6947107

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Test Runner/UI Tests/AttachmentCameraControllerTests.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ final class AttachmentCameraControllerTests: XCTestCase {
3434

3535
app.launch()
3636

37+
let attachmentCameraControllerTestsButton = app.buttons["AttachmentCameraController Tests"]
38+
39+
XCTAssertTrue(
40+
attachmentCameraControllerTestsButton.exists,
41+
"The AttachmentCameraController Tests button wasn't found."
42+
)
43+
attachmentCameraControllerTestsButton.tap()
44+
3745
addUIInterruptionMonitor(withDescription: "Camera access alert") { (alert) -> Bool in
3846
alert.buttons["Allow"].tap()
3947
return true
@@ -43,14 +51,6 @@ final class AttachmentCameraControllerTests: XCTestCase {
4351
return true
4452
}
4553

46-
let attachmentCameraControllerTestsButton = app.buttons["AttachmentCameraController Tests"]
47-
48-
XCTAssertTrue(
49-
attachmentCameraControllerTestsButton.exists,
50-
"The AttachmentCameraController Tests button wasn't found."
51-
)
52-
attachmentCameraControllerTestsButton.tap()
53-
5454
XCTAssertTrue(
5555
cameraModeController.waitForExistence(timeout: 5)
5656
)

0 commit comments

Comments
 (0)