Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/resources/report/partials/tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<span id="activeTagName"></span>
<button type="button" class="tag-clear-btn" onclick="clearTagFilter()" title="Clear tag filter">&times;</button>
</span>
<span class="expand-controls">
<button type="button" class="filter-btn" onclick="setAllDetails(true)">Expand all</button>
<button type="button" class="filter-btn" onclick="setAllDetails(false)">Collapse all</button>
</span>
<div class="search-wrap">
<span class="search-icon">&#128269;</span>
<input type="text" id="searchInput" placeholder="Search by test, class, or tag..." oninput="applySearch()">
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/report/report.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
.filter-bar { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.filter-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); border-radius: 16px; padding: 4px 14px; font-size: 13px; cursor: pointer; transition: all .15s; }
.filter-btn:hover, .filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.expand-controls { display: inline-flex; gap: 8px; margin-left: 8px; }
.search-wrap { margin-left: auto; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 20px; padding: 4px 14px; background: var(--surface2); }
.search-wrap input { border: none; background: transparent; outline: none; font-size: 13px; color: var(--text); width: 200px; }
.search-wrap input::placeholder { color: var(--text-secondary); }
Expand Down Expand Up @@ -474,6 +475,7 @@
.sidebar,
.filter-bar,
.filter-btn,
.expand-controls,
.search-wrap,
.dark-toggle,
.copy-failure-btn,
Expand Down
60 changes: 45 additions & 15 deletions src/main/resources/report/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,27 @@ function toggleDetail(idx) {
if (icon) icon.classList.toggle('open', !isOpen);
}

// ── Expand all / collapse all (tests matching the active filter and search) ──
function setAllDetails(open) {
const q = document.getElementById('searchInput').value.toLowerCase();
if (open) {
document.querySelectorAll('#testTable tbody tr.group-header').forEach(hdr => {
if (hdr.style.display === 'none') return;
const icon = document.getElementById('gicon-' + hdr.getAttribute('data-group'));
if (icon) icon.classList.remove('closed');
});
}
document.querySelectorAll('#testTable tbody tr.group-member.expandable').forEach(row => {
if (!rowMatches(row, q) || !groupIsOpen(row.getAttribute('data-group'))) return;
const detail = row.nextElementSibling;
if (!detail || !detail.classList.contains('detail-row')) return;
row.style.display = '';
detail.style.display = open ? '' : 'none';
const icon = row.querySelector('.expand-icon');
if (icon) icon.classList.toggle('open', open);
});
}

// ── Tag filtering ──
let activeTagFilter = '';
function filterByTag(tagName, event) {
Expand Down Expand Up @@ -152,27 +173,36 @@ function setFilter(status, btn) {
} catch (e) {}
applySearch();
}
function rowMatches(row, q) {
const rowStatus = row.getAttribute('data-status') || '';
const rowTest = row.getAttribute('data-test') || '';
const groupId = row.getAttribute('data-group') || '';
const rowTags = (row.getAttribute('data-tags') || '').split(',').map(t => t.trim().toLowerCase()).filter(Boolean);
const hasRetry = row.querySelector('.retry-badge') !== null;
const matchFilter = activeFilter === 'ALL'
|| activeFilter === rowStatus
|| (activeFilter === 'FLAKY' && hasRetry);
const matchTag = !activeTagFilter || rowTags.includes(activeTagFilter);
const matchSearch = !q
|| rowTest.includes(q)
|| groupId.toLowerCase().includes(q)
|| rowTags.some(t => t.includes(q));
return matchFilter && matchTag && matchSearch;
}
function groupIsOpen(groupId) {
const icon = document.getElementById('gicon-' + groupId);
return !icon || !icon.classList.contains('closed');
}
function applySearch() {
const q = document.getElementById('searchInput').value.toLowerCase();
const members = document.querySelectorAll('#testTable tbody tr.group-member:not(.detail-row)');
const visibleGroups = new Set();
members.forEach(row => {
const rowStatus = row.getAttribute('data-status') || '';
const rowTest = row.getAttribute('data-test') || '';
const groupId = row.getAttribute('data-group') || '';
const rowTags = (row.getAttribute('data-tags') || '').split(',').map(t => t.trim().toLowerCase()).filter(Boolean);
const hasRetry = row.querySelector('.retry-badge') !== null;
const matchFilter = activeFilter === 'ALL'
|| activeFilter === rowStatus
|| (activeFilter === 'FLAKY' && hasRetry);
const matchTag = !activeTagFilter || rowTags.includes(activeTagFilter);
const matchSearch = !q
|| rowTest.includes(q)
|| groupId.toLowerCase().includes(q)
|| rowTags.some(t => t.includes(q));
const show = matchFilter && matchTag && matchSearch;
const groupId = row.getAttribute('data-group') || '';
const match = rowMatches(row, q);
const show = match && groupIsOpen(groupId);
row.style.display = show ? '' : 'none';
if (show) visibleGroups.add(groupId);
if (match) visibleGroups.add(groupId);
const next = row.nextElementSibling;
if (next && next.classList.contains('detail-row') && !show) next.style.display = 'none';
});
Expand Down
Loading