1 |
efrain |
1 |
@enrol @enrol_lti
|
|
|
2 |
Feature: Register a platform with the tool
|
|
|
3 |
In order to share and consume a Moodle resource or activity over LTI Advantage
|
|
|
4 |
As an admin
|
|
|
5 |
I need to be able to manage platform registrations in the tool
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given I enable "lti" "enrol" plugin
|
|
|
9 |
|
|
|
10 |
Scenario: An admin can register a platform with the tool
|
|
|
11 |
Given I log in as "admin"
|
|
|
12 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
13 |
When I follow "Register a platform"
|
|
|
14 |
And I set the following fields to these values:
|
|
|
15 |
| Platform name | My test platform |
|
|
|
16 |
And I press "Continue"
|
|
|
17 |
And I should see "Dynamic registration"
|
|
|
18 |
And I should see "Manual registration"
|
|
|
19 |
And I should see "Platform details"
|
|
|
20 |
And I follow "Back"
|
|
|
21 |
And "Manage deployments" "link" should exist in the "My test platform" "table_row"
|
|
|
22 |
And "View platform details" "link" should exist in the "My test platform" "table_row"
|
|
|
23 |
And "Delete" "link" should exist in the "My test platform" "table_row"
|
|
|
24 |
And I should see "Pending" in the "My test platform" "table_row"
|
|
|
25 |
And I click on "View platform details" "link" in the "My test platform" "table_row"
|
|
|
26 |
And I follow "Edit platform details"
|
|
|
27 |
And I set the following fields to these values:
|
|
|
28 |
| Platform ID (issuer) | https://lms.example.com |
|
|
|
29 |
| Client ID | abcd1234 |
|
|
|
30 |
| Authentication request URL | https://lms.example.com/auth |
|
|
|
31 |
| Public keyset URL | https://lms.example.com/jwks |
|
|
|
32 |
| Access token URL | https://lms.example.com/token |
|
|
|
33 |
And I press "Save changes"
|
|
|
34 |
Then I should see "Platform registration updated"
|
|
|
35 |
And I should see "My test platform" in the "Platform name" "table_row"
|
|
|
36 |
And I should see "https://lms.example.com" in the "Platform ID (issuer)" "table_row"
|
|
|
37 |
And I should see "abcd1234" in the "Client ID" "table_row"
|
|
|
38 |
And I should see "https://lms.example.com/auth" in the "Authentication request URL" "table_row"
|
|
|
39 |
And I should see "https://lms.example.com/jwks" in the "Public keyset URL" "table_row"
|
|
|
40 |
And I should see "https://lms.example.com/token" in the "Access token URL" "table_row"
|
|
|
41 |
And I follow "Back"
|
|
|
42 |
And I should see "https://lms.example.com" in the "My test platform" "table_row"
|
|
|
43 |
And I should see "Active" in the "My test platform" "table_row"
|
|
|
44 |
And "View platform details" "link" should exist in the "My test platform" "table_row"
|
|
|
45 |
And "Manage deployments" "link" should exist in the "My test platform" "table_row"
|
|
|
46 |
And "Delete" "link" should exist in the "My test platform" "table_row"
|
|
|
47 |
|
|
|
48 |
Scenario: An admin can edit a platform's registration details
|
|
|
49 |
Given the following "enrol_lti > application registrations" exist:
|
|
|
50 |
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl |
|
|
|
51 |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token |
|
|
|
52 |
And I log in as "admin"
|
|
|
53 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
54 |
When I click on "View platform details" "link" in the "My test platform" "table_row"
|
|
|
55 |
And I follow "Edit platform details"
|
|
|
56 |
And I set the following fields to these values:
|
|
|
57 |
| Platform name | Changed test platform |
|
|
|
58 |
| Platform ID (issuer) | https://lms2.example.com |
|
|
|
59 |
| Client ID | wxyz9876 |
|
|
|
60 |
| Authentication request URL | https://lms2.example.com/auth |
|
|
|
61 |
| Public keyset URL | https://lms2.example.com/jwks |
|
|
|
62 |
| Access token URL | https://lms2.example.com/token |
|
|
|
63 |
And I press "Cancel"
|
|
|
64 |
Then I should see "https://lms.example.com" in the "Platform ID (issuer)" "table_row"
|
|
|
65 |
And I follow "Edit platform details"
|
|
|
66 |
And the following fields match these values:
|
|
|
67 |
| Platform name | My test platform |
|
|
|
68 |
| Platform ID (issuer) | https://lms.example.com |
|
|
|
69 |
| Client ID | abcd1234 |
|
|
|
70 |
| Authentication request URL | https://lms.example.com/auth |
|
|
|
71 |
| Public keyset URL | https://lms.example.com/jwks |
|
|
|
72 |
| Access token URL | https://lms.example.com/token |
|
|
|
73 |
And I set the following fields to these values:
|
|
|
74 |
| Platform name | Changed test platform |
|
|
|
75 |
| Platform ID (issuer) | https://lms2.example.com |
|
|
|
76 |
| Client ID | wxyz9876 |
|
|
|
77 |
| Authentication request URL | https://lms2.example.com/auth |
|
|
|
78 |
| Public keyset URL | https://lms2.example.com/jwks |
|
|
|
79 |
| Access token URL | https://lms2.example.com/token |
|
|
|
80 |
And I press "Save changes"
|
|
|
81 |
And I should see "https://lms2.example.com" in the "Platform ID (issuer)" "table_row"
|
|
|
82 |
And I follow "Edit platform details"
|
|
|
83 |
And the following fields match these values:
|
|
|
84 |
| Platform name | Changed test platform |
|
|
|
85 |
| Platform ID (issuer) | https://lms2.example.com |
|
|
|
86 |
| Client ID | wxyz9876 |
|
|
|
87 |
| Authentication request URL | https://lms2.example.com/auth |
|
|
|
88 |
| Public keyset URL | https://lms2.example.com/jwks |
|
|
|
89 |
| Access token URL | https://lms2.example.com/token |
|
|
|
90 |
And I press "Cancel"
|
|
|
91 |
And I follow "Back"
|
|
|
92 |
And I should see "https://lms2.example.com" in the "Changed test platform" "table_row"
|
|
|
93 |
|
|
|
94 |
Scenario: An admin can delete a platform registration
|
|
|
95 |
Given the following "enrol_lti > application registrations" exist:
|
|
|
96 |
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl |
|
|
|
97 |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token |
|
|
|
98 |
And I log in as "admin"
|
|
|
99 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
100 |
When I click on "Delete" "link" in the "My test platform" "table_row"
|
|
|
101 |
And I press "Cancel"
|
|
|
102 |
Then I should see "https://lms.example.com" in the "My test platform" "table_row"
|
|
|
103 |
And I click on "Delete" "link" in the "My test platform" "table_row"
|
|
|
104 |
And I press "Continue"
|
|
|
105 |
And I should see "Platform registration deleted"
|
|
|
106 |
And I should not see "My test platform"
|
|
|
107 |
|
|
|
108 |
Scenario: A platform registration's unique platformid:clientid tuple must be enforced
|
|
|
109 |
Given the following "enrol_lti > application registrations" exist:
|
|
|
110 |
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl |
|
|
|
111 |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token |
|
|
|
112 |
And I log in as "admin"
|
|
|
113 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
114 |
When I follow "Register a platform"
|
|
|
115 |
And I set the following fields to these values:
|
|
|
116 |
| Platform name | My test platform |
|
|
|
117 |
And I press "Continue"
|
|
|
118 |
And I follow "Edit platform details"
|
|
|
119 |
And I set the following fields to these values:
|
|
|
120 |
| Platform name | My test platform |
|
|
|
121 |
| Platform ID (issuer) | https://lms.example.com |
|
|
|
122 |
| Client ID | abcd1234 |
|
|
|
123 |
| Authentication request URL | https://lms.example.com/auth |
|
|
|
124 |
| Public keyset URL | https://lms.example.com/jwks |
|
|
|
125 |
| Access token URL | https://lms.example.com/token |
|
|
|
126 |
And I press "Save changes"
|
|
|
127 |
Then I should see "Invalid client ID. This client ID is already registered for the platform ID provided."
|
|
|
128 |
|
|
|
129 |
Scenario: An admin can add deployment ids for a given platform registration
|
|
|
130 |
Given the following "enrol_lti > application registrations" exist:
|
|
|
131 |
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl |
|
|
|
132 |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token |
|
|
|
133 |
And I log in as "admin"
|
|
|
134 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
135 |
When I click on "Manage deployments" "link" in the "My test platform" "table_row"
|
|
|
136 |
And I should see "No tool deployments found"
|
|
|
137 |
And I follow "Add a deployment"
|
|
|
138 |
And I set the following fields to these values:
|
|
|
139 |
| Deployment name | Sitewide deployment of Moodle on platform x |
|
|
|
140 |
| Deployment ID | 1a2b3c |
|
|
|
141 |
And I press "Cancel"
|
|
|
142 |
And I should not see "Sitewide deployment of Moodle on platform x"
|
|
|
143 |
And I should see "No tool deployments found"
|
|
|
144 |
And I follow "Add a deployment"
|
|
|
145 |
And I set the following fields to these values:
|
|
|
146 |
| Deployment name | Sitewide deployment of Moodle on platform x |
|
|
|
147 |
| Deployment ID | 1a2b3c |
|
|
|
148 |
And I press "Save changes"
|
|
|
149 |
Then I should see "Deployment added"
|
|
|
150 |
And I should see "1a2b3c" in the "Sitewide deployment of Moodle on platform x" "table_row"
|
|
|
151 |
And I should not see "No tool deployments found"
|
|
|
152 |
And "Delete" "link" should exist in the "Sitewide deployment of Moodle on platform x" "table_row"
|
|
|
153 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
154 |
And "1" "link" should exist in the "My test platform" "table_row"
|
|
|
155 |
And I click on "1" "link" in the "My test platform" "table_row"
|
|
|
156 |
And I should see "1a2b3c" in the "Sitewide deployment of Moodle on platform x" "table_row"
|
|
|
157 |
And I follow "Add a deployment"
|
|
|
158 |
And I set the following fields to these values:
|
|
|
159 |
| Deployment name | Course context deployment of Moodle on platform x |
|
|
|
160 |
| Deployment ID | 4d5e6f |
|
|
|
161 |
And I press "Save changes"
|
|
|
162 |
And I should see "4d5e6f" in the "Course context deployment of Moodle on platform x" "table_row"
|
|
|
163 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
164 |
And "2" "link" should exist in the "My test platform" "table_row"
|
|
|
165 |
|
|
|
166 |
Scenario: An admin can remove a deployment id for a platform registration
|
|
|
167 |
Given the following "enrol_lti > application registrations" exist:
|
|
|
168 |
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl | deploymentname | deploymentid |
|
|
|
169 |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token | Site deployment | 1a2b3c |
|
|
|
170 |
And I log in as "admin"
|
|
|
171 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
172 |
And I should see "1" in the "My test platform" "table_row"
|
|
|
173 |
And I click on "Manage deployments" "link" in the "My test platform" "table_row"
|
|
|
174 |
And I should see "1a2b3c" in the "Site deployment" "table_row"
|
|
|
175 |
When I click on "Delete" "link" in the "Site deployment" "table_row"
|
|
|
176 |
And I press "Cancel"
|
|
|
177 |
Then I should see "1a2b3c" in the "Site deployment" "table_row"
|
|
|
178 |
And I click on "Delete" "link" in the "Site deployment" "table_row"
|
|
|
179 |
And I press "Continue"
|
|
|
180 |
And I should see "Deployment deleted"
|
|
|
181 |
And I should see "No tool deployments found"
|
|
|
182 |
And I should not see "1a2b3c"
|
|
|
183 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
184 |
And "1" "link" should not exist in the "My test platform" "table_row"
|
|
|
185 |
|
|
|
186 |
@javascript
|
|
|
187 |
Scenario: An admin can copy the manual and dynamic registration endpoints to register the tool with the platform
|
|
|
188 |
Given the following "enrol_lti > application registrations" exist:
|
|
|
189 |
| name |
|
|
|
190 |
| My test platform |
|
|
|
191 |
And I log in as "admin"
|
|
|
192 |
And I change window size to "large"
|
|
|
193 |
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
|
|
|
194 |
When I click on "View platform details" "link" in the "My test platform" "table_row"
|
|
|
195 |
And I follow "Tool details"
|
|
|
196 |
And the "value" attribute of "Registration URL" "field" should contain "enrol/lti/register.php"
|
|
|
197 |
And the "value" attribute of "Tool URL" "field" should contain "enrol/lti/launch.php"
|
|
|
198 |
And the "value" attribute of "Initiate login URL" "field" should contain "enrol/lti/login.php"
|
|
|
199 |
And the "value" attribute of "JWKS URL" "field" should contain "enrol/lti/jwks.php"
|
|
|
200 |
And the "value" attribute of "Deep linking URL" "field" should contain "enrol/lti/launch_deeplink.php"
|
|
|
201 |
And "Copy to clipboard" "button" should exist in the "Registration URL" "table_row"
|
|
|
202 |
And "Copy to clipboard" "button" should exist in the "Tool URL" "table_row"
|
|
|
203 |
And "Copy to clipboard" "button" should exist in the "Initiate login URL" "table_row"
|
|
|
204 |
And "Copy to clipboard" "button" should exist in the "JWKS URL" "table_row"
|
|
|
205 |
And "Copy to clipboard" "button" should exist in the "Deep linking URL" "table_row"
|
|
|
206 |
When I click on "Copy to clipboard" "button" in the "Registration URL" "table_row"
|
|
|
207 |
Then I should see "Registration URL copied to clipboard"
|
|
|
208 |
And I click on "Copy to clipboard" "button" in the "Tool URL" "table_row"
|
|
|
209 |
And I should see "Tool URL copied to clipboard"
|
|
|
210 |
And I click on "Copy to clipboard" "button" in the "Initiate login URL" "table_row"
|
|
|
211 |
And I should see "Initiate login URL copied to clipboard"
|
|
|
212 |
And I click on "Copy to clipboard" "button" in the "JWKS URL" "table_row"
|
|
|
213 |
And I should see "JWKS URL copied to clipboard"
|
|
|
214 |
And I click on "Copy to clipboard" "button" in the "Deep linking URL" "table_row"
|
|
|
215 |
And I should see "Deep linking URL copied to clipboard"
|