Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 10... Línea 10...
10
      | status         | 0                            |
10
      | status         | 0                            |
11
      | version        | 1.0                          |
11
      | version        | 1.0                          |
12
      | language       | en                           |
12
      | language       | en                           |
13
      | description    | Test badge description       |
13
      | description    | Test badge description       |
14
      | image          | badges/tests/behat/badge.png |
14
      | image          | badges/tests/behat/badge.png |
15
      | imageauthorurl | http://author.example.com    |
-
 
16
      | imagecaption   | Test caption image           |
15
      | imagecaption   | Test caption image           |
Línea 17... Línea 16...
17
 
16
 
18
  Scenario: Copy a badge
17
  Scenario: Copy a badge
19
    Given I log in as "admin"
18
    Given I log in as "admin"
20
    And I navigate to "Badges > Manage badges" in site administration
19
    And I navigate to "Badges > Manage badges" in site administration
21
    And I press "Copy" action in the "Badge #1" report row
20
    And I press "Copy" action in the "Badge #1" report row
22
    And I should see "Copy of Badge #1"
21
    And I should see "Copy of Badge #1"
23
    And I press "Save changes"
22
    And I press "Save changes"
24
    And I click on "Back" "button"
23
    And I click on "Back" "button"
25
    Then the following should exist in the "reportbuilder-table" table:
24
    Then the following should exist in the "reportbuilder-table" table:
26
      | Name             | Version | Badge status  |
25
      | Name             | Badge status  |
27
      | Badge #1         | 1.0     | Not available |
26
      | Badge #1         | Not available |
Línea 28... Línea 27...
28
      | Copy of Badge #1 | 1.0     | Not available |
27
      | Copy of Badge #1 | Not available |
29
 
28
 
30
  Scenario: Edit a badge
29
  Scenario: Edit a badge
31
    Given I log in as "admin"
30
    Given I log in as "admin"
Línea 35... Línea 34...
35
      | Name    | New Badge #1 |
34
      | Name    | New Badge #1 |
36
      | Version | 1.1          |
35
      | Version | 1.1          |
37
    And I press "Save changes"
36
    And I press "Save changes"
38
    And I click on "Back" "button"
37
    And I click on "Back" "button"
39
    Then the following should exist in the "reportbuilder-table" table:
38
    Then the following should exist in the "reportbuilder-table" table:
40
      | Name          | Version | Badge status  |
39
      | Name          | Badge status  |
41
      | New Badge #1  | 1.1     | Not available |
40
      | New Badge #1  | Not available |
-
 
41
    And I follow "New Badge #1"
-
 
42
    And I should see "1.1"
Línea 42... Línea 43...
42
 
43
 
43
  Scenario: Delete a badge
44
  Scenario: Delete a badge
44
    Given I log in as "admin"
45
    Given I log in as "admin"
45
    And I navigate to "Badges > Manage badges" in site administration
46
    And I navigate to "Badges > Manage badges" in site administration
46
    And I press "Delete" action in the "Badge #1" report row
47
    And I press "Delete" action in the "Badge #1" report row
47
    And I press "Delete and remove existing issued badges"
48
    And I press "Delete and remove existing issued badges"
Línea 48... Línea 49...
48
    Then I should see "There are currently no badges available for users to earn"
49
    Then I should see "There are no matching badges available for users to earn."
49
 
50
 
50
  Scenario Outline: Filter managed badges
51
  Scenario Outline: Filter managed badges
51
    Given the following "core_badges > Badges" exist:
52
    Given the following "core_badges > Badges" exist:
52
      | name     | status | version |
53
      | name     | status | version | image                        |
53
      | Badge #2 | 1      | 2.0     |
54
      | Badge #2 | 1      | 2.0     | badges/tests/behat/badge.png |
54
    And I log in as "admin"
55
    And I log in as "admin"
55
    When I navigate to "Badges > Manage badges" in site administration
56
    When I navigate to "Badges > Manage badges" in site administration
56
    And I click on "Filters" "button"
57
    And I click on "Filters" "button"
Línea 75... Línea 76...
75
    And I set the field "type" to "Manual issue by role"
76
    And I set the field "type" to "Manual issue by role"
76
    And I set the field "Manager" to "1"
77
    And I set the field "Manager" to "1"
77
    And I press "Save"
78
    And I press "Save"
78
    And I navigate to "Badges > Manage badges" in site administration
79
    And I navigate to "Badges > Manage badges" in site administration
79
    And I press "Enable access" action in the "Badge #1" report row
80
    And I press "Enable access" action in the "Badge #1" report row
80
    And I should see "Changes in badge access"
81
    And I should see "This will make your badge visible to users and allow them to start earning it."
81
    And I press "Continue"
82
    And I click on "Enable" "button" in the "Confirm" "dialogue"
82
    And I should see "Access to the badges was successfully enabled"
83
    And I should see "Access to badge 'Badge #1' enabled"
83
    Then the following should exist in the "reportbuilder-table" table:
84
    Then the following should exist in the "reportbuilder-table" table:
84
      | Name      | Badge status  |
85
      | Name      | Badge status  |
85
      | Badge #1  | Available     |
86
      | Badge #1  | Available     |
86
    And I press "Disable access" action in the "Badge #1" report row
87
    And I press "Disable access" action in the "Badge #1" report row
87
    And I should see "Access to the badges was successfully disabled"
88
    And I should see "Access to badge 'Badge #1' disabled"
88
    And the following should exist in the "reportbuilder-table" table:
89
    And the following should exist in the "reportbuilder-table" table:
89
      | Name      | Badge status  |
90
      | Name      | Badge status  |
90
      | Badge #1  | Not available |
91
      | Badge #1  | Not available |
Línea 91... Línea 92...
91
 
92
 
-
 
93
  Scenario: Award a badge
-
 
94
    Given the following "users" exist:
-
 
95
      | username | firstname | lastname | email             |
92
  Scenario: Award a badge
96
      | user1    | User      | One      | user1@example.com |
93
    Given I log in as "admin"
97
    When I log in as "admin"
94
    And I navigate to "Badges > Manage badges" in site administration
98
    And I navigate to "Badges > Manage badges" in site administration
95
    And I press "Edit" action in the "Badge #1" report row
99
    And I press "Edit" action in the "Badge #1" report row
96
    And I select "Criteria" from the "jump" singleselect
100
    And I select "Criteria" from the "jump" singleselect
97
    And I set the field "type" to "Manual issue by role"
101
    And I set the field "type" to "Manual issue by role"
98
    And I set the field "Manager" to "1"
102
    And I set the field "Manager" to "1"
99
    And I press "Save"
103
    And I press "Save"
100
    And I navigate to "Badges > Manage badges" in site administration
104
    And I navigate to "Badges > Manage badges" in site administration
101
    And I press "Enable access" action in the "Badge #1" report row
105
    And I press "Enable access" action in the "Badge #1" report row
102
    And I press "Continue"
106
    And I click on "Enable" "button" in the "Confirm" "dialogue"
103
    And I press "Award badge" action in the "Badge #1" report row
107
    And I press "Award badge" action in the "Badge #1" report row
104
    And I set the field "potentialrecipients[]" to "Admin User (moodle@example.com)"
108
    And I set the field "potentialrecipients[]" to "Admin User (moodle@example.com),User One (user1@example.com)"
105
    And I press "Award badge"
109
    And I press "Award badge"
106
    And I navigate to "Badges > Manage badges" in site administration
110
    And I navigate to "Badges > Manage badges" in site administration
107
    Then the following should exist in the "reportbuilder-table" table:
111
    Then the following should exist in the "Badges" table:
108
      | Name      | Badge status  | Recipients |
112
      | Name      | Badge status  | Recipients |
-
 
113
      | Badge #1  | Available     | 2          |
-
 
114
    And I click on "2" "link" in the "Badge #1" "table_row"
-
 
115
    And the following should exist in the "Recipients" table:
-
 
116
      | -1-        |
-
 
117
      | Admin User |
-
 
118
      | User One   |
-
 
119
 
-
 
120
  @accessibility
-
 
121
  Scenario: View list of badges with recipients
-
 
122
    Given the following "users" exist:
-
 
123
      | username | firstname | lastname |
-
 
124
      | user1    | User      | One      |
-
 
125
      | user2    | User      | Two      |
-
 
126
    And the following "core_badges > Badges" exist:
-
 
127
      | name     | status | image                        |
-
 
128
      | Badge #2 | 1      | badges/tests/behat/badge.png |
-
 
129
      | Badge #3 | 1      | badges/tests/behat/badge.png |
-
 
130
    And the following "core_badges > Issued badges" exist:
-
 
131
      | badge    | user  |
-
 
132
      | Badge #1 | user1 |
-
 
133
      | Badge #1 | user2 |
-
 
134
      | Badge #2 | user1 |
-
 
135
    When I log in as "admin"
-
 
136
    And I navigate to "Badges > Manage badges" in site administration
-
 
137
    Then the following should exist in the "Badges" table:
-
 
138
      | Name     | Badge status  | Recipients |
-
 
139
      | Badge #1 | Not available | 2          |
-
 
140
      | Badge #2 | Available     | 1          |
-
 
141
      | Badge #3 | Available     | 0          |
-
 
142
    And the "Badges" "table" should meet accessibility standards with "best-practice" extra tests
-
 
143
 
-
 
144
  @_file_upload
-
 
145
  Scenario: Badge names are not unique anymore
-
 
146
    Given the following "courses" exist:
-
 
147
      | fullname | shortname | category |
-
 
148
      | Course 1 | C1        | 0        |
-
 
149
    And the following "core_badges > Badge" exists:
-
 
150
      | name           | Badge #2                     |
-
 
151
      | status         | 0                            |
-
 
152
      | course         | C1                           |
-
 
153
      | type           | 1                            |
-
 
154
      | version        | 1.0                          |
-
 
155
      | language       | en                           |
-
 
156
      | description    | Test badge description       |
-
 
157
      | image          | badges/tests/behat/badge.png |
-
 
158
      | imagecaption   | Test caption image           |
-
 
159
    And I log in as "admin"
-
 
160
    And I navigate to "Badges > Add a new badge" in site administration
-
 
161
    And I set the following fields to these values:
-
 
162
      | name           | Badge #1                     |
-
 
163
      | description    | Test badge description       |
-
 
164
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
-
 
165
    When I press "Create badge"
-
 
166
    Then I should see "Criteria for this badge have not been set up yet."
-
 
167
    And I select "Edit details" from the "jump" singleselect
-
 
168
    # Set name for a site badge with existing badge name in a course is also allowed.
-
 
169
    And I set the field "name" to "Badge #2"
-
 
170
    And I press "Save changes"