Add message sending end editing steps to the user session flow UI test

This commit is contained in:
Stefan Ceriu
2026-05-27 12:13:05 +03:00
parent e0b7f1b3fa
commit 0138fd2a5e
6 changed files with 87 additions and 11 deletions
+30 -2
View File
@@ -34,7 +34,7 @@ class UserSessionScreenTests: XCTestCase {
}
func testUserSessionFlows() async throws {
let app = Application.launch(.userSessionScreen)
let app = Application.launch(.userSessionScreen, disableTimelineAccessibility: false)
app.swipeDown() // Make sure the header shows a large title
@@ -44,7 +44,35 @@ class UserSessionScreenTests: XCTestCase {
XCTAssert(app.buttons[firstRoomName].waitForExistence(timeout: 5.0))
try await Task.sleep(for: .seconds(1))
try await app.assertScreenshot(step: Step.roomScreen)
var composer = app.textViews[A11yIdentifiers.roomScreen.messageComposer]
composer.tap(.center)
composer.typeText("sugar honey ice")
app.buttons[A11yIdentifiers.roomScreen.sendButton].tap()
let latestMessage = app.textViews.matching(NSPredicate(format: "value CONTAINS 'sugar honey ice'")).firstMatch
XCTAssert(latestMessage.waitForExistence(timeout: 5.0))
// Tapping on the mesage text view or the cell doesn't work.
// Use the sender static text instead.
let latestEventSender = app.staticTexts["@test.matrix.org"]
XCTAssert(latestEventSender.waitForExistence(timeout: 5.0))
latestEventSender.press(forDuration: 5.0)
let editButton = app.buttons[A11yIdentifiers.roomScreen.timelineItemActionMenuAction.edit]
XCTAssert(editButton.waitForExistence(timeout: 5.0))
editButton.tap()
composer = app.textViews[A11yIdentifiers.roomScreen.messageComposer]
composer.tap(.center)
composer.typeText(" & tea")
app.buttons[A11yIdentifiers.roomScreen.sendButton].tap()
let latestEditedMessage = app.textViews.matching(NSPredicate(format: "value CONTAINS 'sugar honey ice & tea'")).firstMatch
XCTAssert(latestEditedMessage.waitForExistence(timeout: 5.0))
app.buttons[A11yIdentifiers.roomScreen.composerToolbar.openComposeOptions].tap(.center)
try await app.assertScreenshot(step: Step.composerAttachments)
}
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:69e336fcc27867de462eeb74a83cb50a62cf278920199a56792632e4329cc250
size 619016
oid sha256:bf0f3e45df8d7b61fc004ec7d9378950a0bc26c3d96249c2260a254bd8b92abc
size 644781
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:15c02e01fd99fab8b93a4c9b8922da79aee505d6141cf01fb7b9bfb9243867ef
size 463451
oid sha256:843e4dbadd9547a96fa24f21b28825f838a6ea352fd9d8f3abed910e5fc5c634
size 417228