1 |
efrain |
1 |
@core_reportbuilder @javascript
|
|
|
2 |
Feature: Manage custom report conditions
|
|
|
3 |
In order to manage the conditions of custom reports
|
|
|
4 |
As an admin
|
|
|
5 |
I need to add, edit and delete conditions in a report
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "core_reportbuilder > Reports" exist:
|
|
|
9 |
| name | source | default |
|
|
|
10 |
| My report | core_user\reportbuilder\datasource\users | 0 |
|
|
|
11 |
And the following "core_reportbuilder > Columns" exist:
|
|
|
12 |
| report | uniqueidentifier |
|
|
|
13 |
| My report | user:fullname |
|
|
|
14 |
| My report | user:email |
|
|
|
15 |
And the following "users" exist:
|
|
|
16 |
| username | firstname | lastname | email | interests |
|
|
|
17 |
| user01 | User | One | user01@example.com | lionel, dancing |
|
|
|
18 |
| user02 | User | Two | user02@example.com | |
|
|
|
19 |
|
|
|
20 |
Scenario: Add condition to report
|
|
|
21 |
Given I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
|
|
|
22 |
And I change window size to "large"
|
|
|
23 |
When I click on "Show/hide 'Conditions'" "button"
|
|
|
24 |
Then I should see "There are no conditions selected" in the "[data-region='settings-conditions']" "css_element"
|
|
|
25 |
And I set the field "Select a condition" to "Email address"
|
|
|
26 |
And I should see "Added condition 'Email address'"
|
|
|
27 |
And I should not see "There are no conditions selected" in the "[data-region='settings-conditions']" "css_element"
|
|
|
28 |
And I set the following fields in the "Email address" "core_reportbuilder > Condition" to these values:
|
|
|
29 |
| Email address operator | Does not contain |
|
|
|
30 |
| Email address value | user02 |
|
|
|
31 |
And I click on "Apply" "button" in the "[data-region='settings-conditions']" "css_element"
|
|
|
32 |
And I should see "Conditions applied"
|
|
|
33 |
And I should see "User One" in the "reportbuilder-table" "table"
|
|
|
34 |
And I should not see "User Two" in the "reportbuilder-table" "table"
|
|
|
35 |
|
|
|
36 |
Scenario: Add tags condition to report
|
|
|
37 |
Given the following "core_reportbuilder > Condition" exists:
|
|
|
38 |
| report | My report |
|
|
|
39 |
| uniqueidentifier | tag:name |
|
|
|
40 |
And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
|
|
|
41 |
When I click on "Show/hide 'Conditions'" "button"
|
|
|
42 |
And I set the following fields in the "Tag name" "core_reportbuilder > Condition" to these values:
|
|
|
43 |
| Tag name operator | Is equal to |
|
|
|
44 |
| Tag name value | dancing |
|
|
|
45 |
And I click on "Apply" "button" in the "[data-region='settings-conditions']" "css_element"
|
|
|
46 |
Then I should see "Conditions applied"
|
|
|
47 |
And I should see "User One" in the "reportbuilder-table" "table"
|
|
|
48 |
And I should not see "User Two" in the "reportbuilder-table" "table"
|
|
|
49 |
|
|
|
50 |
Scenario: Move condition in report
|
|
|
51 |
Given the following "core_reportbuilder > Conditions" exist:
|
|
|
52 |
| report | uniqueidentifier |
|
|
|
53 |
| My report | user:fullname |
|
|
|
54 |
| My report | user:email |
|
|
|
55 |
| My report | user:country |
|
|
|
56 |
And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
|
|
|
57 |
When I click on "Show/hide 'Conditions'" "button"
|
|
|
58 |
And I click on "Move condition 'Country'" "button"
|
|
|
59 |
And I click on "After \"Full name\"" "link" in the "Move condition 'Country'" "dialogue"
|
|
|
60 |
Then I should see "Moved condition 'Country'"
|
|
|
61 |
And "Country" "text" should appear before "Email address" "text"
|
|
|
62 |
|
|
|
63 |
Scenario: Delete condition from report
|
|
|
64 |
Given the following "core_reportbuilder > Conditions" exist:
|
|
|
65 |
| report | uniqueidentifier |
|
|
|
66 |
| My report | user:email |
|
|
|
67 |
And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
|
|
|
68 |
And I change window size to "large"
|
|
|
69 |
When I click on "Show/hide 'Conditions'" "button"
|
|
|
70 |
And I set the following fields in the "Email address" "core_reportbuilder > Condition" to these values:
|
|
|
71 |
| Email address operator | Does not contain |
|
|
|
72 |
| Email address value | user02 |
|
|
|
73 |
And I click on "Apply" "button" in the "[data-region='settings-conditions']" "css_element"
|
|
|
74 |
And I click on "Delete condition 'Email address'" "button"
|
|
|
75 |
And I click on "Delete" "button" in the "Delete condition 'Email address'" "dialogue"
|
|
|
76 |
Then I should see "Deleted condition 'Email address'"
|
|
|
77 |
And I should see "There are no conditions selected" in the "[data-region='settings-conditions']" "css_element"
|
|
|
78 |
And "[data-region='active-conditions']" "css_element" should not exist
|
|
|
79 |
And I should see "User One" in the "reportbuilder-table" "table"
|
|
|
80 |
And I should see "User Two" in the "reportbuilder-table" "table"
|
|
|
81 |
|
|
|
82 |
Scenario: Reset conditions in report
|
|
|
83 |
Given the following "core_reportbuilder > Conditions" exist:
|
|
|
84 |
| report | uniqueidentifier |
|
|
|
85 |
| My report | user:email |
|
|
|
86 |
And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
|
|
|
87 |
And I change window size to "large"
|
|
|
88 |
When I click on "Show/hide 'Conditions'" "button"
|
|
|
89 |
And I set the following fields in the "Email address" "core_reportbuilder > Condition" to these values:
|
|
|
90 |
| Email address operator | Does not contain |
|
|
|
91 |
| Email address value | example.com |
|
|
|
92 |
And I click on "Apply" "button" in the "[data-region='settings-conditions']" "css_element"
|
|
|
93 |
And I should see "Nothing to display"
|
|
|
94 |
And I click on "Reset all" "button" in the "[data-region='settings-conditions']" "css_element"
|
|
|
95 |
And I click on "Reset all" "button" in the "Reset conditions" "dialogue"
|
|
|
96 |
Then I should see "Conditions reset"
|
|
|
97 |
And the following fields in the "Email address" "core_reportbuilder > Condition" match these values:
|
|
|
98 |
| Email address operator | Is any value |
|
|
|
99 |
And I should see "User One" in the "reportbuilder-table" "table"
|
|
|
100 |
And I should see "User Two" in the "reportbuilder-table" "table"
|