Skip to content

test(styling): make e2e navigation flag-agnostic for top nav - #3453

Merged
baktun14 merged 2 commits into
mainfrom
test/styling-e2e-top-nav-navigation
Jul 17, 2026
Merged

test(styling): make e2e navigation flag-agnostic for top nav#3453
baktun14 merged 2 commits into
mainfrom
test/styling-e2e-top-nav-navigation

Conversation

@baktun14

@baktun14 baktun14 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Why

PR #3448 introduced a flag-gated top navigation (ui_top_nav) that replaces the sidebar shell. The Playwright e2e suite (apps/deploy-web/tests/ui) was written against the sidebar and fails wherever the flag is on. Most notably, loginExistingUser waited on the nav's wallet-balance label (dropped from the top nav), so every userType: "existing" spec failed at login. Deploy/Alerts/API-Keys navigation and the "logged-in" signal also moved.

Ref CON e2e stability for the top-nav rollout.

What

Makes the e2e navigation shell-agnostic so specs pass whether ui_top_nav is on (top nav) or off (sidebar):

  • Rename pages/Sidebar.tspages/AppNav.ts. Each method detects the rendered shell (only the top nav exposes nav[aria-label="Primary"]) and routes accordingly:
    • openDeploy() — sidebar: the Deploy link; top nav: Deployments → the page's Deploy CTA (works from any page).
    • openAlerts() / openApiKeys() — sidebar: link / account-menu; top nav: the Settings dropdown menuitem.
    • accountMenuButton() — the authenticated-shell signal, present in both shells.
  • Switch the login / "logged-in" waits from the removed wallet-balance label to the account-menu button (actions/auth.ts, pages/HomePage.ts, onboarding-gate.spec.ts). The wallet balance now lives in the home "Available Balance" card; its removal from the nav is intended.
  • Repoint all importers (actions/deploy.ts, ConfigureDeploymentPage.ts, and the deployment/alerts/notification-channels/api-keys specs) to AppNav.

Verification: eslint --quiet clean on all changed files; tsc --noEmit shows no new errors (179, unchanged baseline). Full Playwright run requires a live env and was not executed locally.

Summary by CodeRabbit

  • Tests

    • Updated UI specs for deployments, alerts, API keys, managed-wallet flows, Linux deploy, and authentication/onboarding to use a unified navigation helper.
    • Adjusted sign-in/onboarding assertions to wait for the authenticated account menu instead of a wallet label.
    • Updated UI page objects (Home, Configure Deployment) to route via the shared navigation path.
  • Refactor

    • Added AppNav to handle navigation across both legacy sidebar and flag-gated top navigation shells.
    • Removed the old Sidebar page-object and migrated callers to AppNav.

The flag-gated top nav (ui_top_nav) replaces the sidebar with a different
shell: no Deploy link, Alerts and API Keys behind a Settings dropdown, and
no wallet-balance element. The Playwright suite navigated via the sidebar, so
it failed wherever the flag is on (login itself broke, since loginExistingUser
waited on the nav's wallet-balance label).

Rename the Sidebar page object to AppNav and have each method detect the
rendered shell (only the top nav exposes nav[aria-label="Primary"]) and act
accordingly, so specs pass whether ui_top_nav is on or off. Switch the
authenticated-shell signal from the wallet-balance label to the account-menu
button, present in both shells.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3e3a2201-9f5c-44a5-b278-2e5a493805b8

📥 Commits

Reviewing files that changed from the base of the PR and between be5d060 and b1fce89.

📒 Files selected for processing (1)
  • apps/deploy-web/tests/ui/pages/AppNav.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/deploy-web/tests/ui/pages/AppNav.ts

📝 Walkthrough

Walkthrough

The deploy-web UI tests add AppNav for legacy and top-navigation shells, replace Sidebar usage, and use the account menu as the authenticated-shell readiness indicator.

Changes

AppNav navigation migration

Layer / File(s) Summary
Cross-shell AppNav abstraction
apps/deploy-web/tests/ui/pages/AppNav.ts
Adds navigation helpers that select between top navigation and legacy shell interactions.
Authenticated shell synchronization
apps/deploy-web/tests/ui/pages/HomePage.ts, apps/deploy-web/tests/ui/actions/auth.ts, apps/deploy-web/tests/ui/onboarding-gate.spec.ts
Uses the authenticated account menu for shell readiness and sign-in interactions.
Page-object and test navigation updates
apps/deploy-web/tests/ui/actions/deploy.ts, apps/deploy-web/tests/ui/pages/ConfigureDeploymentPage.ts, apps/deploy-web/tests/ui/*spec.ts
Replaces Sidebar navigation with AppNav across deployment, alerts, API keys, and notification-channel flows.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested reviewers: stalniy

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/styling-e2e-top-nav-navigation

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.98%. Comparing base (6a917a3) to head (b1fce89).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3453      +/-   ##
==========================================
- Coverage   73.05%   71.98%   -1.08%     
==========================================
  Files        1175     1085      -90     
  Lines       29793    27444    -2349     
  Branches     7402     6936     -466     
==========================================
- Hits        21765    19755    -2010     
+ Misses       7068     6759     -309     
+ Partials      960      930      -30     
Flag Coverage Δ *Carryforward flag
api 85.93% <ø> (ø) Carriedforward from be5d060
deploy-web 62.34% <ø> (-0.01%) ⬇️
log-collector ?
notifications 91.44% <ø> (ø) Carriedforward from be5d060
provider-console 81.38% <ø> (ø) Carriedforward from be5d060
provider-inventory ?
provider-proxy 86.42% <ø> (ø) Carriedforward from be5d060
tx-signer ?

*This pull request uses carry forward flags. Click here to find out more.
see 91 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: all changes are related to tests.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/deploy-web/tests/ui/pages/AppNav.ts`:
- Around line 55-56: Update isTopNav() to wait for the shared account-menu
button or the primary navigation element to become available before checking
which navigation is present. Do not rely solely on the immediate count()
snapshot, so openDeploy() correctly detects the top-nav shell after goto(..., {
waitUntil: "commit" }).

In `@apps/deploy-web/tests/ui/pages/ConfigureDeploymentPage.ts`:
- Around line 20-26: Update ConfigureDeploymentPage.open so it waits for the
application shell to be ready after page.goto before calling AppNav.openDeploy.
Use accountMenuButton() or the established shell-ready signal, while preserving
the existing commit navigation and deploy-opening flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b510524c-bfde-4fe5-8292-79eddec49cf6

📥 Commits

Reviewing files that changed from the base of the PR and between 6a917a3 and be5d060.

📒 Files selected for processing (12)
  • apps/deploy-web/tests/ui/actions/auth.ts
  • apps/deploy-web/tests/ui/actions/deploy.ts
  • apps/deploy-web/tests/ui/deploy-linux.spec.ts
  • apps/deploy-web/tests/ui/managed-wallet-alerts.spec.ts
  • apps/deploy-web/tests/ui/managed-wallet-api-keys.spec.ts
  • apps/deploy-web/tests/ui/managed-wallet-deployment.spec.ts
  • apps/deploy-web/tests/ui/managed-wallet-notification-channels.spec.ts
  • apps/deploy-web/tests/ui/onboarding-gate.spec.ts
  • apps/deploy-web/tests/ui/pages/AppNav.ts
  • apps/deploy-web/tests/ui/pages/ConfigureDeploymentPage.ts
  • apps/deploy-web/tests/ui/pages/HomePage.ts
  • apps/deploy-web/tests/ui/pages/Sidebar.ts
💤 Files with no reviewable changes (1)
  • apps/deploy-web/tests/ui/pages/Sidebar.ts

Comment thread apps/deploy-web/tests/ui/pages/AppNav.ts
Comment thread apps/deploy-web/tests/ui/pages/ConfigureDeploymentPage.ts

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: all changes are related to tests.

@baktun14
baktun14 enabled auto-merge July 17, 2026 14:43
@baktun14
baktun14 added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit 096d14f Jul 17, 2026
57 checks passed
@baktun14
baktun14 deleted the test/styling-e2e-top-nav-navigation branch July 17, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant