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