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
@mod @mod_feedback
2
Feature: Saving, using and deleting feedback templates
3
  In order to quickly create feedbacks
4
  As a manager
5
  I need to be able to create feedback templates
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname |
10
      | teacher  | Teacher   | 1        |
11
      | manager  | Manager   | 1        |
12
    And the following "courses" exist:
13
      | fullname | shortname |
14
      | Course 1 | C1        |
15
      | Course 2 | C2        |
16
    And the following "course enrolments" exist:
17
      | user     | course | role           |
18
      | teacher  | C1     | editingteacher |
19
      | teacher  | C2     | editingteacher |
20
    And the following "system role assigns" exist:
21
      | user    | course               | role    |
22
      | manager | Acceptance test site | manager |
23
    And the following "activities" exist:
24
      | activity   | name                         | course | idnumber    |
25
      | feedback   | Learning experience course 1 | C1     | feedback1   |
26
      | feedback   | Another feedback in course 1 | C1     | feedback2   |
27
      | feedback   | Learning experience course 2 | C2     | feedback3   |
28
    And I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
1441 ariadna 29
    And I navigate to "Questions" in current page administration
1 efrain 30
    And I add a "Multiple choice" question to the feedback with:
31
      | Question         | this is a multiple choice 1 |
32
      | Label            | multichoice1                |
33
      | Multiple choice type | Multiple choice - single answer |
34
      | Multiple choice values | option a\noption b\noption c  |
35
    And I log out
36
 
37
  @javascript
38
  Scenario: Teacher can save template and re-use it in the same course only
39
    # Go to feedback templates and make sure none exist yet
40
    When I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
1441 ariadna 41
    And I navigate to "Templates" in current page administration
1 efrain 42
    Then I should see "No templates available yet"
43
    # Save as a course template
1441 ariadna 44
    And I navigate to "Feedback" in current page administration
45
    And I click on "Edit questions" "link" in the "[role=main]" "css_element"
46
    And I press "Actions"
47
    And I choose "Save as template" in the open action menu
48
    And I should see "Save as template" in the ".modal-title" "css_element"
1 efrain 49
    And I should see "Name" in the ".modal-body" "css_element"
50
    And I set the field "Name" to "My first template"
51
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
52
    And I should see "Template saved"
1441 ariadna 53
    And I navigate to "Templates" in current page administration
1 efrain 54
    And I should see "My first template"
55
    # Create a feedback from this template in the same course
56
    And I am on the "Another feedback in course 1" "feedback activity" page
1441 ariadna 57
    And I navigate to "Templates" in current page administration
58
    And I open the action menu in "My first template" "table_row"
59
    And I choose "Use template" in the open action menu
60
    And I click on "Save" "button" in the "Use template" "dialogue"
1 efrain 61
    And I should see "this is a multiple choice 1"
62
    # Make sure this template is not available in another course
63
    And I am on the "Learning experience course 2" "feedback activity" page
1441 ariadna 64
    And I navigate to "Templates" in current page administration
1 efrain 65
    And I should see "No templates available yet"
1441 ariadna 66
    # Make sure Template cannot be created without questions
67
    And I am on the "Learning experience course 2" "feedback activity" page
68
    And I navigate to "Questions" in current page administration
69
    And I press "Actions"
70
    And I should not see "Save as template"
1 efrain 71
 
72
  @javascript
73
  Scenario: Teacher can append template to existing questions or remove them
74
    # Save feedback as a course template
75
    When I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
1441 ariadna 76
    And I navigate to "Questions" in current page administration
77
    And I press "Actions"
78
    And I choose "Save as template" in the open action menu
79
    And I should see "Save as template" in the ".modal-title" "css_element"
1 efrain 80
    And I should see "Name" in the ".modal-body" "css_element"
81
    And I set the field "Name" to "My first template"
82
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
1441 ariadna 83
    And I press "Actions"
84
    And I choose "Save as template" in the open action menu
1 efrain 85
    # Add questions to another feedback
86
    And I am on the "Another feedback in course 1" "feedback activity" page
1441 ariadna 87
    And I navigate to "Questions" in current page administration
1 efrain 88
    And I add a "Multiple choice" question to the feedback with:
89
      | Question         | What is your favourite subject |
90
      | Label            | subjectchoice                  |
91
      | Multiple choice type | Multiple choice - single answer   |
92
      | Multiple choice values | Maths\bScience\nEnglish\nOther  |
93
    # Import template appending items
1441 ariadna 94
    And I navigate to "Templates" in current page administration
95
    And I open the action menu in "My first template" "table_row"
96
    And I choose "Use template" in the open action menu
97
    And I set the field "Keep existing questions and add new questions at the end" to "1"
98
    And I click on "Save" "button" in the "Use template" "dialogue"
1 efrain 99
    Then "What is your favourite subject" "text" should appear before "this is a multiple choice 1" "text"
1441 ariadna 100
    # Import template replacing items (through Preview page)
101
    And I navigate to "Templates" in current page administration
102
    And I open the action menu in "My first template" "table_row"
103
    And I choose "Preview" in the open action menu
104
    And I press "Actions"
105
    And I choose "Use template" in the open action menu
106
    And I set the field "Override existing questions" to "1"
107
    And I click on "Save" "button" in the "Use template" "dialogue"
1 efrain 108
    And I should see "this is a multiple choice 1"
109
    And I should not see "What is your favourite subject"
110
    And I should see "this is a multiple choice 1"
111
 
112
  @javascript
113
  Scenario: Manager can save template as public and it will be available in any course
114
    When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
1441 ariadna 115
    And I navigate to "Questions" in current page administration
116
    And I press "Actions"
117
    And I choose "Save as template" in the open action menu
1 efrain 118
    And I set the field "Name" to "My first template"
1441 ariadna 119
    And I set the field "Available for all courses" to "1"
1 efrain 120
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
121
    And I log out
122
    And I am on the "Learning experience course 2" "feedback activity" page logged in as teacher
1441 ariadna 123
    And I navigate to "Templates" in current page administration
124
    And I open the action menu in "My first template" "table_row"
125
    And I choose "Use template" in the open action menu
126
    And I set the field "Override existing questions" to "1"
127
    And I click on "Save" "button" in the "Use template" "dialogue"
1 efrain 128
    Then I should see "this is a multiple choice 1"
129
 
130
  @javascript
131
  Scenario: Teacher can delete course templates but can not delete public templates
132
    # Save feedback as both public and course template
133
    When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
1441 ariadna 134
    And I navigate to "Questions" in current page administration
135
    And I press "Actions"
136
    And I choose "Save as template" in the open action menu
1 efrain 137
    And I set the field "Name" to "My public template"
1441 ariadna 138
    And I set the field "Available for all courses" to "1"
1 efrain 139
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
1441 ariadna 140
    And I press "Actions"
141
    And I choose "Save as template" in the open action menu
1 efrain 142
    And I set the field "Name" to "My course template"
143
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
144
    And I log out
145
    # Login as teacher and try to delete templates
146
    And I am on the "Another feedback in course 1" "feedback activity" page logged in as teacher
1441 ariadna 147
    And I navigate to "Templates" in current page administration
148
    And I open the action menu in "My public template" "table_row"
1 efrain 149
    Then I should not see "Delete"
1441 ariadna 150
    And I choose "Preview" in the open action menu
151
    And I press "Actions"
152
    And I should not see "Delete"
1 efrain 153
    And I click on "Back" "link" in the ".tertiary-navigation" "css_element"
154
    And "My course template" "text" should exist in the ".coursetemplates" "css_element"
1441 ariadna 155
    And I open the action menu in "My course template" "table_row"
156
    And I choose "Delete" in the open action menu
1 efrain 157
    And I click on "Yes" "button"
158
    And I should see "Template deleted"
159
    And "My course template" "text" should not exist in the ".coursetemplates" "css_element"
160
    And "No templates available yet" "text" should exist in the ".coursetemplates" "css_element"
161
 
1441 ariadna 162
  @javascript @accessibility
1 efrain 163
  Scenario: Manager can delete both course and public templates
164
    # Save feedback as both public and course template
165
    When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
1441 ariadna 166
    And I navigate to "Questions" in current page administration
167
    And the "region-main" "region" should meet accessibility standards with "best-practice" extra tests
168
    And I press "Actions"
169
    And I choose "Save as template" in the open action menu
1 efrain 170
    And I set the field "Name" to "My public template"
1441 ariadna 171
    And I set the field "Available for all courses" to "1"
1 efrain 172
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
1441 ariadna 173
    And I press "Actions"
174
    And I choose "Save as template" in the open action menu
1 efrain 175
    And I set the field "Name" to "My course template"
176
    And I click on "Save" "button" in the ".modal-dialog" "css_element"
1441 ariadna 177
    And I navigate to "Templates" in current page administration
178
    And the "region-main" "region" should meet accessibility standards with "best-practice" extra tests
179
    And "My course template" "text" should exist in the ".coursetemplates" "css_element"
1 efrain 180
    # Delete course template
1441 ariadna 181
    And I open the action menu in "My course template" "table_row"
182
    And I choose "Delete" in the open action menu
1 efrain 183
    And I should see "Are you sure you want to delete this template?"
184
    And I press "Yes"
1441 ariadna 185
    Then I should see "Template deleted"
1 efrain 186
    And "My course template" "text" should not exist in the ".coursetemplates" "css_element"
187
    And "No templates available yet" "text" should exist in the ".coursetemplates" "css_element"
188
    And "My public template" "text" should exist in the ".publictemplates" "css_element"
1441 ariadna 189
    # Delete course template (through Preview page)
190
    And I open the action menu in "My public template" "table_row"
191
    And I choose "Preview" in the open action menu
192
    And I press "Actions"
193
    And I choose "Delete" in the open action menu
1 efrain 194
    And I should see "Are you sure you want to delete this template?"
195
    And I press "Yes"
196
    And I should see "Template deleted"
197
    And "My public template" "text" should not exist in the ".publictemplates" "css_element"
198
    And "No templates available yet" "text" should exist in the ".publictemplates" "css_element"