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
@@ -0,0 +1,53 @@
@enrol @enrol_lti
Feature: Check that settings are adhered to when creating an enrolment plugin
In order to create an LTI enrolment instance
As an admin
I need to ensure the site-wide settings are used
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I navigate to "Plugins > Enrolments > Manage enrol plugins" in site administration
And I click on "Enable" "link" in the "Publish as LTI tool" "table_row"
And I navigate to "Plugins > Enrolments > Publish as LTI tool" in site administration
And I set the following fields to these values:
| Email visibility | Visible to everyone |
| City/town | Perth |
| Select a country | Australia |
| Timezone | Australia/Perth |
| Institution | Moodle Pty Ltd |
And I press "Save changes"
And I log out
Scenario: As an admin set site-wide settings for the enrolment plugin and ensure they are used
Given I log in as "teacher1"
And I am on the "Course 1" "enrolment methods" page
And I select "Publish as LTI tool" from the "Add method" singleselect
When I expand all fieldsets
Then the field "Email visibility" matches value "Visible to everyone"
And the field "City/town" matches value "Perth"
And the field "Select a country" matches value "Australia"
And the field "Timezone" matches value "Australia/Perth"
And the field "Institution" matches value "Moodle Pty Ltd"
And I set the following fields to these values:
| Email visibility | Hidden |
| City/town | Whistler |
| Select a country | Canada |
| Timezone | America/Vancouver |
| Institution | Moodle Pty Ltd - remote |
And I press "Add method"
And I click on "Edit" "link" in the "Publish as LTI tool" "table_row"
And the field "Email visibility" matches value "Hidden"
And the field "City/town" matches value "Whistler"
And the field "Select a country" matches value "Canada"
And the field "Timezone" matches value "America/Vancouver"
And the field "Institution" matches value "Moodle Pty Ltd - remote"
+55
View File
@@ -0,0 +1,55 @@
@enrol @enrol_lti
Feature: Check that the page listing the shared external tools is functioning as expected
In order to edit an external tool
As a teacher
I need to ensure the tool listing page is working as expected
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Test assignment name | Submit your online text | C1 | assign1 | 1 |
And I log in as "admin"
And I navigate to "Plugins > Enrolments > Manage enrol plugins" in site administration
And I click on "Enable" "link" in the "Publish as LTI tool" "table_row"
And I log out
Scenario: I want to edit an external tool
Given I log in as "teacher1"
And I turn editing mode on
And I am on the "Course 1" "enrolment methods" page
And I select "Publish as LTI tool" from the "Add method" singleselect
And I set the following fields to these values:
| Custom instance name | Assignment - LTI |
| Tool to be published | Test assignment name |
| LTI version | Legacy LTI (1.1/2.0) |
And I press "Add method"
And I am on "Course 1" course homepage
And I navigate to "Published as LTI tools" in current page administration
And I click on "Legacy LTI (1.1/2.0" "link"
And I should see "Assignment - LTI" in the ".generaltable" "css_element"
When I click on "Disable" "link" in the "Assignment - LTI" "table_row"
Then ".dimmed_text" "css_element" should exist in the "Assignment - LTI" "table_row"
And I click on "Enable" "link" in the "Assignment - LTI" "table_row"
And ".dimmed_text" "css_element" should not exist in the "Assignment - LTI" "table_row"
And I click on "Edit" "link" in the "Assignment - LTI" "table_row"
And I set the following fields to these values:
| Custom instance name | Course - LTI |
| Tool to be published | Course |
And I press "Save changes"
And I should see "Course - LTI" in the ".generaltable" "css_element"
And I click on "Delete" "link" in the "Course - LTI" "table_row"
And I press "Cancel"
And I should see "Course - LTI" in the ".generaltable" "css_element"
And I click on "Delete" "link" in the "Course - LTI" "table_row"
And I press "Continue"
And I should see "No resources or activities are published yet"
And I should not see "Course - LTI"
@@ -0,0 +1,105 @@
@enrol @enrol_lti
Feature: Publish activities and resources over LTI Advantage
In order to make content available to external platforms
As a teacher
I need to be able to publish and manage activities and resources using LTI Advantage
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Test assignment name | Submit your online text | C1 | assign1 | 1 |
And I enable "lti" "enrol" plugin
Scenario: A teacher can publish an activity
Given I log in as "teacher1"
And I am on the "Course 1" "enrolment methods" page
When I select "Publish as LTI tool" from the "Add method" singleselect
And the following fields match these values:
| LTI version | LTI Advantage |
And I set the following fields to these values:
| Custom instance name | Published assignment |
| Tool to be published | Test assignment name |
And I press "Add method"
And I am on "Course 1" course homepage
And I navigate to "Published as LTI tools" in current page administration
Then I should see "Launch URL" in the "Published assignment" "table_row"
And I should see "Custom properties" in the "Published assignment" "table_row"
And "Edit" "link" should exist in the "Published assignment" "table_row"
And "Delete" "link" should exist in the "Published assignment" "table_row"
And "Disable" "link" should exist in the "Published assignment" "table_row"
Scenario: A teacher can edit a published resource/activity
Given the following "enrol_lti > published resources" exist:
| name | uuid | activity | course |
| Published assignment | my-uuid-123 | assign1 | C1 |
And I am on the "Course 1" "Course" page logged in as "teacher1"
And I navigate to "Published as LTI tools" in current page administration
And the "value" attribute of "Custom properties" "field" should contain "id=my-uuid-123"
When I click on "Edit" "link" in the "Published assignment" "table_row"
And I set the following fields to these values:
| Custom instance name | New instance name |
And I press "Cancel"
And I should see "Published assignment" in the "Published assignment" "table_row"
And the "value" attribute of "Custom properties" "field" should contain "id=my-uuid-123"
And I click on "Edit" "link" in the "Published assignment" "table_row"
And I set the following fields to these values:
| Custom instance name | New instance name |
And I press "Save changes"
Then I should see "New instance name"
And the "value" attribute of "Custom properties" "field" should contain "id=my-uuid-123"
Scenario: A teacher can disable and enable a published resource/activity
Given the following "enrol_lti > published resources" exist:
| name | activity | course |
| Published assignment | assign1 | C1 |
And I am on the "Course 1" "Course" page logged in as "teacher1"
And I navigate to "Published as LTI tools" in current page administration
When I click on "Disable" "link" in the "Published assignment" "table_row"
Then ".dimmed_text" "css_element" should exist in the "Published assignment" "table_row"
And I click on "Enable" "link" in the "Published assignment" "table_row"
And ".dimmed_text" "css_element" should not exist in the "Published assignment" "table_row"
Scenario: A teacher can delete a published tool
Given the following "enrol_lti > published resources" exist:
| name | activity | course |
| Published assignment | assign1 | C1 |
And I am on the "Course 1" "Course" page logged in as "teacher1"
And I navigate to "Published as LTI tools" in current page administration
When I click on "Delete" "link" in the "Published assignment" "table_row"
And I press "Cancel"
And I should see "Published assignment" in the "Published assignment" "table_row"
And I click on "Delete" "link" in the "Published assignment" "table_row"
And I press "Continue"
And I should see "No resources or activities are published yet"
And I should not see "Published assignment"
Scenario: A teacher can switch the version of a published resource from LTI 1.1 to LTI Advantage
Given the following "enrol_lti > published resources" exist:
| name | activity | course | ltiversion |
| Published assignment | assign1 | C1 | LTI-1p0/LTI-2p0 |
And I am on the "Course 1" "Course" page logged in as "teacher1"
And I navigate to "Published as LTI tools" in current page administration
And I should see "No resources or activities are published yet"
And I click on "Legacy LTI (1.1/2.0)" "link"
And I should see "Published assignment"
When I click on "Edit" "link" in the "Published assignment" "table_row"
And the following fields match these values:
| LTI version | Legacy LTI (1.1/2.0) |
And I set the following fields to these values:
| LTI version | LTI Advantage |
| Custom instance name | New instance name |
And I press "Save changes"
And I click on "LTI Advantage" "link"
Then I should see "New instance name"
And "LTI Advantage" "link" should not exist
And "Legacy LTI (1.1/2.0)" "link" should exist
And the "value" attribute of "Custom properties" "field" should contain "id="
@@ -0,0 +1,215 @@
@enrol @enrol_lti
Feature: Register a platform with the tool
In order to share and consume a Moodle resource or activity over LTI Advantage
As an admin
I need to be able to manage platform registrations in the tool
Background:
Given I enable "lti" "enrol" plugin
Scenario: An admin can register a platform with the tool
Given I log in as "admin"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
When I follow "Register a platform"
And I set the following fields to these values:
| Platform name | My test platform |
And I press "Continue"
And I should see "Dynamic registration"
And I should see "Manual registration"
And I should see "Platform details"
And I follow "Back"
And "Manage deployments" "link" should exist in the "My test platform" "table_row"
And "View platform details" "link" should exist in the "My test platform" "table_row"
And "Delete" "link" should exist in the "My test platform" "table_row"
And I should see "Pending" in the "My test platform" "table_row"
And I click on "View platform details" "link" in the "My test platform" "table_row"
And I follow "Edit platform details"
And I set the following fields to these values:
| Platform ID (issuer) | https://lms.example.com |
| Client ID | abcd1234 |
| Authentication request URL | https://lms.example.com/auth |
| Public keyset URL | https://lms.example.com/jwks |
| Access token URL | https://lms.example.com/token |
And I press "Save changes"
Then I should see "Platform registration updated"
And I should see "My test platform" in the "Platform name" "table_row"
And I should see "https://lms.example.com" in the "Platform ID (issuer)" "table_row"
And I should see "abcd1234" in the "Client ID" "table_row"
And I should see "https://lms.example.com/auth" in the "Authentication request URL" "table_row"
And I should see "https://lms.example.com/jwks" in the "Public keyset URL" "table_row"
And I should see "https://lms.example.com/token" in the "Access token URL" "table_row"
And I follow "Back"
And I should see "https://lms.example.com" in the "My test platform" "table_row"
And I should see "Active" in the "My test platform" "table_row"
And "View platform details" "link" should exist in the "My test platform" "table_row"
And "Manage deployments" "link" should exist in the "My test platform" "table_row"
And "Delete" "link" should exist in the "My test platform" "table_row"
Scenario: An admin can edit a platform's registration details
Given the following "enrol_lti > application registrations" exist:
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token |
And I log in as "admin"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
When I click on "View platform details" "link" in the "My test platform" "table_row"
And I follow "Edit platform details"
And I set the following fields to these values:
| Platform name | Changed test platform |
| Platform ID (issuer) | https://lms2.example.com |
| Client ID | wxyz9876 |
| Authentication request URL | https://lms2.example.com/auth |
| Public keyset URL | https://lms2.example.com/jwks |
| Access token URL | https://lms2.example.com/token |
And I press "Cancel"
Then I should see "https://lms.example.com" in the "Platform ID (issuer)" "table_row"
And I follow "Edit platform details"
And the following fields match these values:
| Platform name | My test platform |
| Platform ID (issuer) | https://lms.example.com |
| Client ID | abcd1234 |
| Authentication request URL | https://lms.example.com/auth |
| Public keyset URL | https://lms.example.com/jwks |
| Access token URL | https://lms.example.com/token |
And I set the following fields to these values:
| Platform name | Changed test platform |
| Platform ID (issuer) | https://lms2.example.com |
| Client ID | wxyz9876 |
| Authentication request URL | https://lms2.example.com/auth |
| Public keyset URL | https://lms2.example.com/jwks |
| Access token URL | https://lms2.example.com/token |
And I press "Save changes"
And I should see "https://lms2.example.com" in the "Platform ID (issuer)" "table_row"
And I follow "Edit platform details"
And the following fields match these values:
| Platform name | Changed test platform |
| Platform ID (issuer) | https://lms2.example.com |
| Client ID | wxyz9876 |
| Authentication request URL | https://lms2.example.com/auth |
| Public keyset URL | https://lms2.example.com/jwks |
| Access token URL | https://lms2.example.com/token |
And I press "Cancel"
And I follow "Back"
And I should see "https://lms2.example.com" in the "Changed test platform" "table_row"
Scenario: An admin can delete a platform registration
Given the following "enrol_lti > application registrations" exist:
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token |
And I log in as "admin"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
When I click on "Delete" "link" in the "My test platform" "table_row"
And I press "Cancel"
Then I should see "https://lms.example.com" in the "My test platform" "table_row"
And I click on "Delete" "link" in the "My test platform" "table_row"
And I press "Continue"
And I should see "Platform registration deleted"
And I should not see "My test platform"
Scenario: A platform registration's unique platformid:clientid tuple must be enforced
Given the following "enrol_lti > application registrations" exist:
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token |
And I log in as "admin"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
When I follow "Register a platform"
And I set the following fields to these values:
| Platform name | My test platform |
And I press "Continue"
And I follow "Edit platform details"
And I set the following fields to these values:
| Platform name | My test platform |
| Platform ID (issuer) | https://lms.example.com |
| Client ID | abcd1234 |
| Authentication request URL | https://lms.example.com/auth |
| Public keyset URL | https://lms.example.com/jwks |
| Access token URL | https://lms.example.com/token |
And I press "Save changes"
Then I should see "Invalid client ID. This client ID is already registered for the platform ID provided."
Scenario: An admin can add deployment ids for a given platform registration
Given the following "enrol_lti > application registrations" exist:
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl |
| My test platform | https://lms.example.com | abcd1234 | https://lms.example.com/auth | https://lms.example.com/jwks | https://lms.example.com/token |
And I log in as "admin"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
When I click on "Manage deployments" "link" in the "My test platform" "table_row"
And I should see "No tool deployments found"
And I follow "Add a deployment"
And I set the following fields to these values:
| Deployment name | Sitewide deployment of Moodle on platform x |
| Deployment ID | 1a2b3c |
And I press "Cancel"
And I should not see "Sitewide deployment of Moodle on platform x"
And I should see "No tool deployments found"
And I follow "Add a deployment"
And I set the following fields to these values:
| Deployment name | Sitewide deployment of Moodle on platform x |
| Deployment ID | 1a2b3c |
And I press "Save changes"
Then I should see "Deployment added"
And I should see "1a2b3c" in the "Sitewide deployment of Moodle on platform x" "table_row"
And I should not see "No tool deployments found"
And "Delete" "link" should exist in the "Sitewide deployment of Moodle on platform x" "table_row"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
And "1" "link" should exist in the "My test platform" "table_row"
And I click on "1" "link" in the "My test platform" "table_row"
And I should see "1a2b3c" in the "Sitewide deployment of Moodle on platform x" "table_row"
And I follow "Add a deployment"
And I set the following fields to these values:
| Deployment name | Course context deployment of Moodle on platform x |
| Deployment ID | 4d5e6f |
And I press "Save changes"
And I should see "4d5e6f" in the "Course context deployment of Moodle on platform x" "table_row"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
And "2" "link" should exist in the "My test platform" "table_row"
Scenario: An admin can remove a deployment id for a platform registration
Given the following "enrol_lti > application registrations" exist:
| name | platformid | clientid | authrequesturl | jwksurl | accesstokenurl | deploymentname | deploymentid |
| 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 |
And I log in as "admin"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
And I should see "1" in the "My test platform" "table_row"
And I click on "Manage deployments" "link" in the "My test platform" "table_row"
And I should see "1a2b3c" in the "Site deployment" "table_row"
When I click on "Delete" "link" in the "Site deployment" "table_row"
And I press "Cancel"
Then I should see "1a2b3c" in the "Site deployment" "table_row"
And I click on "Delete" "link" in the "Site deployment" "table_row"
And I press "Continue"
And I should see "Deployment deleted"
And I should see "No tool deployments found"
And I should not see "1a2b3c"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
And "1" "link" should not exist in the "My test platform" "table_row"
@javascript
Scenario: An admin can copy the manual and dynamic registration endpoints to register the tool with the platform
Given the following "enrol_lti > application registrations" exist:
| name |
| My test platform |
And I log in as "admin"
And I change window size to "large"
And I navigate to "Plugins > Enrolments > Publish as LTI tool > Tool registration" in site administration
When I click on "View platform details" "link" in the "My test platform" "table_row"
And I follow "Tool details"
And the "value" attribute of "Registration URL" "field" should contain "enrol/lti/register.php"
And the "value" attribute of "Tool URL" "field" should contain "enrol/lti/launch.php"
And the "value" attribute of "Initiate login URL" "field" should contain "enrol/lti/login.php"
And the "value" attribute of "JWKS URL" "field" should contain "enrol/lti/jwks.php"
And the "value" attribute of "Deep linking URL" "field" should contain "enrol/lti/launch_deeplink.php"
And "Copy to clipboard" "button" should exist in the "Registration URL" "table_row"
And "Copy to clipboard" "button" should exist in the "Tool URL" "table_row"
And "Copy to clipboard" "button" should exist in the "Initiate login URL" "table_row"
And "Copy to clipboard" "button" should exist in the "JWKS URL" "table_row"
And "Copy to clipboard" "button" should exist in the "Deep linking URL" "table_row"
When I click on "Copy to clipboard" "button" in the "Registration URL" "table_row"
Then I should see "Registration URL copied to clipboard"
And I click on "Copy to clipboard" "button" in the "Tool URL" "table_row"
And I should see "Tool URL copied to clipboard"
And I click on "Copy to clipboard" "button" in the "Initiate login URL" "table_row"
And I should see "Initiate login URL copied to clipboard"
And I click on "Copy to clipboard" "button" in the "JWKS URL" "table_row"
And I should see "JWKS URL copied to clipboard"
And I click on "Copy to clipboard" "button" in the "Deep linking URL" "table_row"
And I should see "Deep linking URL copied to clipboard"