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,39 @@
@core @core_files @_file_upload
Feature: Add a new custom file type
In order to add files of a custom type
As an admin
I need to add a new custom file type
@javascript
Scenario: Add custom file type
Given the following "courses" exist:
| fullname | shortname | category | legacyfiles |
| Course 1 | C1 | 0 | 2 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I navigate to "Server > File types" in site administration
And I press "Add a new file type"
And I set the following fields to these values:
| Extension | mdlr |
| MIME type | application/x-moodle-rules |
| File icon | document |
| Description type | Custom description specified in this form |
| Custom description | Moodle rules |
And I press "Save changes"
And I should see "application/x-moodle-rules"
And I log in as "teacher1"
When I add a resource activity to course "Course 1" section "1" and I fill the form with:
| Name | Test file |
| Select files | files/tests/fixtures/custom_filetype.mdlr |
| Show size | 1 |
| Show type | 1 |
| Display resource description | 1 |
And I am on "Course 1" course homepage
Then I should see "Test file"
And I should see "MDLR" in the "span.activitybadge" "css_element"
And I should not see "MDLR" in the "span.resourcelinkdetails" "css_element"
+35
View File
@@ -0,0 +1,35 @@
@core @core_files
Feature: Course files
In order to add legacy files
As a user
I need to upload files
@javascript
Scenario: Add legacy files
Given the following "courses" exist:
| fullname | shortname | category | legacyfiles |
| Course 1 | C1 | 0 | 2 |
And the following config values are set as admin:
| legacyfilesinnewcourses | 1 |
| legacyfilesaddallowed | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
Then I navigate to "Legacy course files" in current page administration
And I press "Edit legacy course files"
And "Add..." "link" should be visible
And "Create folder" "link" should be visible
@javascript
Scenario: Add legacy file disabled
Given the following "courses" exist:
| fullname | shortname | category | legacyfiles |
| Course 1 | C1 | 0 | 2 |
And the following config values are set as admin:
| legacyfilesinnewcourses | 1 |
| legacyfilesaddallowed | 0 |
When I log in as "admin"
And I am on "Course 1" course homepage
Then I navigate to "Legacy course files" in current page administration
And I press "Edit legacy course files"
And "Add..." "link" should not be visible
And "Create folder" "link" should not be visible
@@ -0,0 +1,56 @@
@core @core_files
Feature: View licence links
In order to get select the applicable licence when uploading a file
As a user
I need to be able to navigate to a page containing licence terms from the file manager
Background:
Given the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
@javascript
Scenario: Uploading a file displays licence list modal
Given I log in as "admin"
And I follow "Manage private files..."
And I follow "Add..."
And I follow "Upload a file"
And I click on "Help with Choose licence" "icon" in the "File picker" "dialogue"
Then I should see "Follow these links for further information on the available licence options:"
@javascript @_file_upload
Scenario: Altering a file should display licence list modal
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
And I click on "empty.txt" "link" in the "Manage private files" "dialogue"
And I click on "Help with Choose licence" "icon"
Then I should see "Follow these links for further information on the available licence options:"
@javascript @_file_upload
Scenario: Recent files should display licence list modal
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
And I follow "Add..."
And I click on "Recent files" "link" in the "File picker" "dialogue"
And I click on "empty.txt" "link" in the "File picker" "dialogue"
And I click on "Help with Choose licence" "icon" in the ".fp-setlicense" "css_element"
Then I should see "Follow these links for further information on the available licence options:"
@javascript @_file_upload
Scenario: Private files should display licence list modal
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I press "Save changes"
And I follow "Manage private files..."
And I follow "Add..."
And I click on "Private files" "link" in the "File picker" "dialogue"
And I click on "empty.txt" "link" in the "File picker" "dialogue"
And I click on "Help with Choose licence" "icon" in the ".fp-setlicense" "css_element"
Then I should see "Follow these links for further information on the available licence options:"