mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Show an account provider picker on the server confirmation screen when required. (#4137)
* Add a picker mode to the ServerConfirmationScreen. * Hook up the account provider picker in authentication the flow. Simplify the authentication flow coordinator, removing the restricted state. * UI/Snapshot tests.
This commit is contained in:
@@ -202,6 +202,32 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase {
|
||||
app.buttons[A11yIdentifiers.loginScreen.continue].tap()
|
||||
}
|
||||
|
||||
func testMultipleProvidersLoginWithPassword() async throws {
|
||||
// Given the authentication flow with only 2 allowed servers.
|
||||
let app = Application.launch(.multipleProvidersAuthenticationFlow)
|
||||
|
||||
// Then the start screen should be configured appropriately.
|
||||
try await app.assertScreenshot()
|
||||
|
||||
// Splash Screen: Tap get started button
|
||||
app.buttons[A11yIdentifiers.authenticationStartScreen.signIn].tap()
|
||||
|
||||
// Server Confirmation: Tap the picker and confirm
|
||||
app.switches.matching(identifier: A11yIdentifiers.serverConfirmationScreen.serverPicker).element(boundBy: 1).tap()
|
||||
app.buttons[A11yIdentifiers.serverConfirmationScreen.continue].tap()
|
||||
|
||||
// Login Screen: Wait for continue button to appear
|
||||
let continueButton = app.buttons[A11yIdentifiers.loginScreen.continue]
|
||||
XCTAssertTrue(continueButton.waitForExistence(timeout: 2.0))
|
||||
|
||||
// Login Screen: Enter valid credentials
|
||||
app.textFields[A11yIdentifiers.loginScreen.emailUsername].clearAndTypeText("alice\n", app: app)
|
||||
app.secureTextFields[A11yIdentifiers.loginScreen.password].clearAndTypeText("12345678", app: app)
|
||||
|
||||
// Login Screen: Tap next
|
||||
app.buttons[A11yIdentifiers.loginScreen.continue].tap()
|
||||
}
|
||||
|
||||
func verifyReportBugButton(_ app: XCUIApplication) async throws {
|
||||
// Splash Screen: Report a problem button.
|
||||
app.buttons[A11yIdentifiers.authenticationStartScreen.reportAProblem].tap()
|
||||
|
||||
Reference in New Issue
Block a user