Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core_reportbuilder @javascript
2
Feature: Manage custom report columns aggregation
3
  In order to manage the aggregation for columns of custom reports
4
  As an admin
5
  I need to select an aggregation for columns
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email              | confirmed | lastaccess     |
10
      | user01   | Bill      | Richie   | user01@example.com | 1         | ##2 days ago## |
11
      | user02   | Ben       | Richie   | user02@example.com | 1         | ##3 days ago## |
12
      | user03   | Bill      | Richie   | user03@example.com | 0         | ##3 days ago## |
13
 
14
  Scenario Outline: Aggregate a text column
15
    Given the following "core_reportbuilder > Reports" exist:
16
      | name      | source                                   | default |
17
      | My report | core_user\reportbuilder\datasource\users | 0       |
18
    And the following "core_reportbuilder > Columns" exist:
19
      | report    | uniqueidentifier |
20
      | My report | user:lastname    |
21
      | My report | user:firstname   |
22
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
23
    And I change window size to "large"
24
    When I set the "First name" column aggregation to "<aggregation>"
25
    Then I should see "Aggregated column 'First name'"
26
    And I should see "<output>" in the "Richie" "table_row"
27
    Examples:
28
      | aggregation                     | output          |
29
      | Comma separated distinct values | Ben, Bill       |
30
      | Comma separated values          | Ben, Bill, Bill |
31
      | Count                           | 3               |
32
      | Count distinct                  | 2               |
33
 
34
  Scenario Outline: Aggregate a text column containing multiple fields
35
    Given the following "core_reportbuilder > Reports" exist:
36
      | name      | source                                   | default |
37
      | My report | core_user\reportbuilder\datasource\users | 0       |
38
    And the following "core_reportbuilder > Columns" exist:
39
      | report    | uniqueidentifier |
40
      | My report | user:lastname    |
41
      | My report | user:fullname    |
42
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
43
    And I change window size to "large"
44
    When I set the "Full name" column aggregation to "<aggregation>"
45
    Then I should see "Aggregated column 'Full name'"
46
    And I should see "<output>" in the "Richie" "table_row"
47
    Examples:
48
      | aggregation                     | output                               |
49
      | Comma separated distinct values | Ben Richie, Bill Richie              |
50
      | Comma separated values          | Ben Richie, Bill Richie, Bill Richie |
51
      | Count                           | 3                                    |
52
      | Count distinct                  | 2                                    |
53
 
54
  Scenario Outline: Aggregate a time column
55
    Given the following "core_reportbuilder > Reports" exist:
56
      | name      | source                                   | default |
57
      | My report | core_user\reportbuilder\datasource\users | 0       |
58
    And the following "core_reportbuilder > Columns" exist:
59
      | report    | uniqueidentifier |
60
      | My report | user:lastname    |
61
      | My report | user:lastaccess  |
62
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
63
    And I change window size to "large"
64
    When I set the "Last access" column aggregation to "<aggregation>"
65
    Then I should see "Aggregated column 'Last access'"
66
    And I should see "<output>" in the "Richie" "table_row"
67
    Examples:
68
      | aggregation    | output                       |
69
      | Count          | 3                            |
70
      | Count distinct | 2                            |
71
      | Maximum        | ##2 days ago##%A, %d %B %Y## |
72
      | Minimum        | ##3 days ago##%A, %d %B %Y## |
73
 
74
  Scenario Outline: Aggregate a boolean column
75
    Given the following "core_reportbuilder > Reports" exist:
76
      | name      | source                                   | default |
77
      | My report | core_user\reportbuilder\datasource\users | 0       |
78
    And the following "core_reportbuilder > Columns" exist:
79
      | report    | uniqueidentifier |
80
      | My report | user:lastname    |
81
      | My report | user:confirmed   |
82
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
83
    And I change window size to "large"
84
    When I set the "Confirmed" column aggregation to "<aggregation>"
85
    Then I should see "Aggregated column 'Confirmed'"
86
    And I should see "<output>" in the "Richie" "table_row"
87
    Examples:
88
      | aggregation                     | output       |
89
      | Comma separated distinct values | No, Yes      |
90
      | Comma separated values          | No, Yes, Yes |
91
      | Count                           | 3            |
92
      | Count distinct                  | 2            |
93
      | Maximum                         | Yes          |
94
      | Minimum                         | No           |
95
      | Average                         | 0.7          |
96
      | Percentage                      | 66.7%        |
97
      | Sum                             | 2            |
98
 
99
  Scenario Outline: Aggregated columns display localised floats
100
    Given the following "language customisations" exist:
101
      | component       | stringid | value |
102
      | core_langconfig | decsep   | ,     |
103
    And the following "core_reportbuilder > Reports" exist:
104
      | name      | source                                   | default |
105
      | My report | core_user\reportbuilder\datasource\users | 0       |
106
    And the following "core_reportbuilder > Columns" exist:
107
      | report    | uniqueidentifier |
108
      | My report | user:lastname    |
109
      | My report | user:confirmed   |
110
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
111
    And I change window size to "large"
112
    When I set the "Confirmed" column aggregation to "<aggregation>"
113
    Then I should see "Aggregated column 'Confirmed'"
114
    And I should see "<output>" in the "Richie" "table_row"
115
    Examples:
116
      | aggregation | output |
117
      | Average     | 0,7    |
118
      | Percentage  | 66,7%  |
119
 
120
  Scenario Outline: Aggregated columns display localised list separators
121
    Given the following "language customisations" exist:
122
      | component       | stringid | value |
123
      | core_langconfig | listsep  | ;     |
124
    And the following "core_reportbuilder > Reports" exist:
125
      | name      | source                                   | default |
126
      | My report | core_user\reportbuilder\datasource\users | 0       |
127
    And the following "core_reportbuilder > Columns" exist:
128
      | report    | uniqueidentifier |
129
      | My report | user:lastname    |
130
      | My report | user:firstname   |
131
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
132
    And I change window size to "large"
133
    When I set the "First name" column aggregation to "<aggregation>"
134
    Then I should see "Aggregated column 'First name'"
135
    And I should see "<output>" in the "Richie" "table_row"
136
    Examples:
137
      | aggregation                     | output          |
138
      | Comma separated distinct values | Ben; Bill       |
139
      | Comma separated values          | Ben; Bill; Bill |
140
 
141
  Scenario: Show unique report rows
142
    Given the following "core_reportbuilder > Reports" exist:
143
      | name      | source                                   | default | uniquerows |
144
      | My report | core_user\reportbuilder\datasource\users | 0       | 1          |
145
    And the following "core_reportbuilder > Columns" exist:
146
      | report    | uniqueidentifier |
147
      | My report | user:firstname   |
148
      | My report | user:lastname    |
149
    When I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
150
    Then the following should exist in the "reportbuilder-table" table:
151
      | -1-        | -2-     |
152
      | Admin      | User    |
153
      | Ben        | Richie  |
154
      | Bill       | Richie  |
155
    # Assert there is no 4th row (duplicate Bill Richie) because we're showing unique rows.
156
    And "//table[@data-region='reportbuilder-table']/tbody/tr[not(@class = 'emptyrow')][4]" "xpath_element" should not exist
157
    And I set the "First name" column aggregation to "Comma separated values"
158
    And the following should exist in the "reportbuilder-table" table:
159
      | -1-             | -2-     |
160
      | Admin           | User    |
161
      | Ben, Bill, Bill | Richie  |