Ui Login Flow
OpenFrame Documentation
Get the most out of OpenFrame · Book 30 minutes with Conrad, 25 years in IT. He'll show you what Mingo and Fae can take off your list.
OpenFrame Documentation
Ui Login Flow is a Playwright page-object workflow that signs an end-to-end test user into the OpenFrame web application through the built-in OpenFrame single sign-on path. It packages the navigation, form interaction, redirect, and ready-state assertion into one login operation and returns a NavigationSidebar only after the dashboard is usable.
The implementation belongs to the openframe-test-service-core library from OpenFrame OSS Library. This tenant repository runs that library as part of its OpenFrame test service. The authoritative implementation is UILoginFlow.java.
UILoginFlow accepts an existing Playwright Page and provides:
NavigationSidebar page object for test steps that follow successful authentication.The flow is deliberately an orchestration layer. It does not own selectors or authentication protocol logic. Those concerns remain in the page objects and authorization services that it coordinates.
| Input or result | Meaning |
|---|---|
Page |
Browser tab or page supplied when the flow is constructed. |
email |
Identifier entered in the application login form and again in the SSO form. |
password |
Credential entered only in the SSO password field. |
NavigationSidebar |
Postcondition object returned after the dashboard is confirmed ready. |
Ui Login Flow runs in the test process, while the browser communicates with the tenant deployment through the gateway. The gateway routes the application request and the authorization request to different services. The page-object workflow observes the rendered application; it does not call authorization APIs directly.
flowchart LR
TestCase["End-to-end test"] --> UiLoginFlow["Ui Login Flow"]
UiLoginFlow --> PlaywrightPage["Playwright Page"]
UiLoginFlow --> AuthEntryPage["Authentication entry page"]
AuthEntryPage --> AuthMethodPage["Authentication method page"]
AuthMethodPage --> SsoLoginPage["SSO login page"]
SsoLoginPage --> DashboardPage["Dashboard page"]
DashboardPage --> NavigationSidebar["Navigation sidebar"]
PlaywrightPage --> Gateway["OpenFrame gateway"]
Gateway --> Frontend["OpenFrame frontend"]
Gateway --> AuthorizationServer["Authorization server"]
AuthorizationServer --> OAuthBff["OAuth backend for frontend"]
| Component | Responsibility in Ui Login Flow |
|---|---|
UILoginFlow |
Chains page-object actions, waits for DashboardPage.isLoaded, and returns the sidebar abstraction. |
AuthEntryPage |
Navigates to the authentication entry route, selects Login, fills the email field, and waits for the OpenFrame SSO provider control. Its email entry routine re-fills until the client-side controlled input retains the expected value. |
AuthMethodPage |
Clicks Continue with OpenFrame and waits for a URL containing /sas/login. |
SsoLoginPage |
Fills #username and #password, submits #submitBtn, and waits until the browser leaves the SSO login route. |
DashboardPage |
Defines the stronger ready check: a dashboard URL, a visible main navigation sidebar, and an active Dashboard navigation item. |
NavigationSidebar |
Provides stable navigation actions for subsequent test steps after authentication. |
| Authorization server | Renders the credential login endpoint and validates local or configured identity-provider authentication flows. |
| OAuth backend for frontend | Starts authorization redirects, handles callback token exchange, writes authentication cookies, refreshes tokens, and processes logout. |
The login(email, password) method executes the following ordered interaction. Each page object supplies its own navigation or visibility synchronization, and Ui Login Flow adds the final application-readiness condition.
sequenceDiagram
participant Test as Test case
participant Flow as Ui Login Flow
participant Entry as Authentication entry page
participant Methods as Authentication method page
participant Sso as SSO login page
participant Auth as Authorization server
participant App as Frontend dashboard
Test->>Flow: login(email, password)
Flow->>Entry: navigate()
Entry->>App: Load authentication entry route
Flow->>Entry: switchToLogin()
Entry->>App: Render login email form
Flow->>Entry: submitEmail(email)
Entry->>Methods: Wait for OpenFrame provider
Flow->>Methods: clickSignInWithOpenFrameSso()
Methods->>Auth: Navigate to SSO login route
Flow->>Sso: login(email, password)
Sso->>Auth: Submit credentials
Auth-->>App: Redirect after successful authentication
Flow->>App: Wait until dashboard is loaded
App-->>Flow: Dashboard URL, sidebar, active Dashboard item
Flow-->>Test: Navigation sidebar
stateDiagram-v2
[*] --> AuthEntry
AuthEntry --> LoginForm: Login tab selected
LoginForm --> ProviderAvailable: Email retained and provider visible
ProviderAvailable --> SsoCredentials: OpenFrame provider selected
SsoCredentials --> DashboardLoading: Credentials accepted
DashboardLoading --> Authenticated: Dashboard checks pass
SsoCredentials --> LoginRejected: Credentials rejected
LoginRejected --> SsoCredentials: Retry credentials
Authenticated --> [*]
The workflow has two distinct success checks:
SsoLoginPage waits until the browser URL no longer contains /sas/login after submission.DashboardPage.isLoaded. That predicate requires a dashboard URL, a visible main navigation sidebar, and the Dashboard navigation item marked as the current page.This second check prevents a test from proceeding after a redirect that has occurred before the single-page application has rendered its usable shell.
The visible credential form is served by the authorization service LoginController at /login. An error query parameter causes the server to expose an Invalid credentials message, and an optional password-reset page configuration exposes a reset link.
For external identity-provider callbacks, SsoFlowSuccessHandler identifies the activated SSO flow by state and delegates it to the appropriate handler. LoginSsoHandler is the regular login finalizer. It:
The OAuth backend for frontend creates the authorization redirect, stores temporary state in a cookie, handles the callback, writes access and refresh authentication cookies, and clears the temporary state. It also offers refresh and logout endpoints. Ui Login Flow does not inspect cookies or tokens; its observable contract is the dashboard-ready browser state.
flowchart TD
Start["Start login"] --> EntryReady{"Entry form ready?"}
EntryReady -->|"no"| EntryTimeout["Fail on page-object wait"]
EntryReady -->|"yes"| ProviderReady{"OpenFrame provider visible?"}
ProviderReady -->|"no"| ProviderTimeout["Fail on visibility wait"]
ProviderReady -->|"yes"| SsoRoute{"SSO route reached?"}
SsoRoute -->|"no"| SsoRouteTimeout["Fail on URL wait"]
SsoRoute -->|"yes"| CredentialsAccepted{"Browser leaves SSO route?"}
CredentialsAccepted -->|"no"| CredentialFailure["Credential form remains or wait expires"]
CredentialsAccepted -->|"yes"| DashboardReady{"Dashboard predicate passes?"}
DashboardReady -->|"no"| DashboardTimeout["Fail before sidebar is returned"]
DashboardReady -->|"yes"| Success["Return navigation sidebar"]
Important diagnostic boundaries:
/sas/login isolates the failure to provider selection or the redirect into the authorization server.SsoLoginPage retains helpers that let a caller inspect the email value and whether the browser is still on that route.login method focused on orchestration. Update selectors, URL waits, and rendering-specific synchronization in the dedicated page objects.DashboardPage.isLoaded condition when changing redirects or frontend routing. URL-only waiting is insufficient because the dashboard must render the main navigation and mark Dashboard as active.