Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core_reportbuilder @javascript
2
Feature: Manage custom report schedules
3
  In order ot manage custom report schedules
4
  As an admin
5
  I need to create new and edit existing report schedules
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username  | firstname | lastname |
10
      | user1     | User      | One      |
11
      | user2     | User      | Two      |
12
      | user3     | User      | Three    |
13
    And the following "core_reportbuilder > Report" exists:
14
      | name    | My report                                |
15
      | source  | core_user\reportbuilder\datasource\users |
16
      | default | 1                                        |
17
    And the following "core_reportbuilder > Audience" exists:
18
      | report     | My report                                          |
19
      | classname  | core_reportbuilder\reportbuilder\audience\allusers |
20
      | configdata |                                                    |
21
 
22
  Scenario: Create report schedule
23
    Given I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
24
    And I click on the "Audience" dynamic tab
25
    # Rename the existing audience.
26
    And I set the field "Rename audience 'All users'" to "All my lovely users"
27
    # Add a second audience.
28
    And I click on "Add audience 'Manually added users'" "link"
29
    And I set the field "Add users manually" to "User One, User Two"
30
    And I press "Save changes"
31
    When I click on the "Schedules" dynamic tab
32
    And I press "New schedule"
33
    And I set the following fields in the "New schedule" "dialogue" to these values:
34
      | Name          | My schedule                 |
35
      | Starting from | ##tomorrow 11:00##          |
36
      | Subject       | You're all I've ever wanted |
37
      | Body          | And my arms are open wide   |
38
    # Confirm each audience is present in the form, select only the manually added users.
39
    And I should see "All my lovely users" in the "New schedule" "dialogue"
40
    And I set the field "Manually added users: User One, User Two" to "1"
41
    And I click on "Save" "button" in the "New schedule" "dialogue"
42
    Then I should see "Schedule created"
43
    And the following should exist in the "Report schedules" table:
1441 ariadna 44
      | Name        | Time last sent | Time next send                          | Modified by |
45
      | My schedule | Never          | ##tomorrow 11:00##%A, %d %B %Y, %H:%M## | Admin User  |
1 efrain 46
 
47
  Scenario: Create report schedule for audience renamed using filters
48
    Given the "multilang" filter is "on"
49
    And the "multilang" filter applies to "content and headings"
50
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
51
    And I click on the "Audience" dynamic tab
52
    And I set the field "Rename audience 'All users'" to "<span class=\"multilang\" lang=\"en\">English</span><span class=\"multilang\" lang=\"es\">Spanish</span>"
53
    When I click on the "Schedules" dynamic tab
54
    And I press "New schedule"
55
    Then I should see "English" in the "New schedule" "dialogue"
56
    And I should not see "Spanish" in the "New schedule" "dialogue"
57
    And I click on "Cancel" "button" in the "New schedule" "dialogue"
58
 
59
  Scenario: Rename report schedule
60
    Given the following "core_reportbuilder > Schedule" exists:
61
      | report | My report   |
62
      | name   | My schedule |
63
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
64
    And I click on the "Schedules" dynamic tab
65
    When I set the field "Edit schedule name" in the "My schedule" "table_row" to "My renamed schedule"
66
    And I reload the page
67
    Then I should see "My renamed schedule" in the "Report schedules" "table"
68
 
69
  Scenario: Rename report schedule using filters
70
    Given the "multilang" filter is "on"
71
    And the "multilang" filter applies to "content and headings"
72
    And the following "core_reportbuilder > Schedule" exists:
73
      | report | My report   |
74
      | name   | My schedule |
75
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
76
    And I click on the "Schedules" dynamic tab
77
    When I set the field "Edit schedule name" in the "My schedule" "table_row" to "<span class=\"multilang\" lang=\"en\">English</span><span class=\"multilang\" lang=\"es\">Spanish</span>"
78
    And I reload the page
79
    Then I should see "English" in the "Report schedules" "table"
80
    And I should not see "Spanish" in the "Report schedules" "table"
81
    # Confirm schedule name is correctly shown in actions.
82
    And I press "Send schedule" action in the "English" report row
83
    And I should see "Are you sure you want to queue the schedule 'English' for sending immediately?" in the "Send schedule" "dialogue"
84
    And I click on "Cancel" "button" in the "Send schedule" "dialogue"
85
    And I press "Delete schedule" action in the "English" report row
86
    And I should see "Are you sure you want to delete the schedule 'English'?" in the "Delete schedule" "dialogue"
87
    And I click on "Cancel" "button" in the "Delete schedule" "dialogue"
88
 
1441 ariadna 89
  Scenario Outline: Filter report schedules by date
90
    Given the following "core_reportbuilder > Schedules" exist:
91
      | report    | name          | timescheduled | timelastsent  |
92
      | My report | My schedule 1 | ##yesterday## | ##yesterday## |
93
      | My report | My schedule 2 | ##tomorrow##  | 0             |
94
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
95
    When I click on the "Schedules" dynamic tab
96
    And I click on "Filters" "button"
97
    And I set the following fields in the "<filter>" "core_reportbuilder > Filter" to these values:
98
      | <filter> operator | Range          |
99
      | <filter> from     | ##2 days ago## |
100
      | <filter> to       | ##today##      |
101
    And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element"
102
    Then I should see "Filters applied"
103
    And I should see "My schedule 1" in the "Report schedules" "table"
104
    And I should not see "My schedule 2" in the "Report schedules" "table"
105
    Examples:
106
      | filter         |
107
      | Time last sent |
108
      | Time next send |
109
 
1 efrain 110
  Scenario: Toggle report schedule
111
    Given the following "core_reportbuilder > Schedules" exist:
112
      | report    | name        |
113
      | My report | My schedule |
114
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
115
    And I click on the "Schedules" dynamic tab
116
    When I click on "Disable schedule" "field" in the "My schedule" "table_row"
117
    Then the "class" attribute of "My schedule" "table_row" should contain "text-muted"
118
    And I click on "Enable schedule" "field" in the "My schedule" "table_row"
119
 
120
  Scenario: Edit report schedule
121
    Given the following "core_reportbuilder > Schedules" exist:
122
      | report    | name        |
123
      | My report | My schedule |
124
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
125
    And I click on the "Schedules" dynamic tab
126
    When I press "Edit schedule details" action in the "My schedule" report row
127
    And I set the following fields in the "Edit schedule details" "dialogue" to these values:
128
      | Name          | My updated schedule |
129
      | Starting from | ##tomorrow 11:00##  |
130
      | All users: All site users | 1       |
131
    And I click on "Save" "button" in the "Edit schedule details" "dialogue"
132
    Then I should see "Schedule updated"
133
    And the following should exist in the "Report schedules" table:
1441 ariadna 134
      | Name                | Time last sent | Time next send                          | Modified by |
135
      | My updated schedule | Never          | ##tomorrow 11:00##%A, %d %B %Y, %H:%M## | Admin User  |
1 efrain 136
 
137
  Scenario: Send report schedule
138
    Given the following "core_reportbuilder > Schedules" exist:
139
      | report    | name        |
140
      | My report | My schedule |
141
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
142
    And I click on the "Schedules" dynamic tab
143
    When I press "Send schedule" action in the "My schedule" report row
144
    And I click on "Confirm" "button" in the "Send schedule" "dialogue"
145
    Then I should see "Schedule sent"
1441 ariadna 146
    And I run all adhoc tasks
147
    And I reload the page
148
    And the following should exist in the "Report schedules" table:
149
      | Name        | Time last sent |
150
      | My schedule | ##today##%A##  |
1 efrain 151
 
152
  Scenario: Delete report schedule
153
    Given the following "core_reportbuilder > Schedules" exist:
154
      | report    | name        |
155
      | My report | My schedule |
156
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
157
    And I click on the "Schedules" dynamic tab
158
    When I press "Delete schedule" action in the "My schedule" report row
159
    And I click on "Delete" "button" in the "Delete schedule" "dialogue"
160
    Then I should see "Schedule deleted"
161
    And I should see "Nothing to display"