Skip to content

Make tree search match the package path of the test result (fixes #1077) - #3416

Open
zocek wants to merge 1 commit into
allure-framework:mainfrom
zocek:fix-1077-packages-search-fullname
Open

Make tree search match the package path of the test result (fixes #1077)#3416
zocek wants to merge 1 commit into
allure-framework:mainfrom
zocek:fix-1077-packages-search-fullname

Conversation

@zocek

@zocek zocek commented Jul 2, 2026

Copy link
Copy Markdown

Context

Searching on the Packages tab cannot find tests by their package path (fixes #1077).

Two things break it today:

  1. The tree text filter only matches the displayed node name. In the Packages tab the group names are dot-collapsed package segments (e.g. io.qameta.allurePullRequestsWebTest), so a query that spans segment boundaries (e.g. allure.PullRequestsWebTest or a full package path) matches no node name at all.
  2. Even when a query does match a group name, the bottom-up tree projection has already dropped all of the group's non-matching leaves, and the resulting empty group is then hidden by the status filter (byStatuses requires children.length > 0) — so the user ends up with no results whatsoever.

This change computes a searchPath for every tree node during normalization (normalizeNodes) — the dot-joined names of the node's ancestors plus its own name — and lets the tree text filter (byText) match it. A query for a package, a class, or any dotted-path substring now matches the leaves themselves, so the package is shown together with its tests. The fix is frontend-only and works for every data source, since the path is derived from the tree structure itself. The display is unchanged — searchPath is only consulted by the search.

Since byText is shared tree plumbing, searching a group name on the Suites/Behaviors/Categories tabs now also reveals the tests inside that group instead of showing nothing, which matches the expectation described in the issue.

Tests: Playwright e2e cases in tree.shared.spec.mts — searching across collapsed package segments and by root package on the Packages tab, and searching a suite (class) name on the Suites tab. All three assertions fail without this fix.

Checklist

@baev baev removed the theme:ui label Jul 27, 2026
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.

Search functionality in Packages Tab searches for test instead of package name in allure-2

2 participants