mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Prefix test in-front of UI test methods.
This commit is contained in:
+16
-31
@@ -17,33 +17,10 @@
|
||||
import XCTest
|
||||
import RiotSwiftUI
|
||||
|
||||
class AuthenticationServerSelectionUITests: MockScreenTest {
|
||||
|
||||
override class var screenType: MockScreenState.Type {
|
||||
return MockAuthenticationServerSelectionScreenState.self
|
||||
}
|
||||
|
||||
override class func createTest() -> MockScreenTest {
|
||||
return AuthenticationServerSelectionUITests(selector: #selector(verifyAuthenticationServerSelectionScreen))
|
||||
}
|
||||
|
||||
func verifyAuthenticationServerSelectionScreen() throws {
|
||||
guard let screenState = screenState as? MockAuthenticationServerSelectionScreenState else { fatalError("no screen") }
|
||||
switch screenState {
|
||||
case .matrix:
|
||||
verifyRegisterState()
|
||||
case .login:
|
||||
verifyLoginState()
|
||||
case .emptyAddress:
|
||||
verifyEmptyAddress()
|
||||
case .invalidAddress:
|
||||
verifyInvalidAddress()
|
||||
case .nonModal:
|
||||
verifyNonModalPresentation()
|
||||
}
|
||||
}
|
||||
|
||||
func verifyRegisterState() {
|
||||
class AuthenticationServerSelectionUITests: MockScreenTestCase {
|
||||
func testRegisterState() {
|
||||
app.goToScreenWithIdentifier(MockAuthenticationServerSelectionScreenState.matrix.title)
|
||||
|
||||
let title = app.staticTexts["headerTitle"]
|
||||
XCTAssertEqual(title.label, VectorL10n.authenticationServerSelectionRegisterTitle)
|
||||
let message = app.staticTexts["headerMessage"]
|
||||
@@ -65,14 +42,18 @@ class AuthenticationServerSelectionUITests: MockScreenTest {
|
||||
}
|
||||
|
||||
|
||||
func verifyLoginState() {
|
||||
func testLoginState() {
|
||||
app.goToScreenWithIdentifier(MockAuthenticationServerSelectionScreenState.login.title)
|
||||
|
||||
let title = app.staticTexts["headerTitle"]
|
||||
XCTAssertEqual(title.label, VectorL10n.authenticationServerSelectionLoginTitle)
|
||||
let message = app.staticTexts["headerMessage"]
|
||||
XCTAssertEqual(message.label, VectorL10n.authenticationServerSelectionLoginMessage)
|
||||
}
|
||||
|
||||
func verifyEmptyAddress() {
|
||||
func testEmptyAddress() {
|
||||
app.goToScreenWithIdentifier(MockAuthenticationServerSelectionScreenState.emptyAddress.title)
|
||||
|
||||
let serverTextField = app.textFields.element
|
||||
XCTAssertEqual(serverTextField.value as? String, VectorL10n.authenticationServerSelectionServerUrl, "The text field should show placeholder text in this state.")
|
||||
|
||||
@@ -81,7 +62,9 @@ class AuthenticationServerSelectionUITests: MockScreenTest {
|
||||
XCTAssertFalse(confirmButton.isEnabled, "The confirm button should be disabled when the address is empty.")
|
||||
}
|
||||
|
||||
func verifyInvalidAddress() {
|
||||
func testInvalidAddress() {
|
||||
app.goToScreenWithIdentifier(MockAuthenticationServerSelectionScreenState.invalidAddress.title)
|
||||
|
||||
let serverTextField = app.textFields.element
|
||||
XCTAssertEqual(serverTextField.value as? String, "thisisbad", "The text field should show the entered server.")
|
||||
|
||||
@@ -94,7 +77,9 @@ class AuthenticationServerSelectionUITests: MockScreenTest {
|
||||
XCTAssertEqual(textFieldFooter.label, VectorL10n.errorCommonMessage)
|
||||
}
|
||||
|
||||
func verifyNonModalPresentation() {
|
||||
func testNonModalPresentation() {
|
||||
app.goToScreenWithIdentifier(MockAuthenticationServerSelectionScreenState.nonModal.title)
|
||||
|
||||
let dismissButton = app.buttons["dismissButton"]
|
||||
XCTAssertFalse(dismissButton.exists, "The dismiss button should be hidden when not in modal presentation.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user