Add UserSessionDetailsUITests

This commit is contained in:
Alfonso Grillo
2022-11-09 18:18:49 +01:00
parent c93d528867
commit 8e312676e0
3 changed files with 17 additions and 16 deletions
@@ -18,18 +18,17 @@ import RiotSwiftUI
import XCTest
class UserSessionDetailsUITests: MockScreenTestCase {
func disabled_broken_xcode14_test_longPressDetailsCell_CopiesValueToClipboard() throws {
func test_screenWithAllTheContent() throws {
app.goToScreenWithIdentifier(MockUserSessionDetailsScreenState.allSections.title)
UIPasteboard.general.string = ""
let tables = app.tables
let sessionNameIosCell = tables.cells["Session name, iOS"]
sessionNameIosCell.press(forDuration: 0.5)
app.buttons["Copy"].tap()
let clipboard = try XCTUnwrap(UIPasteboard.general.string)
XCTAssertEqual(clipboard, "iOS")
let rows = app.staticTexts.matching(identifier: "UserSessionDetailsItem.title")
XCTAssertEqual(rows.count, 6)
}
func test_screenWithSessionSectionOnly() throws {
app.goToScreenWithIdentifier(MockUserSessionDetailsScreenState.sessionSectionOnly.title)
let rows = app.staticTexts.matching(identifier: "UserSessionDetailsItem.title")
XCTAssertEqual(rows.count, 3)
}
}