Update UI test snapshots. (#4722)

* Update UI test snapshots.

* Stop snapshotting the photo picker, just assert that it was presented.

* Fix a swipe action not being detected in the UI tests.

* Handle the split view properly on iPad when accepting a space invite.

Fixes a test but also properly handles replacing a room with a space.
This commit is contained in:
Doug
2025-11-11 11:34:01 +00:00
committed by GitHub
parent 66f3b86c69
commit 5cfe538f92
38 changed files with 90 additions and 88 deletions

View File

@@ -52,7 +52,7 @@ class UserSessionScreenTests: XCTestCase {
try await Task.sleep(for: .seconds(1))
let cell = app.cells.element(boundBy: 1) // Skip the typing indicator cell
cell.swipeRight(velocity: .fast)
cell.swipeRight(velocity: .slow) // The iOS 26 simulator doesn't like a fast swipe.
try await app.assertScreenshot()
}
@@ -130,9 +130,15 @@ class UserSessionScreenTests: XCTestCase {
try await Task.sleep(for: .seconds(1))
try await app.assertScreenshot(step: Step.spaceScreen)
// Go back to the room list.
app.navigationBars.buttons["Chats"].firstMatch.tap(.center)
XCTAssert(app.staticTexts["Chats"].waitForExistence(timeout: 5.0))
if UIDevice.current.userInterfaceIdiom == .phone {
// Go back to the room list on iPhone.
app.navigationBars.buttons["Chats"].firstMatch.tap(.center)
XCTAssert(app.staticTexts["Chats"].waitForExistence(timeout: 5.0))
} else {
// Select a different room on iPad (otherwise nothing changes when the join button is tapped below).
app.buttons[A11yIdentifiers.homeScreen.roomName(firstRoomName)].tap()
XCTAssert(app.staticTexts[firstRoomName].waitForExistence(timeout: 5.0))
}
// Tap the join button in the space invite cell.
app.buttons.matching(NSPredicate(format: "identifier == %@ && label == %@",