Prefix test in-front of UI test methods.

This commit is contained in:
Doug
2022-07-14 17:49:49 +01:00
committed by Doug
parent 0442342fc5
commit e6ea10f3a6
39 changed files with 404 additions and 757 deletions
@@ -17,29 +17,10 @@
import XCTest
import RiotSwiftUI
class AuthenticationForgotPasswordUITests: MockScreenTest {
override class var screenType: MockScreenState.Type {
return MockAuthenticationForgotPasswordScreenState.self
}
override class func createTest() -> MockScreenTest {
return AuthenticationForgotPasswordUITests(selector: #selector(verifyAuthenticationForgotPasswordScreen))
}
func verifyAuthenticationForgotPasswordScreen() throws {
guard let screenState = screenState as? MockAuthenticationForgotPasswordScreenState else { fatalError("no screen") }
switch screenState {
case .emptyAddress:
verifyEmptyAddress()
case .enteredAddress:
verifyEnteredAddress()
case .hasSentEmail:
verifyWaitingForEmailLink()
}
}
func verifyEmptyAddress() {
class AuthenticationForgotPasswordUITests: MockScreenTestCase {
func testEmptyAddress() {
app.goToScreenWithIdentifier(MockAuthenticationForgotPasswordScreenState.emptyAddress.title)
XCTAssertTrue(app.staticTexts["titleLabel"].exists, "The title should be shown before an email is sent.")
XCTAssertTrue(app.staticTexts["messageLabel"].exists, "The message should be shown before an email is sent.")
@@ -66,7 +47,9 @@ class AuthenticationForgotPasswordUITests: MockScreenTest {
XCTAssertEqual(cancelButton.label, "Cancel")
}
func verifyEnteredAddress() {
func testEnteredAddress() {
app.goToScreenWithIdentifier(MockAuthenticationForgotPasswordScreenState.enteredAddress.title)
XCTAssertTrue(app.staticTexts["titleLabel"].exists, "The title should be shown before an email is sent.")
XCTAssertTrue(app.staticTexts["messageLabel"].exists, "The message should be shown before an email is sent.")
@@ -92,7 +75,9 @@ class AuthenticationForgotPasswordUITests: MockScreenTest {
XCTAssertEqual(cancelButton.label, "Cancel")
}
func verifyWaitingForEmailLink() {
func testWaitingForEmailLink() {
app.goToScreenWithIdentifier(MockAuthenticationForgotPasswordScreenState.hasSentEmail.title)
XCTAssertFalse(app.staticTexts["titleLabel"].exists, "The title should be hidden once an email has been sent.")
XCTAssertFalse(app.staticTexts["messageLabel"].exists, "The message should be hidden once an email has been sent.")
XCTAssertFalse(app.textFields["addressTextField"].exists, "The text field should be hidden once an email has been sent.")