|
| 1 | +@tool @tool_monitoring @javascript |
| 2 | +Feature: Tagging metrics |
| 3 | + |
| 4 | + Background: |
| 5 | + Given the following "users" exist: |
| 6 | + | username | firstname | lastname | email | |
| 7 | + | manager1 | Manager | One | manager1@example.com | |
| 8 | + And the following "role assigns" exist: |
| 9 | + | user | role | contextlevel | reference | |
| 10 | + | manager1 | manager | System | | |
| 11 | + |
| 12 | + Scenario Outline: Tag options <should_or_should_not> be shown when the tag area is <tagarea_enabled_or_disabled> and usetags is set to <usetags> |
| 13 | + Given the following config values are set as admin: |
| 14 | + | usetags | <usetags> | |
| 15 | + And the metrics tag area is "<tagarea_enabled_or_disabled>" |
| 16 | + And I am logged in as "manager1" |
| 17 | + When I navigate to "Plugins > Admin tools > Monitoring > Overview" in site administration |
| 18 | + Then "Manage tags" "link" <should_or_should_not> be visible |
| 19 | + When I click on "Configure" "link" in the "users_online" "table_row" |
| 20 | + Then "Configure Metric" "heading" should exist |
| 21 | + And "Tags" "field" <should_or_should_not> be visible |
| 22 | + And I <should_or_should_not> see "Manage standard tags" |
| 23 | + Examples: |
| 24 | + | usetags | tagarea_enabled_or_disabled| should_or_should_not | |
| 25 | + | 0 | disabled | should not | |
| 26 | + | 0 | enabled | should not | |
| 27 | + | 1 | disabled | should not | |
| 28 | + | 1 | enabled | should | |
| 29 | + |
| 30 | + Scenario: Tags can be added to metrics and the overview can be filtered by tags |
| 31 | + Given I am logged in as "manager1" |
| 32 | + And I navigate to "Plugins > Admin tools > Monitoring > Overview" in site administration |
| 33 | + # Add tags to one metric. |
| 34 | + And I click on "Configure" "link" in the "user_accounts" "table_row" |
| 35 | + When I set the following fields to these values: |
| 36 | + | Tags | Foo, Bar | |
| 37 | + And I click on "Save changes" "button" |
| 38 | + Then "Overview of Available Metrics" "heading" should be visible |
| 39 | + # Check that they show up next to it in the overview. |
| 40 | + And "Foo" "link" in the "user_accounts" "table_row" should be visible |
| 41 | + And "Bar" "link" in the "user_accounts" "table_row" should be visible |
| 42 | + # Add tags to another metric. |
| 43 | + When I click on "Configure" "link" in the "overdue_tasks" "table_row" |
| 44 | + And I set the following fields to these values: |
| 45 | + | Tags | Bar, Baz | |
| 46 | + And I click on "Save changes" "button" |
| 47 | + Then "Overview of Available Metrics" "heading" should be visible |
| 48 | + # Check that the right tags appear next to the right metrics in the overview. |
| 49 | + And "Bar" "link" in the "overdue_tasks" "table_row" should be visible |
| 50 | + And "Baz" "link" in the "overdue_tasks" "table_row" should be visible |
| 51 | + And "Foo" "link" should not exist in the "overdue_tasks" "table_row" |
| 52 | + And "Baz" "link" should not exist in the "user_accounts" "table_row" |
| 53 | + # Filter by a tag that the two metrics have in common. |
| 54 | + When I click on "Bar" "link" |
| 55 | + Then "Overview of Available Metrics" "heading" should be visible |
| 56 | + And "overdue_tasks" "table_row" should be visible |
| 57 | + And "user_accounts" "table_row" should be visible |
| 58 | + And "courses" "table_row" should not exist |
| 59 | + And "quiz_attempts_in_progress" "table_row" should not exist |
| 60 | + And "users_online" "table_row" should not exist |
| 61 | + # Additionally filter by a tag that only one of the metric carries. |
| 62 | + When I click on "Baz" "link" |
| 63 | + Then "Overview of Available Metrics" "heading" should be visible |
| 64 | + And "overdue_tasks" "table_row" should be visible |
| 65 | + And "user_accounts" "table_row" should not exist |
| 66 | + And "courses" "table_row" should not exist |
| 67 | + And "quiz_attempts_in_progress" "table_row" should not exist |
| 68 | + And "users_online" "table_row" should not exist |
| 69 | + # Remove that tag filter and add another. |
| 70 | + When I click on "× Baz" "link" |
| 71 | + Then "Overview of Available Metrics" "heading" should be visible |
| 72 | + And "overdue_tasks" "table_row" should be visible |
| 73 | + And "user_accounts" "table_row" should be visible |
| 74 | + And "courses" "table_row" should not exist |
| 75 | + And "quiz_attempts_in_progress" "table_row" should not exist |
| 76 | + And "users_online" "table_row" should not exist |
| 77 | + When I click on "Foo" "link" |
| 78 | + Then "Overview of Available Metrics" "heading" should be visible |
| 79 | + And "user_accounts" "table_row" should be visible |
| 80 | + And "overdue_tasks" "table_row" should not exist |
| 81 | + And "courses" "table_row" should not exist |
| 82 | + And "quiz_attempts_in_progress" "table_row" should not exist |
| 83 | + And "users_online" "table_row" should not exist |
| 84 | + # Reset all filters. |
| 85 | + When I click on "Show all metrics" "link" |
| 86 | + Then "Overview of Available Metrics" "heading" should be visible |
| 87 | + And "courses" "table_row" should be visible |
| 88 | + And "overdue_tasks" "table_row" should be visible |
| 89 | + And "quiz_attempts_in_progress" "table_row" should be visible |
| 90 | + And "user_accounts" "table_row" should be visible |
| 91 | + And "users_online" "table_row" should be visible |
0 commit comments