first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+144
View File
@@ -0,0 +1,144 @@
@mod @mod_lti
Feature: Add tools
In order to provide activities for learners
As a teacher
I need to be able to add instances of external tools to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
# A site tool configured to show as a preconfigured tool and in the activity chooser.
And the following "mod_lti > tool types" exist:
| name | baseurl | coursevisible | state |
| Teaching Tool 1 | /mod/lti/tests/fixtures/tool_provider.php | 2 | 1 |
# A course tool in course 1.
And the following "mod_lti > course tools" exist:
| name | baseurl | course |
| Course tool 1 | /mod/lti/tests/fixtures/tool_provider.php | C1 |
@javascript
Scenario: Add a site tool via the activity picker
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add a "Teaching Tool 1" to section "1" using the activity chooser
And I set the field "Activity name" to "Test tool activity 1"
And "Launch container" "field" should not be visible
# For tool that does not support Content-Item message type, the Select content button must be disabled.
And "Select content" "button" should not be visible
And "Tool URL" "field" should not be visible
And I press "Save and return to course"
And I am on the "Test tool activity 1" "lti activity editing" page
Then the field "Activity name" matches value "Test tool activity 1"
And "Launch container" "field" should not be visible
And "Select content" "button" should not be visible
And "Tool URL" "field" should not be visible
@javascript
Scenario: Add a course tool via the activity picker
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add a "Course tool 1" to section "1" using the activity chooser
And I set the field "Activity name" to "Test tool activity 2"
And "Launch container" "field" should not be visible
# For tool that does not support Content-Item message type, the Select content button must be disabled.
And "Select content" "button" should not be visible
And I press "Save and return to course"
And I am on the "Test tool activity 2" "lti activity editing" page
Then the field "Activity name" matches value "Test tool activity 2"
And "Launch container" "field" should not be visible
And "Select content" "button" should not be visible
And "Tool URL" "field" should not be visible
@javascript
Scenario: Editing a (deprecated) manually configured activity instance, confirming that config changes aren't possible
Given the following "activities" exist:
| activity | name | course | toolurl |
| lti | A manual tool | C1 | /mod/lti/tests/fixtures/ims_cartridge_basic_lti_link.xml |
# Add a course tool with the same URL as that of the manually configured instance (the tool URL found in the above cartridge).
# This would normally be domain-matched during edit, resulting in the assignment of a preconfigured tool to the instance.
# In this case, because config changes and domain matching are disabled, the test confirms this doesn't take place.
And the following "mod_lti > course tools" exist:
| name | baseurl | course | lti_sendname | lti_sendemailaddr | lti_acceptgrades |
| Course tool 2 | http://www.example.com/lti/provider.php | C1 | 0 | 1 | 2 |
When I am on the "A manual tool" "lti activity editing" page logged in as teacher1
Then I should see "Manually configured External tool activities are no longer supported"
And I follow "Show more..."
And I expand all fieldsets
# The privacy values below represent the existing values of the privacy settings, before saving and inheriting from the
# domain-matched tool values.
And the following fields match these values:
| Activity name | A manual tool |
| id_showdescription | 0 |
| Consumer key | 12345 |
| Icon URL | http://download.moodle.org/unittest/test.jpg |
| Secure icon URL | https://download.moodle.org/unittest/test.jpg |
| Tool URL | http://www.example.com/lti/provider.php |
| id_instructorchoicesendname | 1 |
| id_instructorchoicesendemailaddr | 1 |
| id_instructorchoiceacceptgrades | 1 |
And the "Activity name" "field" should be enabled
And the "Activity description" "field" should be enabled
And the "id_showdescription" "checkbox" should be enabled
And the "id_showtitlelaunch" "checkbox" should be enabled
And the "id_showdescriptionlaunch" "checkbox" should be enabled
And the "Secure tool URL" "field" should be disabled
And the "Consumer key" "field" should be enabled
And the "Shared secret" "field" should be enabled
And I click on "Reveal" "icon"
And I should see "secret"
And the "Custom parameters" "field" should be disabled
And the "Icon URL" "field" should be disabled
And the "Secure icon URL" "field" should be disabled
And I should see "Automatic, based on tool URL"
And the "Select content" "button" should be disabled
And the "Tool URL" "field" should be disabled
And the "id_instructorchoicesendname" "checkbox" should be disabled
And the "id_instructorchoicesendemailaddr" "checkbox" should be disabled
And the "id_instructorchoiceacceptgrades" "checkbox" should be disabled
And I set the following fields to these values:
| Activity name | A manual tool name edited |
| id_showdescription | 1 |
| Consumer key | key |
| Shared secret | secret |
And I press "Save and return to course"
And I am on the "A manual tool" "lti activity editing" page logged in as teacher1
And I follow "Show more..."
# This confirms that the instance config, while locked to user edits, still inherits privacy settings from the tool which
# it was domain-matched to.
And the following fields match these values:
| Activity name | A manual tool name edited |
| id_showdescription | 1 |
| Consumer key | key |
| Shared secret | secret |
| Icon URL | http://download.moodle.org/unittest/test.jpg |
| Secure icon URL | https://download.moodle.org/unittest/test.jpg |
| Tool URL | http://www.example.com/lti/provider.php |
| id_instructorchoicesendname | 0 |
| id_instructorchoicesendemailaddr | 1 |
| id_instructorchoiceacceptgrades | 2 |
And the "Activity name" "field" should be enabled
And the "Activity description" "field" should be enabled
And the "id_showdescription" "checkbox" should be enabled
And the "id_showtitlelaunch" "checkbox" should be enabled
And the "id_showdescriptionlaunch" "checkbox" should be enabled
And the "Secure tool URL" "field" should be disabled
And the "Consumer key" "field" should be enabled
And the "Shared secret" "field" should be enabled
And I click on "Reveal" "icon"
And I should see "secret"
And the "Custom parameters" "field" should be disabled
And the "Icon URL" "field" should be disabled
And the "Secure icon URL" "field" should be disabled
And I should see "Automatic, based on tool URL"
And the "Select content" "button" should be disabled
And the "Tool URL" "field" should be disabled
And the "id_instructorchoicesendname" "checkbox" should be disabled
And the "id_instructorchoicesendemailaddr" "checkbox" should be disabled
And the "id_instructorchoiceacceptgrades" "checkbox" should be disabled
@@ -0,0 +1,64 @@
@mod @mod_lti @core_backup @javascript
Feature: Restoring Moodle 2 backup restores LTI configuration
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
And the following config values are set as admin:
| enableasyncbackup | 0 |
Scenario: Backup and restore course with preconfigured site LTI tool on the same site
Given the following "mod_lti > tool types" exist:
| name | description | baseurl | coursevisible | state |
| My site tool | Site tool description | https://www.moodle.org | 2 | 1 |
And the following "mod_lti > tool instances" exist:
| name | tool | course |
| My LTI module | My site tool | C1 |
And I am on the "Course 1" course page logged in as admin
And I should see "My LTI module"
When I backup "Course 1" course using this options:
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into a new course using this options:
And I am on site homepage
And I follow "Course 1 copy 1"
Then I should see "My LTI module"
And I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And "This tool is being used 2 times" "text" should exist in the "//div[contains(@id,'tool-card-container') and contains(., 'My site tool')]" "xpath_element"
@javascript
Scenario: Backup and restore course with preconfigured course LTI tool on the same site
Given the following "mod_lti > course tools" exist:
| name | description | baseurl | course | lti_resourcekey | lti_password | lti_launchcontainer |
| My course tool | Example description | http://www.example.com/lti/provider.php | C1 | my key | my secret | 5 |
# In the first course create an LTI module that uses a course preconfigured tool
And the following "mod_lti > tool instances" exist:
| name | tool | course |
| Test tool activity 2 | My course tool | C1 |
And I am on the "Course 1" course page logged in as admin
# Backup course and restore into another course
And I backup "Course 1" course using this options:
| Confirmation | Filename | test_backup.mbz |
When I restore "test_backup.mbz" backup into "Course 2" course using this options:
# Make sure the copy of the preconfigured tool was created in the second course with both encrypted and non-encrypted properties.
And I am on "Course 2" course homepage with editing mode on
And I open "Test tool activity 2" actions menu
And I choose "Edit settings" in the open action menu
And the field "Activity name" matches value "Test tool activity 2"
And I am on "Course 1" course homepage
And I navigate to "LTI External tools" in current page administration
Then I should see "My course tool"
And I open the action menu in "My course tool" "table_row"
And I choose "Edit" in the open action menu
And the field "Tool URL" matches value "http://www.example.com/lti/provider.php"
And the field "Consumer key" matches value "my key"
And the field "Shared secret" matches value "my secret"
And the field "Default launch container" matches value "Existing window"
+35
View File
@@ -0,0 +1,35 @@
@mod @mod_lti
Feature: Content-Item support
In order to easily add activities and content in a course from an external tool
As a teacher
I need to utilise a tool that supports the Deep Linking (Content-Item Message) type
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "mod_lti > tool types" exist:
| name | description | baseurl | coursevisible | state | lti_contentitem |
| Teaching Tool 1 | Tool 1 description | /mod/lti/tests/fixtures/tool_provider.php | 2 | 1 | 1 |
@javascript
Scenario: Tool that supports Deep Linking should be able to configure a tool via the Select content button
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I add a "Teaching Tool 1" to section "1" using the activity chooser
Then "Select content" "button" should be visible
And the "Select content" "button" should be enabled
Scenario: Editing the settings for an instance of a tool configured with Deep Linking support
Given the following "mod_lti > tool instances" exist:
| name | tool | course |
| Test tool activity 1 | Teaching Tool 1 | C1 |
When I am on the "Test tool activity 1" "lti activity editing" page logged in as teacher1
Then I should see "Select content"
And the "Select content" "button" should be enabled
@@ -0,0 +1,32 @@
@mod @mod_lti
Feature: Create/edit tool configuration that has Deep Linking support
In order to provide external tools that support Deep Linking for teachers and learners
As an admin
I need to be able to configure external tool registrations that support Deep Linking.
Background:
Given I log in as "admin"
And I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
Scenario: Verifying ContentItemSelectionRequest selection support in external tool registration
When I follow "Manage external tool registrations"
And I follow "Configure a new external tool registration"
Then I should see "ContentItemSelectionRequest" in the "Capabilities" "select"
@javascript
Scenario: Creating and editing tool configuration that has Content-Item support
When I follow "configure a tool manually"
And I set the field "Tool name" to "Test tool"
And I set the field "Tool URL" to local url "/mod/lti/tests/fixtures/tool_provider.php"
And I set the field "Tool configuration usage" to "Show in activity chooser and as a preconfigured tool"
And I expand all fieldsets
And I set the field "Supports Deep Linking (Content-Item Message)" to "1"
And I press "Save changes"
And I follow "Edit"
And I expand all fieldsets
Then the field "Supports Deep Linking (Content-Item Message)" matches value "1"
And I set the field "Supports Deep Linking (Content-Item Message)" to "0"
And I press "Save changes"
And I follow "Edit"
And I expand all fieldsets
And the field "Supports Deep Linking (Content-Item Message)" matches value "0"
@@ -0,0 +1,53 @@
@mod @mod_lti @core_completion
Feature: View activity completion information in the LTI activity
In order to have visibility of LTI completion requirements
As a student
I need to be able to view my LTI completion progress
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 0 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber | completion | completionview | completionusegrade |
| lti | Music history | C1 | lti1 | 2 | 1 | 1 |
Scenario: View automatic completion items as a teacher
Given I am on the "Music history" "lti activity" page logged in as teacher1
Then "Music history" should have the "Receive a grade" completion condition
And "Music history" should have the "View" completion condition
@javascript
Scenario: View automatic completion items as a student
Given I am on the "Music history" "lti activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I give the grade "90.00" to the user "Vinnie Student1" for the grade item "Music history"
And I press "Save changes"
When I am on the "Music history" "lti activity" page logged in as student1
Then the "Receive a grade" completion condition of "Music history" is displayed as "done"
And the "View" completion condition of "Music history" is displayed as "done"
@javascript
Scenario: Use manual completion
Given I am on the "Music history" "lti activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Students must manually mark the activity as done" to "1"
And I press "Save and display"
# Teacher view.
And the manual completion button for "Music history" should be disabled
# Student view.
When I am on the "Music history" "lti activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
@@ -0,0 +1,56 @@
@mod @mod_lti @core_completion
Feature: Pass grade activity completion information in the LTI activity
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Vinnie | Student1 | student1@example.com |
| student2 | Vinnie | Student2 | student2@example.com |
| student3 | Vinnie | Student3 | student3@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 0 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | gradepass | completion | completionview | completionusegrade | completionpassgrade |
| lti | Music history | C1 | 50 | 2 | 1 | 1 | 1 |
Scenario: View automatic completion items as a teacher
Given I am on the "Music history" "lti activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Receive a grade" completion condition
And "Music history" should have the "Receive a passing grade" completion condition
@javascript
Scenario: View automatic completion items as a student
Given I am on the "Music history" "lti activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo"
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I give the grade "90.00" to the user "Vinnie Student1" for the grade item "Music history"
And I give the grade "20.00" to the user "Vinnie Student2" for the grade item "Music history"
And I press "Save changes"
When I am on the "Music history" "lti activity" page logged in as student1
Then the "Receive a grade" completion condition of "Music history" is displayed as "done"
Then the "Receive a passing grade" completion condition of "Music history" is displayed as "done"
And the "View" completion condition of "Music history" is displayed as "done"
When I am on the "Music history" "lti activity" page logged in as student2
Then the "Receive a grade" completion condition of "Music history" is displayed as "done"
Then the "Receive a passing grade" completion condition of "Music history" is displayed as "failed"
And the "View" completion condition of "Music history" is displayed as "done"
When I am on the "Music history" "lti activity" page logged in as student3
Then the "Receive a grade" completion condition of "Music history" is displayed as "todo"
Then the "Receive a passing grade" completion condition of "Music history" is displayed as "todo"
And the "View" completion condition of "Music history" is displayed as "done"
And I am on the "Course 1" course page logged in as teacher1
And "Vinnie Student1" user has completed "Music history" activity
And "Vinnie Student2" user has completed "Music history" activity
And "Vinnie Student3" user has not completed "Music history" activity
@@ -0,0 +1,290 @@
@mod @mod_lti
Feature: Manage course tools
In order to provide richer experiences for learners
As a teacher
I need to be able to add external tools to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| format | topics |
| numsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following config values are set as admin:
| enableasyncbackup | 0 |
Scenario: Create a course tool from the zero state
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "LTI External tools" in current page administration
And I should see "LTI External tools are add-on apps"
And I should see "There are no LTI External tools yet."
When I click on "Add tool" "link"
And I press "Cancel"
Then I should see "LTI External tools are add-on apps"
And I should see "There are no LTI External tools yet."
And I click on "Add tool" "link"
And I set the following fields to these values:
| Tool name | Teaching Tool 1 |
| Tool URL | http://example.com |
| Tool description | A short description of the tool |
And I press "Save changes"
And I should see "Teaching Tool 1 added"
And I should see "A short description of the tool" in the "Teaching Tool 1" "table_row"
Scenario: Viewing a site level tool in the course tools table
# The first tool isn't visible in courses, the next two are, and the last tool is in a pending state and is not visible.
Given the following "mod_lti > tool types" exist:
| name | description | baseurl | coursevisible | state |
| Example tool | Another description | https://example.com/tool1 | 0 | 1 |
| Test tool 2 | Tool2 description | https://example.com/tool2 | 1 | 1 |
| Test tool 3 | Tool3 description | https://example.com/tool3 | 2 | 1 |
| Test tool 4 | Tool4 description | https://example.com/tool4 | 2 | 2 |
And I am on the "Course 1" course page logged in as teacher1
When I navigate to "LTI External tools" in current page administration
Then I should see "Test tool 2" in the "reportbuilder-table" "table"
And "You don't have permission to edit this tool" "icon" should exist in the "Test tool 2" "table_row"
And I should see "Test tool 3" in the "reportbuilder-table" "table"
And "You don't have permission to edit this tool" "icon" should exist in the "Test tool 3" "table_row"
And I should not see "Example tool" in the "reportbuilder-table" "table"
And I should not see "Test tool 4" in the "reportbuilder-table" "table"
Scenario: Viewing course tools without the capability to add/edit but having the capability to use
Given the following "role capability" exists:
| role | editingteacher |
| mod/lti:addcoursetool | prohibit |
| mod/lti:addpreconfiguredinstance | allow |
And the following "mod_lti > course tools" exist:
| name | description | baseurl | course |
| Test tool | Example description | https://example.com/tool | C1 |
And I am on the "Course 1" course page logged in as teacher1
When I navigate to "LTI External tools" in current page administration
Then "You don't have permission to edit this tool" "icon" should exist in the "Test tool" "table_row"
Scenario: Viewing course tools with the capability to add/edit and without the capability to use
Given the following "role capability" exists:
| role | editingteacher |
| mod/lti:addcoursetool | allow |
| mod/lti:addpreconfiguredinstance | prohibit |
And the following "mod_lti > course tools" exist:
| name | description | baseurl | course |
| Test tool | Example description | https://example.com/tool | C1 |
When I am on the "Course 1" course page logged in as teacher1
Then "LTI External tools" "link" should not exist in current page administration
@javascript
Scenario: Edit a course tool
Given the following "mod_lti > course tools" exist:
| name | description | baseurl | course |
| Test tool | Example description | https://example.com/tool | C1 |
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "LTI External tools" in current page administration
And the "Edit" item should exist in the "Actions" action menu of the "Test tool" "table_row"
And the "Delete" item should exist in the "Actions" action menu of the "Test tool" "table_row"
When I open the action menu in "Test tool" "table_row"
And I choose "Edit" in the open action menu
And I press "Cancel"
Then I should see "Test tool" in the "reportbuilder-table" "table"
And I open the action menu in "Test tool" "table_row"
And I choose "Edit" in the open action menu
And I set the following fields to these values:
| Tool name | Test tool (edited) |
| Tool URL | http://example.com |
| Tool description | A short description of the tool (edited) |
And I press "Save changes"
And I should see "Changes saved"
And I should see "A short description of the tool (edited)" in the "Test tool (edited)" "table_row"
@javascript
Scenario: Navigate through the listing of course tools
Given 20 "mod_lti > course tools" exist with the following data:
| name | Test tool [count] |
| description | Example description [count] |
| baseurl | https://www.example.com/tool[count] |
| course | C1 |
And I am on the "Course 1" course page logged in as teacher1
When I navigate to "LTI External tools" in current page administration
Then I should see "Test tool 1" in the "reportbuilder-table" "table"
And I click on "Name" "link"
And I should see "Test tool 20" in the "reportbuilder-table" "table"
And I click on "2" "link" in the "page" "region"
And I should see "Test tool 1" in the "reportbuilder-table" "table"
@javascript
Scenario: Delete a course tool
Given the following "mod_lti > course tools" exist:
| name | description | baseurl | course |
| Test tool | Example description | https://example.com/tool | C1 |
| Another tool | Example 123 | https://another.example.com/tool | C1 |
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "LTI External tools" in current page administration
When I open the action menu in "Test tool" "table_row"
And I choose "Delete" in the open action menu
Then I should see "This will delete Test tool from the available LTI tools in your course."
And I click on "Cancel" "button" in the "Delete Test tool" "dialogue"
And I should see "Test tool" in the "reportbuilder-table" "table"
And I open the action menu in "Test tool" "table_row"
And I choose "Delete" in the open action menu
And I should see "This will delete Test tool from the available LTI tools in your course."
And I click on "Delete" "button" in the "Delete Test tool" "dialogue"
And I should see "Test tool deleted"
And I should not see "Test tool" in the "reportbuilder-table" "table"
@javascript
Scenario: Add a course tool using a cartridge URL
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "LTI External tools" in current page administration
When I click on "Add tool" "link"
And I set the following fields to these values:
| Tool name | Test tool 1 |
| Tool description | Test tool 1 description |
And I set the field "Tool URL" to local url "/mod/lti/tests/fixtures/ims_cartridge_basic_lti_link.xml"
And I press "Save changes"
Then I should see "Test tool 1" in the "reportbuilder-table" "table"
# The cartridge description, if set, overrides the description set in the type edit form (bug?).
And I should see "Example tool description" in the "Test tool 1" "table_row"
And I open the action menu in "Test tool 1" "table_row"
And I choose "Edit" in the open action menu
And the field "Tool name" matches value "Test tool 1"
And the field "Tool URL" matches value "http://www.example.com/lti/provider.php"
And the field "Icon URL" matches value "http://download.moodle.org/unittest/test.jpg"
And the field "Secure icon URL" matches value "https://download.moodle.org/unittest/test.jpg"
@javascript
Scenario: Site tool appearing in activity chooser according to settings
Given the following "mod_lti > tool types" exist:
| name | baseurl | coursevisible | state |
| Teaching Tool 1 | /mod/lti/tests/fixtures/tool_provider.php | 2 | 1 |
| Teaching Tool 2 | /mod/lti/tests/fixtures/tool_provider.php | 1 | 1 |
| Teaching Tool 3 | /mod/lti/tests/fixtures/tool_provider.php | 0 | 1 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 2 | C2 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C2 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-dialog" "css_element"
And I navigate to "LTI External tools" in current page administration
And I should not see "Teaching Tool 3"
And I click on "Don't show in activity chooser" "field" in the "Teaching Tool 1" "table_row"
And I click on "Show in activity chooser" "field" in the "Teaching Tool 2" "table_row"
And I am on "Course 1" course homepage
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should not see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-dialog" "css_element"
# Should not affect other courses.
And I am on "Course 2" course homepage
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-dialog" "css_element"
And I am on "Course 1" course homepage
And I navigate to "LTI External tools" in current page administration
And I click on "Show in activity chooser" "field" in the "Teaching Tool 1" "table_row"
And I click on "Don't show in activity chooser" "field" in the "Teaching Tool 2" "table_row"
And I am on "Course 1" course homepage
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
When the following "role capability" exists:
| role | editingteacher |
| mod/lti:addcoursetool | prohibit |
And I am on "Course 1" course homepage with editing mode on
And I navigate to "LTI External tools" in current page administration
Then the "Don't show in activity chooser" "field" should be disabled
And the "Show in activity chooser" "field" should be disabled
@javascript
Scenario: Course tool appearing in activity chooser according to settings
Given the following "mod_lti > course tools" exist:
| name | baseurl | course | coursevisible |
| Course Tool 1 | /mod/lti/tests/fixtures/tool_provider.php | C1 | 2 |
| Course Tool 2 | /mod/lti/tests/fixtures/tool_provider.php | C1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Course Tool 1" in the ".modal-body" "css_element"
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-dialog" "css_element"
And I navigate to "LTI External tools" in current page administration
And I click on "Don't show in activity chooser" "field" in the "Course Tool 1" "table_row"
And I click on "Show in activity chooser" "field" in the "Course Tool 2" "table_row"
And I am on "Course 1" course homepage
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should not see "Course Tool 1" in the ".modal-body" "css_element"
And I should see "Course Tool 2" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-dialog" "css_element"
And I navigate to "LTI External tools" in current page administration
And I click on "Show in activity chooser" "field" in the "Course Tool 1" "table_row"
And I click on "Don't show in activity chooser" "field" in the "Course Tool 2" "table_row"
And I am on "Course 1" course homepage
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Course Tool 1" in the ".modal-body" "css_element"
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
When the following "role capability" exists:
| role | editingteacher |
| mod/lti:addcoursetool | prohibit |
And I am on "Course 1" course homepage with editing mode on
And I navigate to "LTI External tools" in current page administration
Then the "Don't show in activity chooser" "field" should be disabled
And the "Show in activity chooser" "field" should be disabled
@javascript
Scenario: Site and course tools settings are preserved when backup and restore
Given the following "mod_lti > tool types" exist:
| name | baseurl | coursevisible | state |
| Teaching Tool 1 | /mod/lti/tests/fixtures/tool_provider.php | 2 | 1 |
| Teaching Tool 2 | /mod/lti/tests/fixtures/tool_provider.php | 1 | 1 |
And the following "mod_lti > course tools" exist:
| name | description | baseurl | course |
| Course Tool 1 | Example description | https://example.com/tool | C1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Teaching Tool 1" to section "1" using the activity chooser
And I set the field "Activity name" to "Test tool activity 1"
And I press "Save and return to course"
And I add a "Course Tool 1" to section "1" using the activity chooser
And I set the field "Activity name" to "Course tool activity 1"
And I press "Save and return to course"
And I navigate to "LTI External tools" in current page administration
And I click on "Don't show in activity chooser" "field" in the "Teaching Tool 1" "table_row"
And I click on "Show in activity chooser" "field" in the "Teaching Tool 2" "table_row"
And I click on "Don't show in activity chooser" "field" in the "Course Tool 1" "table_row"
And I am on "Course 1" course homepage
And I add a "Teaching Tool 2" to section "1" using the activity chooser
And I set the field "Activity name" to "Test tool activity 2"
And I press "Save and return to course"
When I backup "Course 1" course using this options:
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into a new course using this options:
| Schema | Course name | Restored course |
And I should see "Restored course"
And I click on "Add an activity or resource" "button" in the "General" "section"
Then I should not see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-dialog" "css_element"
And I navigate to "LTI External tools" in current page administration
And I should see "Show in activity chooser" in the "Teaching Tool 1" "table_row"
And I should see "Don't show in activity chooser" in the "Teaching Tool 2" "table_row"
And I should see "Show in activity chooser" in the "Course Tool 1" "table_row"
+22
View File
@@ -0,0 +1,22 @@
@mod @mod_lti
Feature: Rename external tools via inline editing
In order to keep track of my activities
As a teacher
I need to be able to rename the LTI tool and have it's name change in the gradebook
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "activities" exist:
| activity | course | name |
| lti | C1 | Test tool activity 1 |
@javascript
Scenario: Add a tool and inline edit
When I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I set the field "Edit title" in the "Test tool activity 1" "activity" to "Test tool activity renamed"
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should not see "Test tool activity 1"
And I should see "Test tool activity renamed"
@@ -0,0 +1,114 @@
@mod @mod_lti
Feature: Make an LTI only available to specific course categories
In order to restrict which courses a tool can be used in
As an administrator
I need to be able to select which course category the tool is available in
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "categories" exist:
| name | category | idnumber |
| cata | 0 | cata |
| catca | cata | catca |
| catb | 0 | catb |
| catcb | catb | catcb |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | cata |
| Course 2 | C2 | catb |
| Course 3 | C3 | catca |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
| teacher1 | C3 | editingteacher |
And the following "mod_lti > tool types" exist:
| name | description | baseurl | coursevisible | state | lti_coursecategories |
| Teaching Tool 1 | Tool 1 description | /mod/lti/tests/fixtures/tool_provider.php | 1 | 1 | catb |
| Teaching Tool 2 | Tool 2 description | /mod/lti/tests/fixtures/tool_provider.php | 2 | 1 | catca |
Scenario: Tool is set to "Show as preconfigured tool when adding an external tool" on parent category
Given I am on the "Course 2" course page logged in as teacher1
When I navigate to "LTI External tools" in current page administration
Then I should see "Teaching Tool 1" in the "reportbuilder-table" "table"
And I should not see "Teaching Tool 2" in the "reportbuilder-table" "table"
@javascript
Scenario: Tool is set to "Show in activity chooser and as preconfigured tool" on child category
Given I log in as "teacher1"
When I am on "Course 3" course homepage with editing mode on
And I open the activity chooser
Then I should see "Teaching Tool 2" in the "Add an activity or resource" "dialogue"
And I should not see "Teaching Tool 1" in the "Add an activity or resource" "dialogue"
@javascript
Scenario: View a course in a category in which no tools are available
Given I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode on
And I open the activity chooser
Then I should not see "Teaching Tool 1" in the "Add an activity or resource" "dialogue"
And I should not see "Teaching Tool 2" in the "Add an activity or resource" "dialogue"
@javascript
Scenario: Editing and saving selected parent / child categories
Given I log in as "admin"
And I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I follow "Manage preconfigured tools"
And I follow "Add preconfigured tool"
And I expand all fieldsets
And I click on "catb" "link"
And I set the following fields to these values:
| Tool name | Teaching Tool 3 |
| Tool configuration usage | Do not show; use only when a matching tool URL is entered |
| catb | 1 |
# If parent is selected, child should be selected.
And the field "catcb" matches value "1"
# If parent is unselected, child should be unselected.
And I set the following fields to these values:
| catb | 0 |
And the field "catcb" matches value "0"
# If parent is selected, child is unselected, parent should still be selected.
# Step 1 - Select parent first so child is selected.
And I set the following fields to these values:
| catb | 1 |
And the field "catcb" matches value "1"
# Step 2 - Unselect child but parent should stay as selected.
And I set the following fields to these values:
| catcb | 0 |
And the field "catb" matches value "1"
And I set the field "Tool URL" to local url "/mod/lti/tests/fixtures/tool_provider.php"
And I press "Save changes"
And I wait until the page is ready
And I should see "Teaching Tool 3"
When I click on "Update" "link" in the "Teaching Tool 3" "table_row"
And I expand all fieldsets
Then the following fields match these values:
| catb | 1 |
| catcb | 0 |
@javascript
Scenario: Category restriction only shown for a site tool
Given the following "mod_lti > tool types" exist:
| name | baseurl | coursevisible | state |
| Teaching Tool 1 | /mod/lti/tests/fixtures/tool_provider.php | 2 | 1 |
And the following "mod_lti > course tools" exist:
| name | description | baseurl | course |
| Course Tool 1 | Example description | https://example.com/tool | C1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "LTI External tools" in current page administration
When I click on "Add tool" "link"
And I should not see "Restrict to category"
And I press "Cancel"
And I open the action menu in "Course Tool 1" "table_row"
And I choose "Edit" in the open action menu
And I should not see "Restrict to category"
And I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I follow "Manage preconfigured tools"
And I follow "Add preconfigured tool"
And I should see "Restrict to category"
And I press "Cancel"
And I click on "Update" "link" in the "Teaching Tool 1" "table_row"
Then I should see "Restrict to category"
@@ -0,0 +1,40 @@
@mod @mod_lti
Feature: Verify the breadcrumbs in manage tools site administration pages
Whenever I navigate to manage tools page in site administration
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
Scenario: Verify the breadcrumbs in manage tools page as an admin
Given I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And "Manage tools" "text" should exist in the ".breadcrumb" "css_element"
And "External tool" "link" should exist in the ".breadcrumb" "css_element"
And "Activity modules" "link" should exist in the ".breadcrumb" "css_element"
When I click on "configure a tool manually" "link"
Then "External tool configuration" "text" should exist in the ".breadcrumb" "css_element"
And "Manage tools" "link" should exist in the ".breadcrumb" "css_element"
And "External tool" "link" should exist in the ".breadcrumb" "css_element"
And "Activity modules" "link" should exist in the ".breadcrumb" "css_element"
And I press "Cancel"
And I click on "Manage preconfigured tools" "link"
And "Manage preconfigured tools" "text" should exist in the ".breadcrumb" "css_element"
And "External tool" "link" should exist in the ".breadcrumb" "css_element"
And "Activity modules" "link" should exist in the ".breadcrumb" "css_element"
And I click on "Add preconfigured tool" "link"
And "External tool configuration" "text" should exist in the ".breadcrumb" "css_element"
And "Manage tools" "link" should exist in the ".breadcrumb" "css_element"
And "External tool" "link" should exist in the ".breadcrumb" "css_element"
And "Activity modules" "link" should exist in the ".breadcrumb" "css_element"
And I press "Cancel"
And I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
And I click on "Manage external tool registrations" "link"
And "Manage external tool registrations" "text" should exist in the ".breadcrumb" "css_element"
And "External tool" "link" should exist in the ".breadcrumb" "css_element"
And "Activity modules" "link" should exist in the ".breadcrumb" "css_element"
And I click on "Configure a new external tool registration" "link"
And "Edit preconfigured tool" "text" should exist in the ".breadcrumb" "css_element"
And "Manage external tool registrations" "link" should exist in the ".breadcrumb" "css_element"
And "External tool" "link" should exist in the ".breadcrumb" "css_element"
And "Activity modules" "link" should exist in the ".breadcrumb" "css_element"
+32
View File
@@ -0,0 +1,32 @@
@mod @mod_lti
Feature: Configure tool types
In order to allow teachers to add external LTI tools
As an admin
I need to be able to add, remove and configure tool types
Background:
Given I log in as "admin"
And I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
@javascript
Scenario: Add a tool type from a cartridge URL
When I set the field "url" to local url "/mod/lti/tests/fixtures/ims_cartridge_basic_lti_link.xml"
And I press "Add Legacy LTI"
Then I should see "Enter your consumer key and shared secret"
And I press "Save changes"
And I should see "Example tool"
@javascript
Scenario: Try to add a non-existant cartridge
When I set the field "url" to local url "/mod/lti/tests/fixtures/nonexistant.xml"
And I press "Add Legacy LTI"
Then I should see "Enter your consumer key and shared secret"
And I press "Save changes"
And I should see "Failed to create new tool. Please check the URL and try again."
@javascript
Scenario: Attempt to add a tool type from a configuration URL, then cancel
When I set the field "url" to local url "/mod/lti/tests/fixtures/tool_provider.php"
And I press "Add Legacy LTI"
Then I should see "Cancel"
And I press "cancel-external-registration"
+30
View File
@@ -0,0 +1,30 @@
@mod @mod_lti
Feature: Navigate existing LTI tool types using pagination
In order to manage reusable activities for teachers
As an admin
I need to view existing tools
Background:
Given 100 "mod_lti > tool types" exist with the following data:
|name |Test tool [count] |
|description |Example description [count] |
|baseurl |https://www.example.com/tool[count]|
And I log in as "admin"
And I navigate to "Plugins > Activity modules > External tool > Manage tools" in site administration
@javascript
Scenario: View first page of tool types.
Then I should see "Test tool 30"
And "Test tool 70" "text" should not be visible
@javascript
Scenario: View second page of tool types using page 2 button.
When I click on "2" "link"
Then I should see "Test tool 70"
And "Test tool 30" "text" should not be visible
@javascript
Scenario: View last page of tool types using page 2 button.
When I click on "Last" "link"
Then I should see "Test tool 70"
And "Test tool 30" "text" should not be visible