Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_group
2
Feature: Automatic updating of groups and groupings
3
  In order to check the expected results occur when updating groups and groupings in different scenarios
4
  As a teacher
5
  I need to create groups and groupings under different scenarios and check that the expected result occurs when attempting to update them.
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | format |
10
      | Course 1 | C1 | topics |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email |
13
      | teacher1 | Teacher | 1 | teacher1@example.com |
14
    And the following "course enrolments" exist:
15
      | user | course | role |
16
      | teacher1 | C1 | editingteacher |
17
    And I log in as "teacher1"
18
    And I am on the "Course 1" "groups" page
19
    And I press "Create group"
20
    And I set the following fields to these values:
21
      | Group name | Group (without ID) |
22
    And I press "Save changes"
23
    And I press "Create group"
24
    And I set the following fields to these values:
25
      | Group name | Group (with ID) |
26
      | Group ID number | An ID |
27
    And I press "Save changes"
28
    And I set the field "Participants tertiary navigation" to "Groupings"
29
    And I press "Create grouping"
30
    And I set the following fields to these values:
31
      | Grouping name | Grouping (without ID) |
32
    And I press "Save changes"
33
    And I press "Create grouping"
34
    And I set the following fields to these values:
35
      | Grouping name | Grouping (with ID) |
36
      | Grouping ID number | An ID |
37
    And I press "Save changes"
38
    And I set the field "Participants tertiary navigation" to "Groups"
39
 
40
  @javascript
41
  Scenario: Update groups and groupings with ID numbers
42
    Given I set the field "groups" to "Group (with ID)"
43
    And I press "Edit group settings"
44
    And the field "idnumber" matches value "An ID"
45
    And I set the following fields to these values:
46
      | Group name | Group (with ID) (updated) |
47
      | Group ID number | An ID (updated) |
48
    When I press "Save changes"
49
    Then I should see "Group (with ID) (updated)"
50
    And I set the field "groups" to "Group (with ID) (updated)"
51
    And I press "Edit group settings"
52
    And the field "idnumber" matches value "An ID (updated)"
53
    And I press "Save changes"
54
    And I set the field "Participants tertiary navigation" to "Groupings"
55
    And I click on "Edit" "link" in the "Grouping (with ID)" "table_row"
56
    And the field "idnumber" matches value "An ID"
57
    And I set the following fields to these values:
58
      | Grouping name | Grouping (with ID) (updated) |
59
      | Grouping ID number | An ID (updated) |
60
    And I press "Save changes"
61
    And I should see "Grouping (with ID) (updated)"
62
    And I click on "Edit" "link" in the "Grouping (with ID) (updated)" "table_row"
63
    And the field "idnumber" matches value "An ID (updated)"
64
 
65
  @javascript @skip_chrome_zerosize
66
  Scenario: Update groups and groupings with ID numbers without the 'moodle/course:changeidnumber' capability
67
    Given the following "role capability" exists:
68
      | role                         | editingteacher |
69
      | moodle/course:changeidnumber | prevent        |
70
    And I log in as "teacher1"
71
    And I am on the "Course 1" "groups" page
72
    And I set the field "groups" to "Group (with ID)"
73
    When I press "Edit group settings"
74
    Then the "idnumber" "field" should be readonly
75
    And the field "idnumber" matches value "An ID"
76
    And I set the following fields to these values:
77
      | Group name | Group (with ID) (updated) |
78
    And I press "Save changes"
79
    And I should see "Group (with ID) (updated)"
80
    And I set the field "groups" to "Group (with ID) (updated)"
81
    And I press "Edit group settings"
82
    And the "idnumber" "field" should be readonly
83
    And the field "idnumber" matches value "An ID"
84
    And I press "Save changes"
85
    And I set the field "Participants tertiary navigation" to "Groupings"
86
    And I click on "Edit" "link" in the "Grouping (with ID)" "table_row"
87
    And the "idnumber" "field" should be readonly
88
    And the field "idnumber" matches value "An ID"
89
    And I set the following fields to these values:
90
      | Grouping name | Grouping (with ID) (updated) |
91
    And I press "Save changes"
92
    And I should see "Grouping (with ID) (updated)"
93
    And I click on "Edit" "link" in the "Grouping (with ID) (updated)" "table_row"
94
    And the "idnumber" "field" should be readonly
95
    And the field "idnumber" matches value "An ID"
96
 
97
  @javascript
98
  Scenario: Update groups with enrolment key
99
    Given the following "courses" exist:
100
      | fullname | shortname |
101
      | Course 2 | C2 |
102
    And the following "course enrolments" exist:
103
      | user | course | role |
104
      | teacher1 | C2 | editingteacher |
105
    And I log out
106
    And I log in as "teacher1"
107
    And I am on the "Course 1" "groups" page
108
    And I set the field "groups" to "Group (with ID)"
109
    And I press "Edit group settings"
110
    And I set the following fields to these values:
111
      | Enrolment key | badpasswd |
112
    When I press "Save changes"
113
    Then I should see "Passwords must have at least 1 digit(s)"
114
    And I set the following fields to these values:
115
      | Enrolment key | Abcdef-1 |
116
    And I press "Save changes"
117
    And I set the field "groups" to "Group (with ID)"
118
    And I press "Edit group settings"
119
    And I press "Save changes"
120
    And I should not see "This enrolment key is already used for another group."
121
    And I set the field "groups" to "Group (without ID)"
122
    And I press "Edit group settings"
123
    And I set the following fields to these values:
124
      | Enrolment key | Abcdef-1 |
125
    And I press "Save changes"
126
    And I should see "This enrolment key is already used for another group."
127
    And I set the following fields to these values:
128
      | Enrolment key | Abcdef-2 |
129
    And I press "Save changes"
130
    And I should not see "This enrolment key is already used for another group."
131
    And I am on the "Course 2" "groups" page
132
    And I press "Create group"
133
    And I set the following fields to these values:
134
      | Group name | Group A |
135
    And I press "Save changes"
136
    And I should not see "This enrolment key is already used for another group."
137
    And I set the field "groups" to "Group A"
138
    And I press "Edit group settings"
139
    And I set the following fields to these values:
140
      | Enrolment key | Abcdef-1 |
141
    And I press "Save changes"
142
    And I should not see "This enrolment key is already used for another group."
143
 
144
  @javascript
145
  Scenario: Visibility and Participation settings are locked once a group has members
146
    Given I set the field "groups" to "Group (with ID)"
147
    And I press "Edit group settings"
148
    And "visibility" "select" should exist
149
    And the field "Group membership visibility" matches value "Visible"
150
    And the "participation" "checkbox" should be enabled
151
    And the field "Show group in dropdown menu for activities in group mode" matches value "1"
152
    When the following "group members" exist:
153
      | user     | group |
154
      | teacher1 | An ID |
155
    And I reload the page
156
    Then "visibility" "select" should not exist
157
    And "Visible" "text" should exist
158
    And the "participation" "checkbox" should be disabled
159
    And the field "Show group in dropdown menu for activities in group mode" matches value "1"