~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to badges/tests/behat/award_badge.feature

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
@core @core_badges @_only_local
 
1
@core @core_badges @_only_local @_file_upload
2
2
Feature: Award badges
3
3
  In order to award badges to users for their achievements
4
4
  As an admin
5
5
  I need to add criteria to badges in the system
6
6
 
7
 
  Background:
8
 
    Given I am on homepage
9
 
    And I log in as "admin"
10
 
 
11
7
  @javascript
12
8
  Scenario: Award profile badge
13
 
    Given I expand "Site administration" node
14
 
    And I expand "Badges" node
15
 
    And I follow "Add a new badge"
 
9
    Given I log in as "admin"
 
10
    And I navigate to "Add a new badge" node in "Site administration > Badges"
16
11
    And I fill the moodle form with:
17
12
      | Name | Profile Badge |
18
13
      | Description | Test badge description |
19
14
      | issuername | Test Badge Site |
20
15
      | issuercontact | testuser@test-badge-site.com |
21
 
    And I upload "badges/tests/behat/badge.png" file to "Image" filepicker
 
16
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
22
17
    And I press "Create badge"
23
18
    And I select "Profile completion" from "type"
24
19
    And I check "First name"
46
41
      | username | firstname | lastname | email |
47
42
      | teacher | teacher | 1 | teacher1@asd.com |
48
43
      | student | student | 1 | student1@asd.com |
49
 
    And I expand "Site administration" node
50
 
    And I expand "Badges" node
51
 
    And I follow "Add a new badge"
 
44
    And I log in as "admin"
 
45
    And I navigate to "Add a new badge" node in "Site administration > Badges"
52
46
    And I fill the moodle form with:
53
47
      | Name | Site Badge |
54
48
      | Description | Site badge description |
55
49
      | issuername | Tester of site badge |
56
 
    And I upload "badges/tests/behat/badge.png" file to "Image" filepicker
 
50
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
57
51
    And I press "Create badge"
58
52
    And I select "Manual issue by role" from "type"
59
53
    And I check "Teacher"
89
83
      | teacher1 | C1 | editingteacher |
90
84
      | student1 | C1 | student |
91
85
      | student2 | C1 | student |
92
 
    And I log out
93
86
    And I log in as "teacher1"
94
87
    And I follow "Course 1"
95
88
    And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block"
98
91
      | Name | Course Badge |
99
92
      | Description | Course badge description |
100
93
      | issuername | Tester of course badge |
101
 
    And I upload "badges/tests/behat/badge.png" file to "Image" filepicker
 
94
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
102
95
    And I press "Create badge"
103
96
    And I select "Manual issue by role" from "type"
104
97
    And I check "Teacher"
133
126
      | user | course | role |
134
127
      | teacher1 | C1 | editingteacher |
135
128
      | student1 | C1 | student |
136
 
    And I log out
137
129
    And I log in as "admin"
138
130
    And I set the following administration settings values:
139
131
      | Enable completion tracking | 1 |
156
148
      | Name | Course Badge |
157
149
      | Description | Course badge description |
158
150
      | issuername | Tester of course badge |
159
 
    And I upload "badges/tests/behat/badge.png" file to "Image" filepicker
 
151
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
160
152
    And I press "Create badge"
161
153
    And I select "Activity completion" from "type"
162
154
    And I check "Test assignment name"
172
164
    And I follow "Home"
173
165
    And I follow "Course 1"
174
166
    And I press "Mark as complete: Test assignment name"
175
 
    And I wait "2" seconds
176
167
    And I expand "My profile" node
177
168
    And I follow "My badges"
178
169
    Then I should see "Course Badge"
190
181
      | user | course | role |
191
182
      | teacher1 | C1 | editingteacher |
192
183
      | student1 | C1 | student |
193
 
    And I log out
194
184
    And I log in as "admin"
195
185
    And I set the following administration settings values:
196
186
      | Enable completion tracking | 1 |
219
209
      | Name | Course Badge |
220
210
      | Description | Course badge description |
221
211
      | issuername | Tester of course badge |
222
 
    And I upload "badges/tests/behat/badge.png" file to "Image" filepicker
 
212
    And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
223
213
    And I press "Create badge"
224
214
    And I select "Course completion" from "type"
225
215
    And I fill the moodle form with: