From d4a7aa1395377e90498149dbfc05366e6e797708 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 30 May 2024 17:03:00 +0100 Subject: [PATCH] MDL-82006 reportbuilder: move filter Behat scenarios inside component. --- admin/tests/behat/task_logs.feature | 22 ------------------- .../tests/behat/customreports.feature | 22 +++++++++++++++++++ .../tests/behat/filtereditor.feature | 8 +++++-- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/admin/tests/behat/task_logs.feature b/admin/tests/behat/task_logs.feature index 86466dbd0da..78a95d69359 100644 --- a/admin/tests/behat/task_logs.feature +++ b/admin/tests/behat/task_logs.feature @@ -48,25 +48,3 @@ Feature: View task logs report and use its filters | operator | shouldornotsee | | Less than | should not see | | Greater than | should see | - - @javascript - Scenario: Reset task log filters - Given I log in as "admin" - And I change window size to "large" - And I navigate to "Server > Tasks > Task logs" in site administration - When I click on "Filters" "button" - And I set the following fields in the "Result" "core_reportbuilder > Filter" to these values: - | Result operator | Is equal to | - | Result value | Fail | - And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" - Then I should see "Filters applied" - And I should see "Filters (1)" in the "#dropdownFiltersButton" "css_element" - And I should see "Nothing to display" - And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element" - And I should see "Filters reset" - And I should not see "Filters (1)" in the "#dropdownFiltersButton" "css_element" - And I should see "Filters" in the "#dropdownFiltersButton" "css_element" - And "[data-region='report-filters']" "css_element" should be visible - And the following fields in the "Result" "core_reportbuilder > Filter" match these values: - | Result operator | Is any value | - And I should not see "Nothing to display" diff --git a/reportbuilder/tests/behat/customreports.feature b/reportbuilder/tests/behat/customreports.feature index 296017516fd..88285d76879 100644 --- a/reportbuilder/tests/behat/customreports.feature +++ b/reportbuilder/tests/behat/customreports.feature @@ -197,6 +197,28 @@ Feature: Manage custom reports And I should see "Nothing to display" And "Reports list" "table" should not exist + Scenario: Reset filters in system report + Given the following "core_reportbuilder > Report" exists: + | name | My report | + | source | core_user\reportbuilder\datasource\users | + And I log in as "admin" + When I navigate to "Reports > Report builder > Custom reports" in site administration + And I click on "Filters" "button" + And I set the following fields in the "Name" "core_reportbuilder > Filter" to these values: + | Name operator | Contains | + | Name value | Lionel | + And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" + And I should see "Filters (1)" in the "#dropdownFiltersButton" "css_element" + And I should see "Nothing to display" + And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element" + And I should not see "Filters (1)" in the "#dropdownFiltersButton" "css_element" + And I should see "Filters" in the "#dropdownFiltersButton" "css_element" + And "[data-region='report-filters']" "css_element" should be visible + Then I should see "Filters reset" + And the following fields in the "Name" "core_reportbuilder > Filter" match these values: + | Name operator | Is any value | + And I should see "My report" in the "Reports list" "table" + Scenario: Custom report tags are not displayed if tagging is disabled Given the following config values are set as admin: | usetags | 0 | diff --git a/reportbuilder/tests/behat/filtereditor.feature b/reportbuilder/tests/behat/filtereditor.feature index be3e718adf1..0a23e22b37c 100644 --- a/reportbuilder/tests/behat/filtereditor.feature +++ b/reportbuilder/tests/behat/filtereditor.feature @@ -92,7 +92,7 @@ Feature: Manage custom report filters And I should see "There are no filters selected" in the "[data-region='active-filters']" "css_element" And I should not see "Email address" in the "[data-region='active-filters']" "css_element" - Scenario: Reset filters in report + Scenario: Reset filters in custom report Given the following "core_reportbuilder > Reports" exist: | name | source | | My report | core_user\reportbuilder\datasource\users | @@ -102,12 +102,16 @@ Feature: Manage custom report filters | Full name operator | Contains | | Full name value | Lionel | And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" + And I should see "Filters (1)" in the "#dropdownFiltersButton" "css_element" And I should see "Nothing to display" And I click on "Reset all" "button" in the "[data-region='report-filters']" "css_element" + And I should not see "Filters (1)" in the "#dropdownFiltersButton" "css_element" + And I should see "Filters" in the "#dropdownFiltersButton" "css_element" + And "[data-region='report-filters']" "css_element" should be visible Then I should see "Filters reset" And the following fields in the "Full name" "core_reportbuilder > Filter" match these values: | Full name operator | Is any value | - And I should see "Admin User" in the "reportbuilder-table" "table" + And I should see "Admin User" in the "Users" "table" Scenario: Use report filters when previewing report Given the following "users" exist: