1 |
efrain |
1 |
@mod @mod_lti
|
|
|
2 |
Feature: Add tools
|
|
|
3 |
In order to provide activities for learners
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to add instances of external tools to a course
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
|
|
|
11 |
And the following "courses" exist:
|
|
|
12 |
| fullname | shortname | category |
|
|
|
13 |
| Course 1 | C1 | 0 |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
# A site tool configured to show as a preconfigured tool and in the activity chooser.
|
|
|
18 |
And the following "mod_lti > tool types" exist:
|
|
|
19 |
| name | baseurl | coursevisible | state |
|
|
|
20 |
| Teaching Tool 1 | /mod/lti/tests/fixtures/tool_provider.php | 2 | 1 |
|
|
|
21 |
# A course tool in course 1.
|
|
|
22 |
And the following "mod_lti > course tools" exist:
|
|
|
23 |
| name | baseurl | course |
|
|
|
24 |
| Course tool 1 | /mod/lti/tests/fixtures/tool_provider.php | C1 |
|
|
|
25 |
|
|
|
26 |
@javascript
|
|
|
27 |
Scenario: Add a site tool via the activity picker
|
|
|
28 |
Given I log in as "teacher1"
|
|
|
29 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
30 |
When I add a "Teaching Tool 1" to section "1" using the activity chooser
|
|
|
31 |
And I set the field "Activity name" to "Test tool activity 1"
|
|
|
32 |
And "Launch container" "field" should not be visible
|
|
|
33 |
# For tool that does not support Content-Item message type, the Select content button must be disabled.
|
|
|
34 |
And "Select content" "button" should not be visible
|
|
|
35 |
And "Tool URL" "field" should not be visible
|
|
|
36 |
And I press "Save and return to course"
|
|
|
37 |
And I am on the "Test tool activity 1" "lti activity editing" page
|
|
|
38 |
Then the field "Activity name" matches value "Test tool activity 1"
|
|
|
39 |
And "Launch container" "field" should not be visible
|
|
|
40 |
And "Select content" "button" should not be visible
|
|
|
41 |
And "Tool URL" "field" should not be visible
|
|
|
42 |
|
|
|
43 |
@javascript
|
|
|
44 |
Scenario: Add a course tool via the activity picker
|
|
|
45 |
Given I log in as "teacher1"
|
|
|
46 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
47 |
When I add a "Course tool 1" to section "1" using the activity chooser
|
|
|
48 |
And I set the field "Activity name" to "Test tool activity 2"
|
|
|
49 |
And "Launch container" "field" should not be visible
|
|
|
50 |
# For tool that does not support Content-Item message type, the Select content button must be disabled.
|
|
|
51 |
And "Select content" "button" should not be visible
|
|
|
52 |
And I press "Save and return to course"
|
|
|
53 |
And I am on the "Test tool activity 2" "lti activity editing" page
|
|
|
54 |
Then the field "Activity name" matches value "Test tool activity 2"
|
|
|
55 |
And "Launch container" "field" should not be visible
|
|
|
56 |
And "Select content" "button" should not be visible
|
|
|
57 |
And "Tool URL" "field" should not be visible
|
|
|
58 |
|
|
|
59 |
@javascript
|
|
|
60 |
Scenario: Editing a (deprecated) manually configured activity instance, confirming that config changes aren't possible
|
|
|
61 |
Given the following "activities" exist:
|
|
|
62 |
| activity | name | course | toolurl |
|
|
|
63 |
| lti | A manual tool | C1 | /mod/lti/tests/fixtures/ims_cartridge_basic_lti_link.xml |
|
|
|
64 |
# Add a course tool with the same URL as that of the manually configured instance (the tool URL found in the above cartridge).
|
|
|
65 |
# This would normally be domain-matched during edit, resulting in the assignment of a preconfigured tool to the instance.
|
|
|
66 |
# In this case, because config changes and domain matching are disabled, the test confirms this doesn't take place.
|
|
|
67 |
And the following "mod_lti > course tools" exist:
|
|
|
68 |
| name | baseurl | course | lti_sendname | lti_sendemailaddr | lti_acceptgrades |
|
|
|
69 |
| Course tool 2 | http://www.example.com/lti/provider.php | C1 | 0 | 1 | 2 |
|
|
|
70 |
When I am on the "A manual tool" "lti activity editing" page logged in as teacher1
|
|
|
71 |
Then I should see "Manually configured External tool activities are no longer supported"
|
|
|
72 |
And I follow "Show more..."
|
|
|
73 |
And I expand all fieldsets
|
|
|
74 |
# The privacy values below represent the existing values of the privacy settings, before saving and inheriting from the
|
|
|
75 |
# domain-matched tool values.
|
|
|
76 |
And the following fields match these values:
|
|
|
77 |
| Activity name | A manual tool |
|
|
|
78 |
| id_showdescription | 0 |
|
|
|
79 |
| Consumer key | 12345 |
|
|
|
80 |
| Icon URL | http://download.moodle.org/unittest/test.jpg |
|
|
|
81 |
| Secure icon URL | https://download.moodle.org/unittest/test.jpg |
|
|
|
82 |
| Tool URL | http://www.example.com/lti/provider.php |
|
|
|
83 |
| id_instructorchoicesendname | 1 |
|
|
|
84 |
| id_instructorchoicesendemailaddr | 1 |
|
|
|
85 |
| id_instructorchoiceacceptgrades | 1 |
|
|
|
86 |
And the "Activity name" "field" should be enabled
|
|
|
87 |
And the "Activity description" "field" should be enabled
|
|
|
88 |
And the "id_showdescription" "checkbox" should be enabled
|
|
|
89 |
And the "id_showtitlelaunch" "checkbox" should be enabled
|
|
|
90 |
And the "id_showdescriptionlaunch" "checkbox" should be enabled
|
|
|
91 |
And the "Secure tool URL" "field" should be disabled
|
|
|
92 |
And the "Consumer key" "field" should be enabled
|
|
|
93 |
And the "Shared secret" "field" should be enabled
|
|
|
94 |
And I click on "Reveal" "icon"
|
|
|
95 |
And I should see "secret"
|
|
|
96 |
And the "Custom parameters" "field" should be disabled
|
|
|
97 |
And the "Icon URL" "field" should be disabled
|
|
|
98 |
And the "Secure icon URL" "field" should be disabled
|
|
|
99 |
And I should see "Automatic, based on tool URL"
|
|
|
100 |
And the "Select content" "button" should be disabled
|
|
|
101 |
And the "Tool URL" "field" should be disabled
|
|
|
102 |
And the "id_instructorchoicesendname" "checkbox" should be disabled
|
|
|
103 |
And the "id_instructorchoicesendemailaddr" "checkbox" should be disabled
|
|
|
104 |
And the "id_instructorchoiceacceptgrades" "checkbox" should be disabled
|
|
|
105 |
And I set the following fields to these values:
|
|
|
106 |
| Activity name | A manual tool name edited |
|
|
|
107 |
| id_showdescription | 1 |
|
|
|
108 |
| Consumer key | key |
|
|
|
109 |
| Shared secret | secret |
|
|
|
110 |
And I press "Save and return to course"
|
|
|
111 |
And I am on the "A manual tool" "lti activity editing" page logged in as teacher1
|
|
|
112 |
And I follow "Show more..."
|
|
|
113 |
# This confirms that the instance config, while locked to user edits, still inherits privacy settings from the tool which
|
|
|
114 |
# it was domain-matched to.
|
|
|
115 |
And the following fields match these values:
|
|
|
116 |
| Activity name | A manual tool name edited |
|
|
|
117 |
| id_showdescription | 1 |
|
|
|
118 |
| Consumer key | key |
|
|
|
119 |
| Shared secret | secret |
|
|
|
120 |
| Icon URL | http://download.moodle.org/unittest/test.jpg |
|
|
|
121 |
| Secure icon URL | https://download.moodle.org/unittest/test.jpg |
|
|
|
122 |
| Tool URL | http://www.example.com/lti/provider.php |
|
|
|
123 |
| id_instructorchoicesendname | 0 |
|
|
|
124 |
| id_instructorchoicesendemailaddr | 1 |
|
|
|
125 |
| id_instructorchoiceacceptgrades | 2 |
|
|
|
126 |
And the "Activity name" "field" should be enabled
|
|
|
127 |
And the "Activity description" "field" should be enabled
|
|
|
128 |
And the "id_showdescription" "checkbox" should be enabled
|
|
|
129 |
And the "id_showtitlelaunch" "checkbox" should be enabled
|
|
|
130 |
And the "id_showdescriptionlaunch" "checkbox" should be enabled
|
|
|
131 |
And the "Secure tool URL" "field" should be disabled
|
|
|
132 |
And the "Consumer key" "field" should be enabled
|
|
|
133 |
And the "Shared secret" "field" should be enabled
|
|
|
134 |
And I click on "Reveal" "icon"
|
|
|
135 |
And I should see "secret"
|
|
|
136 |
And the "Custom parameters" "field" should be disabled
|
|
|
137 |
And the "Icon URL" "field" should be disabled
|
|
|
138 |
And the "Secure icon URL" "field" should be disabled
|
|
|
139 |
And I should see "Automatic, based on tool URL"
|
|
|
140 |
And the "Select content" "button" should be disabled
|
|
|
141 |
And the "Tool URL" "field" should be disabled
|
|
|
142 |
And the "id_instructorchoicesendname" "checkbox" should be disabled
|
|
|
143 |
And the "id_instructorchoicesendemailaddr" "checkbox" should be disabled
|
|
|
144 |
And the "id_instructorchoiceacceptgrades" "checkbox" should be disabled
|