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:
Doug
2025-05-20 17:21:08 +01:00
committed by GitHub
parent 18519c15dd
commit 5197e41928
31 changed files with 436 additions and 109 deletions
@@ -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()