Add support for Account Provisioning links. (#4108)

* Add support for account provisioning links and route them to the authentication flow.

* Use the provisioning parameters to configure the authentication flow.

* Add UI tests for the provisioned authentication flow.

* Record new preview snapshots.

* Add unit tests.

* Make the domain configurable in the app settings.

* Use the loginHint in the login screen too.
This commit is contained in:
Doug
2025-05-12 13:28:34 +01:00
committed by GitHub
parent 1967c94ec5
commit cb5c7337d2
40 changed files with 698 additions and 159 deletions

View File

@@ -13,6 +13,9 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase {
// Given the authentication flow.
let app = Application.launch(.authenticationFlow)
// Check the bug report flow works.
try await verifyReportBugButton(app)
// Splash Screen: Tap get started button
app.buttons[A11yIdentifiers.authenticationStartScreen.signIn].tap()
@@ -144,4 +147,38 @@ class AuthenticationFlowCoordinatorUITests: XCTestCase {
XCTAssertTrue(wasAlertText.exists, "The web authentication prompt should be shown after selecting a homeserver with OIDC.")
}
func testProvisionedLoginWithPassword() async throws {
// Given a provisioned authentication flow.
let app = Application.launch(.provisionedAuthenticationFlow)
// Then the start screen should be configured appropriately.
try await app.assertScreenshot()
// Check the bug report flow works.
try await verifyReportBugButton(app)
// Splash Screen: Tap get started button
app.buttons[A11yIdentifiers.authenticationStartScreen.signIn].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()
// Bug report: Make sure it exists then cancel.
XCTAssert(app.textFields[A11yIdentifiers.bugReportScreen.report].exists)
app.buttons[A11yIdentifiers.bugReportScreen.cancel].tap()
}
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eea5297a9bded2679b86a8884ddab8e6ebb83ea41d9373759fa38c31cca05e34
size 1371559

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:827b57b732448bab45b2bae268dad31c48b9576e3a9d96a4a382e0ce2e7aa531
size 1210036