Fix authentication UI tests. (#1010)

* Fix authentication flow UI tests.

* Fix analytics prompt snapshot.
This commit is contained in:
Doug 2023-06-02 12:41:45 +01:00 committed by GitHub
parent 44062adb0f
commit fedd401a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 8 deletions

View File

@ -74,7 +74,6 @@ struct A11yIdentifiers {
let emailUsername = "login-email_username"
let password = "login-password"
let `continue` = "login-continue"
let oidc = "login-oidc"
let unsupportedServer = "login-unsupported_server"
}

View File

@ -30,9 +30,6 @@ class AuthenticationCoordinatorUITests: XCTestCase {
// Server Confirmation: Tap continue button
app.buttons[A11yIdentifiers.serverConfirmationScreen.continue].tap()
// Login Screen: Confirm password login is available and not OIDC.
XCTAssertFalse(app.buttons[A11yIdentifiers.loginScreen.oidc].exists, "The OIDC button shouldn't be shown before entering a supported homeserver.")
// Login Screen: Enter valid credentials
app.textFields[A11yIdentifiers.loginScreen.emailUsername].clearAndTypeText("alice\n")
app.secureTextFields[A11yIdentifiers.loginScreen.password].clearAndTypeText("12345678")
@ -86,7 +83,7 @@ class AuthenticationCoordinatorUITests: XCTestCase {
// Server Confirmation: Tap continue button
app.buttons[A11yIdentifiers.serverConfirmationScreen.continue].tap()
// Then the login form should be updated for OIDC.
XCTAssertTrue(app.buttons[A11yIdentifiers.loginScreen.oidc].waitForExistence(timeout: 1), "The OIDC button should be shown after selecting a homeserver with OIDC.")
// Then the login form shouldn't be shown as OIDC will be used instead.
XCTAssertFalse(app.buttons[A11yIdentifiers.loginScreen.continue].waitForExistence(timeout: 1), "The login screen should not be shown after selecting a homeserver with OIDC.")
}
}