Skip to content

docs: document what find() can and cannot see (#236) (CP: 25.3) - #241

Merged
mcollovati merged 2 commits into
25.3from
cherry-pick-236-to-25.3-1789739858466
Sep 18, 2026
Merged

mcollovati merged 2 commits into
25.3from
cherry-pick-236-to-25.3-1789739858466

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This PR cherry-picks changes from the original PR #236 to branch 25.3.

Original PR description

Summary

Corrects the documentation of what find() can reach. A closed context menu is not attached to the UI, so its items cannot be clicked — the old Javadoc and README said open() was optional, which was wrong. This also names the grid context menu tester as the way in for grid menus.

Fixes #218

What changed

This is a documentation-only change. No code behaviour changes, and nothing becomes incompatible — the runtime already threw IllegalStateException for these calls; only the docs were wrong.

  • ContextMenuTester: the class and method Javadoc no longer claim that open() is optional. It now states that clickItem(...), isItemChecked(...) and getItemTooltipText(...) need the menu to be open and otherwise throw IllegalStateException. The @throws IllegalStateException tags list the closed menu as a cause. Only the tester-scoped find(Class) works on a closed menu, and it returns detached components.
  • ComponentQuery: adds a short note that a query walks the server-side component tree, and that per-item rendered components and closed overlay content are not in it. Since a query returns an empty result instead of failing, such a component reads as if it was never created.
  • README: rewrites the closed-menu paragraph to match the real behaviour and adds a paragraph on GridContextMenu, whose tester takes a row (test(grid).contextMenu(row), GridContextMenuTester.open(row)).
  • find(Class) entry points (BaseBrowserlessTest, BrowserlessUIContext, ComponentTester, AbstractBrowserlessExtension): the pointers now name GridTester.contextMenu(row).open() for grid context menus, because GridContextMenu is not a ContextMenu and ContextMenuTester does not apply to it.

Test summary

  • A tester-scoped find(...) on a context menu that was never opened finds the items and returns them detached; after open() the same items are attached.
  • A top-level find(...) does not see the component a grid component column renders per row, confirming that such components are not part of the component tree.

totally-not-ai Bot and others added 2 commits September 18, 2026 13:57
Corrects the documentation of what `find()` can reach. A closed context
menu is not attached to the UI, so its items cannot be clicked — the old
Javadoc and README said `open()` was optional, which was wrong. This
also names the grid context menu tester as the way in for grid menus.

Fixes #218
@mcollovati
mcollovati enabled auto-merge (squash) September 18, 2026 14:36
@mcollovati
mcollovati merged commit 9ecff1a into 25.3 Sep 18, 2026
6 checks passed
@mcollovati
mcollovati deleted the cherry-pick-236-to-25.3-1789739858466 branch September 18, 2026 14:41
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.

2 participants