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 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:
44
      | Name        | Starting from                           | Time last sent | Modified by |
45
      | My schedule | ##tomorrow 11:00##%A, %d %B %Y, %H:%M## | Never          | Admin User  |
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
 
89
  Scenario: Toggle report schedule
90
    Given the following "core_reportbuilder > Schedules" exist:
91
      | report    | name        |
92
      | My report | My schedule |
93
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
94
    And I click on the "Schedules" dynamic tab
95
    When I click on "Disable schedule" "field" in the "My schedule" "table_row"
96
    Then the "class" attribute of "My schedule" "table_row" should contain "text-muted"
97
    And I click on "Enable schedule" "field" in the "My schedule" "table_row"
98
 
99
  Scenario: Edit report schedule
100
    Given the following "core_reportbuilder > Schedules" exist:
101
      | report    | name        |
102
      | My report | My schedule |
103
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
104
    And I click on the "Schedules" dynamic tab
105
    When I press "Edit schedule details" action in the "My schedule" report row
106
    And I set the following fields in the "Edit schedule details" "dialogue" to these values:
107
      | Name          | My updated schedule |
108
      | Starting from | ##tomorrow 11:00##  |
109
      | All users: All site users | 1       |
110
    And I click on "Save" "button" in the "Edit schedule details" "dialogue"
111
    Then I should see "Schedule updated"
112
    And the following should exist in the "Report schedules" table:
113
      | Name                | Starting from                           |
114
      | My updated schedule | ##tomorrow 11:00##%A, %d %B %Y, %H:%M## |
115
 
116
  Scenario: Send report schedule
117
    Given the following "core_reportbuilder > Schedules" exist:
118
      | report    | name        |
119
      | My report | My schedule |
120
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
121
    And I click on the "Schedules" dynamic tab
122
    When I press "Send schedule" action in the "My schedule" report row
123
    And I click on "Confirm" "button" in the "Send schedule" "dialogue"
124
    Then I should see "Schedule sent"
125
 
126
  Scenario: Delete report schedule
127
    Given the following "core_reportbuilder > Schedules" exist:
128
      | report    | name        |
129
      | My report | My schedule |
130
    And I am on the "My report" "reportbuilder > Editor" page logged in as "admin"
131
    And I click on the "Schedules" dynamic tab
132
    When I press "Delete schedule" action in the "My schedule" report row
133
    And I click on "Delete" "button" in the "Delete schedule" "dialogue"
134
    Then I should see "Schedule deleted"
135
    And I should see "Nothing to display"