From 1192cbd58b0bdc3120fdb6d2942020aadd32ee76 Mon Sep 17 00:00:00 2001 From: giokur Date: Tue, 14 Jul 2026 18:16:50 +0200 Subject: [PATCH] update ui tests --- .../openframe/test/pages/AuthEntryPage.java | 119 ++++++++++++++---- .../openframe/test/pages/AuthMethodPage.java | 48 +++---- .../test/pages/DeviceDetailsPage.java | 4 +- .../com/openframe/test/pages/DevicesPage.java | 35 +++++- .../test/pages/NavigationSidebar.java | 54 +++++--- .../openframe/test/pages/SsoLoginPage.java | 6 +- .../test/pages/flow/UILoginFlow.java | 1 + .../openframe/test/tests/ui/BaseUITest.java | 2 +- 8 files changed, 188 insertions(+), 81 deletions(-) diff --git a/openframe-test-service-core/src/main/java/com/openframe/test/pages/AuthEntryPage.java b/openframe-test-service-core/src/main/java/com/openframe/test/pages/AuthEntryPage.java index 8bb057021..84a1d0058 100644 --- a/openframe-test-service-core/src/main/java/com/openframe/test/pages/AuthEntryPage.java +++ b/openframe-test-service-core/src/main/java/com/openframe/test/pages/AuthEntryPage.java @@ -2,21 +2,27 @@ import com.microsoft.playwright.Locator; import com.microsoft.playwright.Page; +import com.microsoft.playwright.options.WaitForSelectorState; import com.microsoft.playwright.options.WaitUntilState; +import java.util.regex.Pattern; + import static com.microsoft.playwright.options.LoadState.NETWORKIDLE; import static com.openframe.test.config.EnvironmentConfig.getAuthUrl; /** * Step 1 – the public landing / auth entry page. - * URL: https://openframe.build/auth/ + * URL: https://openframe.build/auth *

- * Contains two cards: - * • "Create Organization" (out of scope) - * • "Already Have an Account?" ← login entry point + * The left panel is a single card fronted by a Sign Up / Login segmented + * toggle: + * • "Sign Up" → "Create Organization" form (out of scope) + * • "Login" → "Login to OpenFrame" email form (login entry point) *

- * The login card is uniquely identified by its outer wrapper: - * div.bg-ods-bg.border.border-ods-border that contains h1 "Already Have an Account?" + * Selecting "Login" navigates to /auth/login and shows a single email field. + * Submitting the email reveals the auth-method picker inline (see + * {@link AuthMethodPage}) – the URL stays /auth/login, there is no further + * navigation. */ public class AuthEntryPage { @@ -25,12 +31,22 @@ public class AuthEntryPage { private final Page page; // ── Selectors ───────────────────────────────────────────────────────── - // Scoped to the login card to avoid collision with "Create Organization" card - private static final String LOGIN_CARD = "div.bg-ods-bg.border.border-ods-border:has(h1:has-text('Already Have an Account'))"; - // private static final String EMAIL_INPUT = LOGIN_CARD + " input[type='email']"; -// private static final String CONTINUE_BTN = LOGIN_CARD + " button:has-text('Continue')"; - private static final String FORGOT_PWD = LOGIN_CARD + " button:has-text('Forgot password')"; - private static final String PAGE_HEADING = LOGIN_CARD + " h1"; + // Buttons are matched by their rendered text via Playwright's :has-text(), + // which selects the ancestor