Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 15... Línea 15...
15
      | unaddableblocks | | theme_boost|
15
      | unaddableblocks | | theme_boost|
16
   # TODO MDL-57120 site "Badges" link not accessible without navigation block.
16
   # TODO MDL-57120 site "Badges" link not accessible without navigation block.
17
    And I add the "Navigation" block if not present
17
    And I add the "Navigation" block if not present
18
    And I click on "Site pages" "list_item" in the "Navigation" "block"
18
    And I click on "Site pages" "list_item" in the "Navigation" "block"
19
    Given I click on "Site badges" "link" in the "Navigation" "block"
19
    Given I click on "Site badges" "link" in the "Navigation" "block"
20
    Then I should see "There are currently no badges available for users to earn."
20
    Then I should see "There are no matching badges available for users to earn."
Línea 21... Línea 21...
21
 
21
 
22
  @javascript @_file_upload
22
  @javascript @_file_upload
23
  Scenario: Add a badge
23
  Scenario: Add a site badge
24
    Given I navigate to "Badges > Badges settings" in site administration
24
    Given the following config values are set as admin:
25
    And I set the field "Badge issuer name" to "Test Badge Site"
25
      | badges_defaultissuername    | Test Badge Site      |
26
    And I set the field "Badge issuer email address" to "testuser@example.com"
-
 
27
    And I press "Save changes"
26
      | badges_defaultissuercontact | testuser@example.com |
-
 
27
    And I navigate to "Badges > Add a new badge" in site administration
-
 
28
    And the field "issuername" matches value "Test Badge Site"
28
    And I navigate to "Badges > Add a new badge" in site administration
29
    And the field "Email" matches value "testuser@example.com"
29
    And I set the following fields to these values:
30
    And I set the following fields to these values:
30
      | Name | Test badge with 'apostrophe' and other friends (<>&@#) |
31
      | Name           | Test badge with 'apostrophe' and other friends (<>&@#) |
31
      | Version | v1 |
32
      | Version        | v1                                                     |
32
      | Language | English |
33
      | Language       | English                                                |
33
      | Description | Test badge description |
34
      | Description    | Test badge description                                 |
34
      | Image author | http://author.example.com |
35
      | Image caption  | Test caption image                                     |
35
      | Image caption | Test caption image |
36
      | Tags           | Math, Physics                                          |
36
      | Tags | Math, Physics |
37
      | Email          | issuer@example.com                                     |
37
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
38
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
38
    When I press "Create badge"
39
    When I press "Create badge"
39
    Then I should see "Edit details"
40
    Then I should see "Edit details"
40
    And I should see "Test badge with 'apostrophe' and other friends (&@#)"
41
    And I should see "Test badge with 'apostrophe' and other friends (&@#)"
41
    And I should see "Endorsement"
42
    And I should see "Endorsement"
42
    And I should see "Related badges (0)"
43
    And I should see "Related badges (0)"
43
    And I should see "Alignments (0)"
44
    And I should see "Alignments (0)"
44
    And I should not see "Create badge"
-
 
45
    And I should not see "Issuer details"
45
    And I should not see "Create badge"
46
    And I select "Overview" from the "jump" singleselect
46
    And I select "Overview" from the "jump" singleselect
47
    And I should see "Issuer details"
47
    And I should see "Issuer details"
-
 
48
    And I should see "Test Badge Site"
48
    And I should see "Test Badge Site"
49
    And I should see "issuer@example.com"
49
    And I should see "testuser@example.com"
50
    And I should not see "testuser@example.com"
50
    And I should see "Tags"
51
    And I should see "Tags"
51
    And I should see "Math"
52
    And I should see "Math"
52
    And I should see "Physics"
53
    And I should see "Physics"
53
    And I navigate to "Badges > Manage badges" in site administration
54
    And I navigate to "Badges > Manage badges" in site administration
Línea 54... Línea 55...
54
    And I should not see "There are currently no badges available for users to earn."
55
    And I should not see "There are no matching badges available for users to earn."
55
 
56
 
56
  @javascript @_file_upload
57
  @javascript @_file_upload
57
  Scenario: Add a badge related
58
  Scenario: Add a badge related
58
    Given I navigate to "Badges > Add a new badge" in site administration
59
    Given I navigate to "Badges > Add a new badge" in site administration
59
    And I set the following fields to these values:
60
    And I set the following fields to these values:
60
      | Name | Test Badge 1 |
61
      | Name | Test Badge 1 |
61
      | Version | v1 |
62
      | Version | v1 |
62
      | Language | French |
-
 
63
      | Description | Test badge related description |
63
      | Language | French |
64
      | Image author | http://author.example.com |
64
      | Description | Test badge related description |
65
      | Image caption | Test caption image |
65
      | Image caption | Test caption image |
66
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
66
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
67
    And I press "Create badge"
67
    And I press "Create badge"
68
    And I wait until the page is ready
-
 
69
    And I navigate to "Badges > Manage badges" in site administration
68
    And I wait until the page is ready
70
    And I press "Add a new badge"
69
    And I navigate to "Badges > Add a new badge" in site administration
71
    And I set the following fields to these values:
70
    And I set the following fields to these values:
72
      | Name | Test Badge 2 |
71
      | Name | Test Badge 2 |
73
      | Version | v2 |
72
      | Version | v2 |
74
      | Language | English |
-
 
75
      | Description | Test badge description |
73
      | Language | English |
76
      | Image author | http://author.example.com |
74
      | Description | Test badge description |
77
      | Image caption | Test caption image |
75
      | Image caption | Test caption image |
78
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
76
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
79
    And I press "Create badge"
77
    And I press "Create badge"
Línea 93... Línea 91...
93
    And I set the following fields to these values:
91
    And I set the following fields to these values:
94
      | Name | Test Badge Enrolment |
92
      | Name | Test Badge Enrolment |
95
      | Version | v1 |
93
      | Version | v1 |
96
      | Language | English |
94
      | Language | English |
97
      | Description | Test badge description |
95
      | Description | Test badge description |
98
      | Image author | http://author.example.com |
-
 
99
      | Image caption | Test caption image |
96
      | Image caption | Test caption image |
100
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
97
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
101
    When I press "Create badge"
98
    When I press "Create badge"
102
    Then I should see "Edit details"
99
    Then I should see "Edit details"
103
    And I should see "Endorsement"
100
    And I should see "Endorsement"
104
    And I select "Endorsement" from the "jump" singleselect
101
    And I select "Endorsement" from the "jump" singleselect
105
    And I set the following fields to these values:
102
    And I set the following fields to these values:
106
      | Endorser name | Endorser |
103
      | Endorser name       | Endorser                    |
107
      | Email | endorsement@example.com |
104
      | Email               | endorsement@example.com     |
108
      | Issuer URL | http://example.com  |
105
      | URL                 | http://example.com          |
109
      | Claim URL | http://claimurl.example.com |
106
      | Claim URL           | http://claimurl.example.com |
110
      | Endorsement comment | Test Endorsement comment |
107
      | Endorsement comment | Test Endorsement comment    |
111
    And I press "Save changes"
108
    And I press "Save changes"
112
    Then I should see "Changes saved"
109
    Then I should see "Changes saved"
Línea 113... Línea 110...
113
 
110
 
114
  @javascript @_file_upload
111
  @javascript @_file_upload
Línea 117... Línea 114...
117
    And I set the following fields to these values:
114
    And I set the following fields to these values:
118
      | Name | Test Badge |
115
      | Name | Test Badge |
119
      | Version | v1 |
116
      | Version | v1 |
120
      | Language | English |
117
      | Language | English |
121
      | Description | Test badge description |
118
      | Description | Test badge description |
122
      | Image author | http://author.example.com |
-
 
123
      | Image caption | Test caption image |
119
      | Image caption | Test caption image |
124
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
120
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
125
    When I press "Create badge"
121
    When I press "Create badge"
126
    Then I should see "Test Badge"
122
    Then I should see "Test Badge"
127
    And I should see "Endorsement"
123
    And I should see "Endorsement"
Línea 150... Línea 146...
150
    And I set the following fields to these values:
146
    And I set the following fields to these values:
151
      | Name | Test badge with 'apostrophe' and other friends (<>&@#) 2 |
147
      | Name | Test badge with 'apostrophe' and other friends (<>&@#) 2 |
152
      | Version | v1 |
148
      | Version | v1 |
153
      | Language | English |
149
      | Language | English |
154
      | Description | Test badge description |
150
      | Description | Test badge description |
155
      | Image author | http://author.example.com |
-
 
156
      | Image caption | Test caption image |
151
      | Image caption | Test caption image |
157
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
152
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
158
    And I press "Create badge"
153
    And I press "Create badge"
159
    Then I should see "Edit details"
154
    Then I should see "Edit details"
160
    And I should see "Test badge with 'apostrophe' and other friends (&@#) 2"
155
    And I should see "Test badge with 'apostrophe' and other friends (&@#) 2"
161
    And I should see "Endorsement"
156
    And I should see "Endorsement"
162
    And I should see "Related badges (0)"
157
    And I should see "Related badges (0)"
163
    And I should see "Alignments (0)"
158
    And I should see "Alignments (0)"
164
    And I should not see "Create badge"
159
    And I should not see "Create badge"
165
    And I navigate to "Badges > Manage badges" in site administration
160
    And I navigate to "Badges > Manage badges" in site administration
166
    And I should not see "There are currently no badges available for users to earn."
161
    And I should not see "There are no matching badges available for users to earn."
167
    # See buttons from the "Site badges" page.
162
    # See buttons from the "Site badges" page.
168
    And I am on homepage
163
    And I am on homepage
169
    When I click on "Site pages" "list_item" in the "Navigation" "block"
164
    When I click on "Site pages" "list_item" in the "Navigation" "block"
170
    And I click on "Site badges" "link" in the "Navigation" "block"
165
    And I click on "Site badges" "link" in the "Navigation" "block"
171
    Then I should see "Manage badges"
-
 
172
    And I should see "Add a new badge"
166
    Then I should see "Add a new badge"
Línea 173... Línea 167...
173
 
167
 
174
  @javascript @_file_upload
168
  @javascript @_file_upload
175
  Scenario: Edit a badge
-
 
176
    Given I navigate to "Badges > Badges settings" in site administration
169
  Scenario: Edit a site badge
177
    And I set the field "Badge issuer name" to "Test Badge Site"
-
 
178
    And I set the field "Badge issuer email address" to "testuser@example.com"
-
 
179
    And I press "Save changes"
-
 
180
    And I navigate to "Badges > Add a new badge" in site administration
170
    Given the following "core_badges > Badge" exists:
181
    And I set the following fields to these values:
171
      | name           | Testing site badge             |
182
      | Name | Test badge with 'apostrophe' and other friends (<>&@#) |
172
      | status         | inactive                       |
183
      | Version | firstversion |
173
      | version        | 1                              |
184
      | Language | English |
174
      | language       | ca                             |
185
      | Description | Test badge description |
175
      | description    | Test badge description         |
186
      | Image author | http://author.example.com |
176
      | image          | badges/tests/behat/badge.png   |
187
      | Image caption | Test caption image |
177
      | imagecaption   | My caption image               |
188
      | Tags | Math, Physics |
178
      | issuercontact  | testuser@example.com           |
189
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
179
    And the following "core_badges > Criterias" exist:
190
    And I press "Create badge"
180
      | badge              | role           |
191
    When I select "Edit details" from the "jump" singleselect
181
      | Testing site badge | editingteacher |
192
    And I should see "Test badge with 'apostrophe' and other friends (&@#)"
182
    And I navigate to "Badges > Manage badges" in site administration
193
    And I should not see "Issuer details"
183
    When I press "Edit" action in the "Testing site badge" report row
194
    And I should see "Math"
184
    And I should see "Testing site badge"
195
    And I should see "Physics"
185
    And the field "Email" matches value "testuser@example.com"
196
    And I set the following fields to these values:
186
    And I set the following fields to these values:
197
      | Name | Test badge renamed |
187
      | Name           | Test badge with 'apostrophe' and other friends (<>&@#) |
-
 
188
      | Version        | secondversion                                          |
-
 
189
      | Language       | English                                                |
-
 
190
      | Description    | Modified test badge description                        |
198
      | Version | secondversion |
191
      | Image caption  | Test caption image                                     |
-
 
192
      | Tags           | Math, History                                          |
199
      | Tags | Math, History |
193
      | Email          | issuer@invalid.cat                                     |
200
    And I press "Save changes"
194
    And I press "Save changes"
201
    And I select "Overview" from the "jump" singleselect
-
 
202
    Then I should not see "Test badge with 'apostrophe' and other friends (&@#)"
195
    And I select "Overview" from the "jump" singleselect
203
    And I should not see "firstversion"
196
    And I expand all fieldsets
204
    And I should not see "Math, Physics"
197
    Then I should see "Test badge with 'apostrophe' and other friends (&@#)"
205
    And I should see "Test badge renamed"
198
    And I should not see "Testing site badge"
-
 
199
    And I should see "secondversion"
206
    And I should see "secondversion"
200
    And I should not see "firstversion"
207
    And I should see "Math"
201
    And I should see "Math"
-
 
202
    And I should see "History"
-
 
203
    And I should see "issuer@invalid.cat"
-
 
204
    And I should not see "testuser@example.com"
-
 
205
 
-
 
206
  Scenario: Default value for issuer name
-
 
207
    When I navigate to "Badges > Add a new badge" in site administration
-
 
208
    Then the field "issuername" matches value "Acceptance test site"
-
 
209
    But the following config values are set as admin:
-
 
210
      | badges_defaultissuername    | Test Badge Site      |
-
 
211
    And I navigate to "Badges > Add a new badge" in site administration