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 AuthenticationVerifyEmailUITests: MockScreenTest {
override class var screenType: MockScreenState.Type {
return MockAuthenticationVerifyEmailScreenState.self
}
override class func createTest() -> MockScreenTest {
return AuthenticationVerifyEmailUITests(selector: #selector(verifyAuthenticationVerifyEmailScreen))
}
func verifyAuthenticationVerifyEmailScreen() throws {
guard let screenState = screenState as? MockAuthenticationVerifyEmailScreenState else { fatalError("no screen") }
switch screenState {
case .emptyAddress:
verifyEmptyAddress()
case .enteredAddress:
verifyEnteredAddress()
case .hasSentEmail:
verifyWaitingForEmailLink()
}
}
func verifyEmptyAddress() {
class AuthenticationVerifyEmailUITests: MockScreenTestCase {
func testEmptyAddress() {
app.goToScreenWithIdentifier(MockAuthenticationVerifyEmailScreenState.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.")
@@ -60,7 +41,9 @@ class AuthenticationVerifyEmailUITests: MockScreenTest {
XCTAssertEqual(cancelButton.label, "Cancel")
}
func verifyEnteredAddress() {
func testEnteredAddress() {
app.goToScreenWithIdentifier(MockAuthenticationVerifyEmailScreenState.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.")
@@ -80,7 +63,9 @@ class AuthenticationVerifyEmailUITests: MockScreenTest {
XCTAssertEqual(cancelButton.label, "Cancel")
}
func verifyWaitingForEmailLink() {
func testWaitingForEmailLink() {
app.goToScreenWithIdentifier(MockAuthenticationVerifyEmailScreenState.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.")