Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_badges
2
Feature: Add badges to the system
3
  In order to give badges to users for their achievements
4
  As an admin
5
  I need to manage badges in the system
6
 
7
  Background:
8
    Given I am on homepage
9
    And I log in as "admin"
10
 
11
  @javascript
12
  Scenario: Accessing the badges
13
    And I turn editing mode on
14
    And the following config values are set as admin:
15
      | unaddableblocks | | theme_boost|
16
   # TODO MDL-57120 site "Badges" link not accessible without navigation block.
17
    And I add the "Navigation" block if not present
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"
20
    Then I should see "There are currently no badges available for users to earn."
21
 
22
  @javascript @_file_upload
23
  Scenario: Add a badge
24
    Given I navigate to "Badges > Badges settings" in site administration
25
    And I set the field "Badge issuer name" to "Test Badge Site"
26
    And I set the field "Badge issuer email address" to "testuser@example.com"
27
    And I press "Save changes"
28
    And I navigate to "Badges > Add a new badge" in site administration
29
    And I set the following fields to these values:
30
      | Name | Test badge with 'apostrophe' and other friends (<>&@#) |
31
      | Version | v1 |
32
      | Language | English |
33
      | Description | Test badge description |
34
      | Image author | http://author.example.com |
35
      | Image caption | Test caption image |
36
      | Tags | Math, Physics |
37
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
38
    When I press "Create badge"
39
    Then I should see "Edit details"
40
    And I should see "Test badge with 'apostrophe' and other friends (&@#)"
41
    And I should see "Endorsement"
42
    And I should see "Related badges (0)"
43
    And I should see "Alignments (0)"
44
    And I should not see "Create badge"
45
    And I should not see "Issuer details"
46
    And I select "Overview" from the "jump" singleselect
47
    And I should see "Issuer details"
48
    And I should see "Test Badge Site"
49
    And I should see "testuser@example.com"
50
    And I should see "Tags"
51
    And I should see "Math"
52
    And I should see "Physics"
53
    And I navigate to "Badges > Manage badges" in site administration
54
    And I should not see "There are currently no badges available for users to earn."
55
 
56
  @javascript @_file_upload
57
  Scenario: Add a badge related
58
    Given I navigate to "Badges > Add a new badge" in site administration
59
    And I set the following fields to these values:
60
      | Name | Test Badge 1 |
61
      | Version | v1 |
62
      | Language | French |
63
      | Description | Test badge related description |
64
      | Image author | http://author.example.com |
65
      | Image caption | Test caption image |
66
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
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
70
    And I press "Add a new badge"
71
    And I set the following fields to these values:
72
      | Name | Test Badge 2 |
73
      | Version | v2 |
74
      | Language | English |
75
      | Description | Test badge description |
76
      | Image author | http://author.example.com |
77
      | Image caption | Test caption image |
78
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
79
    And I press "Create badge"
80
    And I select "Related badges (0)" from the "jump" singleselect
81
    And I should see "This badge does not have any related badges."
82
    And I press "Add related badge"
83
    And I follow "Related badges"
84
    And I wait until the page is ready
85
    And I follow "Related badges"
86
    And I set the field "relatedbadgeids[]" to "Test Badge 1 (version: v1, language: French, Site badges)"
87
    When I press "Save changes"
88
    Then I should see "Related badges (1)"
89
 
90
  @javascript @_file_upload
91
  Scenario: Endorsement for Badge
92
    Given I navigate to "Badges > Add a new badge" in site administration
93
    And I set the following fields to these values:
94
      | Name | Test Badge Enrolment |
95
      | Version | v1 |
96
      | Language | English |
97
      | Description | Test badge description |
98
      | Image author | http://author.example.com |
99
      | Image caption | Test caption image |
100
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
101
    When I press "Create badge"
102
    Then I should see "Edit details"
103
    And I should see "Endorsement"
104
    And I select "Endorsement" from the "jump" singleselect
105
    And I set the following fields to these values:
106
      | Endorser name | Endorser |
107
      | Email | endorsement@example.com |
108
      | Issuer URL | http://example.com  |
109
      | Claim URL | http://claimurl.example.com |
110
      | Endorsement comment | Test Endorsement comment |
111
    And I press "Save changes"
112
    Then I should see "Changes saved"
113
 
114
  @javascript @_file_upload
115
  Scenario: Alignments for Badge
116
    Given I navigate to "Badges > Add a new badge" in site administration
117
    And I set the following fields to these values:
118
      | Name | Test Badge |
119
      | Version | v1 |
120
      | Language | English |
121
      | Description | Test badge description |
122
      | Image author | http://author.example.com |
123
      | Image caption | Test caption image |
124
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
125
    When I press "Create badge"
126
    Then I should see "Test Badge"
127
    And I should see "Endorsement"
128
    And I select "Alignments (0)" from the "jump" singleselect
129
    And I should see "This badge does not have any external skills or standards specified."
130
    And I press "Add external skill or standard"
131
    And I set the following fields to these values:
132
      | Name | Test Badge Alignments |
133
      | URL | https://alignments.example.com |
134
      | Description | Test Badge Alignments description |
135
    When I press "Save changes"
136
    And I should see "Alignments (1)"
137
 
138
  @javascript @_file_upload
139
  Scenario: Add a badge from Site badges section
140
    Given I turn editing mode on
141
    And the following config values are set as admin:
142
      | unaddableblocks | | theme_boost|
143
    # TODO MDL-57120 site "Badges" link not accessible without navigation block.
144
    And I add the "Navigation" block if not present
145
    When I click on "Site pages" "list_item" in the "Navigation" "block"
146
    And I click on "Site badges" "link" in the "Navigation" "block"
147
    Then I should see "Add a new badge"
148
    # Add a badge.
149
    When I press "Add a new badge"
150
    And I set the following fields to these values:
151
      | Name | Test badge with 'apostrophe' and other friends (<>&@#) 2 |
152
      | Version | v1 |
153
      | Language | English |
154
      | Description | Test badge description |
155
      | Image author | http://author.example.com |
156
      | Image caption | Test caption image |
157
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
158
    And I press "Create badge"
159
    Then I should see "Edit details"
160
    And I should see "Test badge with 'apostrophe' and other friends (&@#) 2"
161
    And I should see "Endorsement"
162
    And I should see "Related badges (0)"
163
    And I should see "Alignments (0)"
164
    And I should not see "Create badge"
165
    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."
167
    # See buttons from the "Site badges" page.
168
    And I am on homepage
169
    When I click on "Site pages" "list_item" in the "Navigation" "block"
170
    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"
173
 
174
  @javascript @_file_upload
175
  Scenario: Edit a badge
176
    Given I navigate to "Badges > Badges settings" in site administration
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
181
    And I set the following fields to these values:
182
      | Name | Test badge with 'apostrophe' and other friends (<>&@#) |
183
      | Version | firstversion |
184
      | Language | English |
185
      | Description | Test badge description |
186
      | Image author | http://author.example.com |
187
      | Image caption | Test caption image |
188
      | Tags | Math, Physics |
189
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
190
    And I press "Create badge"
191
    When I select "Edit details" from the "jump" singleselect
192
    And I should see "Test badge with 'apostrophe' and other friends (&@#)"
193
    And I should not see "Issuer details"
194
    And I should see "Math"
195
    And I should see "Physics"
196
    And I set the following fields to these values:
197
      | Name | Test badge renamed |
198
      | Version | secondversion |
199
      | Tags | Math, History |
200
    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 (&@#)"
203
    And I should not see "firstversion"
204
    And I should not see "Math, Physics"
205
    And I should see "Test badge renamed"
206
    And I should see "secondversion"
207
    And I should see "Math"
208
    And I should see "History"