From 936393fb666c7da96d12648519a0595e2f1c4546 Mon Sep 17 00:00:00 2001 From: Tim de Groot Date: Wed, 16 Sep 2026 01:32:38 +0200 Subject: [PATCH] fix: pre-select project tag when navigating from overview card (#327) Run tag checkbox ids were prefixed with "runTagCheckBox" in #222, but filter_runtags still compared input.id against the bare project tag set by the overview card click. No checkbox matched, "All" got unchecked and the dashboard showed 0 runs with the tag filter indicator active. Compare input.value (raw tag name) instead. Adds a robot test that clicks a project card in run-tags mode and asserts the resulting filter state, and fixes a typo in Validate Filter Settings that made the runTags branch unconditional. --- robotframework_dashboard/js/filter.js | 3 ++- .../resources/keywords/dashboard-keywords.resource | 13 ++++++++++++- tests/robot/testsuites/06_filters.robot | 7 +++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/robotframework_dashboard/js/filter.js b/robotframework_dashboard/js/filter.js index c16d776f..79b1a102 100644 --- a/robotframework_dashboard/js/filter.js +++ b/robotframework_dashboard/js/filter.js @@ -181,7 +181,8 @@ function filter_runtags(runs) { if (selectedTagSetting != '') { for (const input of tagElements) { input.checked = false; - if (input.id === selectedTagSetting) { + // checkbox ids are prefixed with "runTagCheckBox", the value holds the raw tag name + if (input.value === selectedTagSetting) { input.checked = true; } } diff --git a/tests/robot/resources/keywords/dashboard-keywords.resource b/tests/robot/resources/keywords/dashboard-keywords.resource index 77ffafba..b0a1a3b9 100644 --- a/tests/robot/resources/keywords/dashboard-keywords.resource +++ b/tests/robot/resources/keywords/dashboard-keywords.resource @@ -41,6 +41,17 @@ Open Overview Page Wait For Elements State selector=id=overviewLatestRunsSection Wait For Elements State selector=id=overviewTotalStatsSection +Enable Run Tags On Overview Page + Click selector=id=settings + Click selector=id=overview-tab + Click selector=id=switchRunTags + Click selector=id=closeSettings + +Open Dashboard Page From Overview Project Card + [Arguments] ${project} + Click selector=id=overviewLatest${project}Card0 + Wait For Elements State selector=id=runStatisticsSection + Open Compare Page Click selector=id=menuCompare Wait For Elements State selector=id=compareStatisticsSection @@ -207,7 +218,7 @@ Validate Filter Settings Open Filter Dialog IF len("${runs}") Get Selected Options id=runs value == ${runs} - IF len("S{run_tags}") + IF len("${runTags}") VAR @{selected_run_tags} @{EMPTY} ${elements} Get Elements selector=id=runTag >> css=input.form-check-input FOR ${element} IN @{elements} diff --git a/tests/robot/testsuites/06_filters.robot b/tests/robot/testsuites/06_filters.robot index 2b3f2ffd..f99a1c98 100644 --- a/tests/robot/testsuites/06_filters.robot +++ b/tests/robot/testsuites/06_filters.robot @@ -36,6 +36,13 @@ Validate Dashboard Run Tags Filter Validate Component id=runStatisticsSection name=runTagsFilterAmount folder=run Should Show 1 Of 1 Runs +Validate Dashboard Run Tags Filter From Overview Project Card + Open Overview Page + Enable Run Tags On Overview Page + Open Dashboard Page From Overview Project Card project=project_1 + Should Show 8 Of 8 Runs + Validate Filter Settings runTags=project_1 + Validate Dashboard Date Filter Set Date Filter fromDate=03132025 fromTime=1225am Validate Component id=runStatisticsSection name=runDateFilter folder=run