Add UI tests for accepting space invites. (#4602)

* Fix the space visibility icon size in the join room screen.

* Add a UI test for accepting space invites.
This commit is contained in:
Doug
2025-10-09 10:11:02 +01:00
committed by GitHub
parent a1861de915
commit d026970565
51 changed files with 166 additions and 83 deletions

View File

@@ -14,6 +14,7 @@ class UserSessionScreenTests: XCTestCase {
let unjoinedSpaceRoomName = "Company Room"
let joinedSubspaceName = "Joined Space"
let joinedSubspaceRoomName = "Management"
let spaceInviteName = "First space"
enum Step {
static let homeScreen = 1
@@ -108,4 +109,36 @@ class UserSessionScreenTests: XCTestCase {
try await Task.sleep(for: .seconds(1))
try await app.assertScreenshot(step: Step.spaceJoinRoomScreen)
}
func testAcceptSpaceInvite() async throws {
let app = Application.launch(.userSessionSpacesFlow)
app.swipeDown() // Make sure the header shows a large title
try await app.assertScreenshot(step: Step.spacesTabBar)
// Tap the space invite cell.
app.staticTexts[A11yIdentifiers.homeScreen.roomName(spaceInviteName)].tap()
XCTAssert(app.buttons[A11yIdentifiers.joinRoomScreen.join].waitForExistence(timeout: 5.0))
try await Task.sleep(for: .seconds(1))
try await app.assertScreenshot(step: Step.spaceJoinRoomScreen)
// Tap join on the join room screen.
app.buttons[A11yIdentifiers.joinRoomScreen.join].tap()
XCTAssert(app.staticTexts[A11yIdentifiers.roomScreen.name].waitForExistence(timeout: 5.0)) // The space screen reuses the room screen header
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))
// Tap the join button in the space invite cell.
app.buttons.matching(NSPredicate(format: "identifier == %@ && label == %@",
A11yIdentifiers.homeScreen.roomName(spaceInviteName),
"Accept")).firstMatch.tap()
XCTAssert(app.staticTexts[A11yIdentifiers.roomScreen.name].waitForExistence(timeout: 5.0)) // The space screen reuses the room screen header
try await Task.sleep(for: .seconds(1))
try await app.assertScreenshot(step: Step.spaceScreen)
}
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2846840b9913ac6abd1c7a220424b54939852f0db79b280d6e5cf338246fd3cf
size 511246

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:961b37b8f529d2ec7e1963accc1ddbc687e3c01d943fa88aa897f4424c58ad3a
size 391645

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:183db1d4451e0b945d955969dbb006ff3444695befecbf00dee12e5d9cb2afcd
size 383420

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:663e4307f18242abd11411e24feaa792836fcf6cea8ea5e2b95d4619cc89209f
size 607323

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b8359781830e2974d4e0e25d498d49b9383cfbbaed734a8a5e5bbc2016998a53
size 132455

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9bfb52bac5e3123f2a49ac93bf17fd362e2bb0c84289ce76df77323bc0451406
size 123854

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:181f62e6c2d5722aaa087350ff62be9777c79143feb7895e684be6bef139505e
size 463906
oid sha256:2846840b9913ac6abd1c7a220424b54939852f0db79b280d6e5cf338246fd3cf
size 511246

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1fc6f05c96afa0743d4e9e5be467e26c2abd3817f58b36e662ba4d1bcb7d45ef
size 553323
oid sha256:663e4307f18242abd11411e24feaa792836fcf6cea8ea5e2b95d4619cc89209f
size 607323