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: Backpack badges
3
  Test the settings to add/update a backpack for a site and user.
4
  I need to verify display backpack in the my profile
5
 
6
  Background:
7
    Given the following "badge external backpacks" exist:
8
      | backpackapiurl                               | backpackweburl           | apiversion | sortorder |
9
      | https://dc.imsglobal.org/obchost/ims/ob/v2p1 | https://dc.imsglobal.org | 2.1        | 2         |
10
      | https://test.com/                            | https://test.com/        | 2          | 3         |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email                |
13
      | student1 | Student   | 1        | student1@example.com |
14
    And I log in as "admin"
15
    And I navigate to "Badges > Badges settings" in site administration
16
    And I set the field "Badge issuer name" to "Test Badge Site"
17
    And I set the field "Badge issuer email address" to "testuser@example.com"
18
    And I log out
19
 
20
  @javascript
21
  Scenario: If external backpack connection is disabled, backpack settings should not be displayed
22
    Given I am on homepage
23
    And I log in as "admin"
24
    And I navigate to "Badges > Badges settings" in site administration
25
    And I set the following fields to these values:
26
      | External backpack connection | 0                        |
27
    And I press "Save changes"
28
    When I navigate to "Badges" in site administration
29
    Then I should not see "Manage backpacks"
30
    And I navigate to "Badges > Badges settings" in site administration
31
    And I set the following fields to these values:
32
      | External backpack connection | 1                        |
33
    And I press "Save changes"
34
    And I am on homepage
35
    And I navigate to "Badges" in site administration
36
    And I should see "Manage backpacks"
37
 
38
  @javascript
39
  Scenario: Verify backback settings
40
    Given the following "core_badges > Badge" exists:
41
      | name           | Test badge verify backpack       |
42
      | version        | 1                                |
43
      | language       | en                               |
44
      | description    | Test badge description           |
45
      | image          | badges/tests/behat/badge.png     |
46
      | imageauthorurl | http://author.example.com        |
47
      | imagecaption   | Test caption image               |
48
    And the following "core_badges > Criteria" exists:
49
      | badge          | Test badge verify backpack       |
50
      | role           | editingteacher                   |
51
    And the following "core_badges > Issued badge" exists:
52
      | badge          | Test badge verify backpack       |
53
      | user           | student1                         |
54
    When I log in as "student1"
55
    And I follow "Preferences" in the user menu
56
    And I follow "Backpack settings"
57
    Then I should see "Choose..." in the "Backpack provider" "select"
58
 
59
  @javascript
60
  Scenario: User has been connected backpack
61
    Given I am on homepage
62
    And I log in as "admin"
63
    And I navigate to "Badges > Badges settings" in site administration
64
    And I set the following fields to these values:
65
      | External backpack connection | 1                        |
66
    And I press "Save changes"
67
    And I navigate to "Badges > Manage backpacks" in site administration
68
    And I click on "Move up" "link" in the "https://dc.imsglobal.org" "table_row"
69
    And the following "core_badges > Badge" exists:
70
      | name           | Test badge verify backpack       |
71
      | version        | 1                                |
72
      | language       | en                               |
73
      | description    | Test badge description           |
74
      | image          | badges/tests/behat/badge.png     |
75
      | imageauthorurl | http://author.example.com        |
76
      | imagecaption   | Test caption image               |
77
    And the following "core_badges > Criteria" exists:
78
      | badge          | Test badge verify backpack       |
79
      | role           | editingteacher                   |
80
    And the following "core_badges > Issued badge" exists:
81
      | badge          | Test badge verify backpack       |
82
      | user           | student1                         |
83
    And the following "setup backpack connected" exist:
84
      | user     | externalbackpack         |
85
      | student1 | https://dc.imsglobal.org |
86
    When I log in as "student1"
87
    And I follow "Preferences" in the user menu
88
    And I follow "Backpack settings"
89
    Then I should see "Connected"
90
    And I follow "Preferences" in the user menu
91
    And I follow "Manage badges"
92
    And I should see "Test badge verify backpack"
93
    And "Add to backpack" "link" should exist
94
 
95
  @javascript
96
  Scenario: Add a new site backpack
97
    Given I am on homepage
98
    And I log in as "admin"
99
    And I navigate to "Badges > Manage backpacks" in site administration
100
    When I press "Add a new backpack"
101
    And I set the field "apiversion" to "2"
102
    And I set the field "backpackweburl" to "aaa"
103
    And I press "Save changes"
104
    And I should see "Invalid URL"
105
    And I set the field "backpackweburl" to "http://backpackweburl.cat"
106
    And I press "Save changes"
107
    And I should see "You must supply a value here"
108
    And I set the field "backpackapiurl" to "http://backpackapiurl.cat"
109
    And I press "Save changes"
110
    Then I should see "http://backpackweburl.cat"
111
    And "Delete" "icon" should exist in the "http://backpackweburl.cat" "table_row"
112
    And "Edit settings" "icon" should exist in the "http://backpackweburl.cat" "table_row"
113
 
114
  @javascript
115
  Scenario: Remove a site backpack
116
    Given I am on homepage
117
    And I log in as "admin"
118
    And I navigate to "Badges > Manage backpacks" in site administration
119
    When I click on "Delete" "link" in the "https://dc.imsglobal.org" "table_row"
120
    And I should see "Delete site backpack 'https://dc.imsglobal.org'?"
121
    And I click on "Delete" "button" in the "Delete site backpack" "dialogue"
122
    Then I should see "The site backpack has been deleted."
123
    And I should not see "https://dc.imsglobal.org"
124
    And "Delete" "button" should not be visible
125
 
126
  @javascript
127
  Scenario: Move up and down site backpack
128
    Given I am on homepage
129
    And I log in as "admin"
130
    And I navigate to "Badges > Manage backpacks" in site administration
131
    And "Move up" "icon" should exist in the "https://dc.imsglobal.org" "table_row"
132
    And "Move down" "icon" should exist in the "https://dc.imsglobal.org" "table_row"
133
    When I click on "Move up" "link" in the "https://dc.imsglobal.org" "table_row"
134
    Then "Move up" "icon" should not exist in the "https://dc.imsglobal.org" "table_row"
135
    And "Move down" "icon" should exist in the "https://dc.imsglobal.org" "table_row"
136
    And I click on "Move down" "link" in the "https://dc.imsglobal.org" "table_row"
137
    And I click on "Move down" "link" in the "https://dc.imsglobal.org" "table_row"
138
    And "Move up" "icon" should exist in the "https://dc.imsglobal.org" "table_row"
139
    And "Move down" "icon" should not exist in the "https://dc.imsglobal.org" "table_row"
140
 
141
  @javascript
142
  Scenario: Add a new site backpack with authentication details checkbox
143
    Given I am on homepage
144
    And I log in as "admin"
145
    And I navigate to "Badges > Manage backpacks" in site administration
146
    When I press "Add a new backpack"
147
    And I set the field "apiversion" to "2.1"
148
    And I set the field "backpackweburl" to "http://backpackweburl.cat"
149
    And I should not see "Backpack API URL"
150
    Then "Include authentication details with the backpack" "checkbox" should not be visible
151
    And I should not see "Badge issuer email address"
152
    And I should not see "Badge issuer password"
153
    And I set the field "apiversion" to "1"
154
    And "Include authentication details with the backpack" "checkbox" should be visible
155
    And I click on "includeauthdetails" "checkbox"
156
    And I should see "Badge issuer email address"
157
    And I should not see "Badge issuer password"
158
    And I set the field "apiversion" to "2"
159
    And "Include authentication details with the backpack" "checkbox" should be visible
160
    And I should see "Badge issuer email address"
161
    And I should see "Badge issuer password"
162
    And I set the field "backpackemail" to "test@test.com"
163
    And I set the field "password" to "123456"
164
    And I set the field "backpackapiurl" to "http://backpackapiurl.cat"
165
    And I press "Save changes"
166
    And I click on "Edit" "link" in the "http://backpackweburl.cat" "table_row"
167
    And the field "Include authentication details with the backpack" matches value "1"
168
    And I click on "includeauthdetails" "checkbox"
169
    And I press "Save changes"
170
    And I click on "Edit" "link" in the "http://backpackweburl.cat" "table_row"
171
    And the field "Include authentication details with the backpack" matches value "0"
172
    And I click on "includeauthdetails" "checkbox"
173
    And I should not see "test@test.com"
174
 
175
  @javascript
176
  Scenario: View backpack form as a student
177
    Given I log in as "student1"
178
    And I follow "Preferences" in the user menu
179
    And I follow "Backpack settings"
180
    When I set the field "externalbackpackid" to "https://dc.imsglobal.org"
181
    Then I should not see "Log in to your backpack"
182
    And I should not see "Email address"
183
    And I should not see "Password"
184
    But I set the field "externalbackpackid" to "https://test.com/"
185
    And I should see "Log in to your backpack"
186
    And I should see "Email address"
187
    And I should see "Password"
188
 
189
  @javascript
190
  Scenario: Check backpack form validation as a student
191
    Given I log in as "student1"
192
    And I follow "Preferences" in the user menu
193
    And I follow "Backpack settings"
194
    When I click on "Connect to backpack" "button"
195
    Then I should see "Backpack provider can't be blank"
196
    And I set the field "externalbackpackid" to "https://test.com/"
197
    And I set the field "password" to ""
198
    When I click on "Connect to backpack" "button"
199
    Then I should see "Password can't be blank"
200
    And I should not see "Email address can't be blank"
201
    And I set the field "backpackemail" to ""
202
    And I click on "Connect to backpack" "button"
203
    And I should see "Email address can't be blank"
204
    And I should see "Password can't be blank"