mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Add UI tests
This commit is contained in:
+29
-3
@@ -19,19 +19,19 @@ import XCTest
|
||||
|
||||
class UserSessionOverviewUITests: MockScreenTestCase {
|
||||
func test_whenCurrentSessionSelected_correctNavTittleDisplayed() {
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.currentSession.title)
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.currentSession(sessionState: .unverified).title)
|
||||
let navTitle = VectorL10n.userSessionOverviewCurrentSessionTitle
|
||||
XCTAssertTrue(app.navigationBars[navTitle].staticTexts[navTitle].exists)
|
||||
}
|
||||
|
||||
func test_whenOtherSessionSelected_correctNavTittleDisplayed() {
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.otherSession.title)
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.otherSession(sessionState: .verified).title)
|
||||
let navTitle = VectorL10n.userSessionOverviewSessionTitle
|
||||
XCTAssertTrue(app.navigationBars[navTitle].staticTexts[navTitle].exists)
|
||||
}
|
||||
|
||||
func test_whenSessionOverviewPresented_sessionDetailsButtonExists() {
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.currentSession.title)
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.currentSession(sessionState: .unverified).title)
|
||||
XCTAssertTrue(app.buttons[VectorL10n.userSessionOverviewSessionDetailsButtonTitle].exists)
|
||||
}
|
||||
|
||||
@@ -61,4 +61,30 @@ class UserSessionOverviewUITests: MockScreenTestCase {
|
||||
XCTAssertTrue(app.staticTexts[VectorL10n.userSessionPushNotifications].exists)
|
||||
XCTAssertTrue(app.staticTexts[VectorL10n.userSessionPushNotificationsMessage].exists)
|
||||
}
|
||||
|
||||
func test_whenOtherSessionSelected_learnMoreButtonDoesnExist() {
|
||||
let title = MockUserSessionOverviewScreenState.currentSession(sessionState: .verified).title
|
||||
app.goToScreenWithIdentifier(title)
|
||||
let buttonId = "\(VectorL10n.userOtherSessionVerifiedAdditionalInfo) \(VectorL10n.userSessionLearnMore)"
|
||||
let button = app.buttons[buttonId]
|
||||
XCTAssertFalse(button.exists)
|
||||
}
|
||||
|
||||
func test_whenOtherVerifiedSessionSelected_learnMoreButtonExists() {
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.otherSession(sessionState: .verified).title)
|
||||
let buttonId = "\(VectorL10n.userOtherSessionVerifiedAdditionalInfo) \(VectorL10n.userSessionLearnMore)"
|
||||
let button = app.buttons[buttonId]
|
||||
XCTAssertTrue(button.exists)
|
||||
button.tap()
|
||||
XCTAssertTrue(app.staticTexts[VectorL10n.userSessionVerifiedSessionTitle].exists)
|
||||
}
|
||||
|
||||
func test_whenOtherUnverifiedSessionSelected_learnMoreButtonExists() {
|
||||
app.goToScreenWithIdentifier(MockUserSessionOverviewScreenState.otherSession(sessionState: .unverified).title)
|
||||
let buttonId = "\(VectorL10n.userOtherSessionUnverifiedAdditionalInfo) \(VectorL10n.userSessionLearnMore)"
|
||||
let button = app.buttons[buttonId]
|
||||
XCTAssertTrue(button.exists)
|
||||
button.tap()
|
||||
XCTAssertTrue(app.staticTexts[VectorL10n.userSessionUnverifiedSessionTitle].exists)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user