Skip to content

fix(e2e): make mobile checks for sidebar and docs tree robust - #806

Merged
pikann merged 2 commits into
masterfrom
fix/fix-failed-e2e-file-testings
Nov 20, 2026
Merged

pikann merged 2 commits into
masterfrom
fix/fix-failed-e2e-file-testings

Conversation

@pikann

@pikann pikann commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the two mobile-safari failures in the Playwright run 44731780646. Both were selector problems that only show up on phone-width viewports, where the sidebar is a closed Sheet and the page breadcrumb is visible.

  • managed-copies.spec.ts: openSidebarOnPhone waited on getByText("Documentation", { exact: true }). On phones the breadcrumb also reads "Documentation", so the locator matched two elements and failed on strict mode. It now targets the tree's button with getByRole("button", { name: "Documentation", exact: true }).
  • file-changes.spec.ts: "a folder created in the general scope appears without a reload" waited for the sidebar's "Trash" link, which never renders while the sidebar Sheet is closed. It now waits for the main landmark, then settleSocket as before.

Test-only change; no app code is touched.

Not changed

docs.spec.ts "Rename an existing folder" was flaky in the same run (passed on retry), so it is left alone.

Test plan

  • managed-copies.spec.ts and file-changes.spec.ts pass on mobile-safari (16/16) and mobile-chrome (16/16) against the local e2e docker stack
  • biome check clean on both files
  • Full Playwright suite in CI

@pikann pikann changed the title fix(tests): update visibility checks for sidebar and main content in … fix(e2e): make mobile checks for sidebar and docs tree robust Nov 20, 2026

@pullfrog pullfrog 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.

Important

The managed-copies fix does not survive the merge: on master the document header renders a second visible button named Documentation, so the new role locator still resolves to two elements and the test keeps failing in CI.

Approach: sound in direction — both failures are phone-only selector problems, and waiting on the page rather than the sidebar is the right call for file-changes. The managed-copies locator is not scoped tightly enough for the app code that master carries today.

Reviewed changes

  • Docs sidebar wait — openSidebarOnPhone moves from getByText("Documentation") to a role-based button locator so the sidebar tree header can be awaited on phones.
  • General-scope wait — the file-changes test replaces the sidebar Trash link wait (never rendered while the mobile Sheet is closed) with a main landmark wait before settleSocket.

⚠️ The branch was cut before the docs/files unification, so the local run cannot reproduce the failing run

The reported failures come from a run on master (6248c313), which includes the docs/files unification; this branch's base (17b6b918) does not. Running the suite on the branch therefore exercises the old docs header (plain text breadcrumb) and proves nothing about the code that will be tested after merge. Rebase onto master and rerun both mobile projects before the test plan's last box is ticked.

Technical details
# Branch base vs. the failing run

## Affected sites
- `apps/web/src/components/projects/docs/document-pane.tsx:254` (master) — builds `crumbs` from the Files path: `[project, ...filePath.data, doc]`; the docs root folder crumb label is "Documentation".
- `apps/web/src/components/shared/path-breadcrumb.tsx:62` (master, `CrumbButton`) — every non-current crumb with `onSelect` renders as `<button>`; the header bar that hosts `PathBreadcrumb` has no responsive hiding.
- `apps/web/src/components/app-shell/app-sidebar.tsx:1113` (master) — docs section header is `<SidebarGroupLabel render={<button />}>` containing `<span>Documentation</span>`.
- `apps/e2e/tests/docs/docs.spec.ts:171` — existing precedent for the scoped handle: `page.getByRole('dialog', { name: 'Sidebar' })`.

## Required outcome
- The fix must pass against the merge of this branch onto `master` (run 44731780646 head, `6248c313`, is the reference), not only against the branch's own base.
- `openSidebarOnPhone` must resolve exactly one element on the docs editor pages after that merge.

## Suggested approach (optional)
- Scope the wait to the Sheet: `page.getByRole("dialog", { name: "Sidebar" })`.
- Alternative: scope by `[data-slot="sidebar"]` inside the Sheet, but the dialog handle already has precedent in this test directory.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Approach: sound — the prior review's recommendation was applied directly, scoping the docs-tree wait to the mobile Sheet so the editor breadcrumb's same-named button can no longer collide.

Reviewed changes

Reviewed the delta since the prior pullfrog review (6624d92d → 18296349).

  • Scoped docs sidebar wait — openSidebarOnPhone now waits on getByRole("dialog", { name: "Sidebar" }) before looking for the Documentation tree button, matching the existing docs.spec.ts handle and excluding the docs editor header's PathBreadcrumb button.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit 0124df6 into master Nov 20, 2026
2 checks passed
@pikann
pikann deleted the fix/fix-failed-e2e-file-testings branch November 20, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant