Merge branch 'MDL-77271-master' of https://github.com/lameze/moodle
This commit is contained in:
@@ -24,3 +24,26 @@ Feature: Delete custom licenses
|
||||
And I navigate to "Licence > Licence manager" in site administration
|
||||
Then I should see "Licence not specified" in the "unknown" "table_row"
|
||||
And I should not see "Delete" in the "unknown" "table_row"
|
||||
|
||||
@javascript @_file_upload
|
||||
Scenario: I cannot delete a custom license in use
|
||||
Given I log in as "admin"
|
||||
And I navigate to "Licence > Licence manager" in site administration
|
||||
And I click on "Create licence" "link"
|
||||
And I set the following fields to these values:
|
||||
| shortname | Test licence |
|
||||
| fullname | Test licence |
|
||||
| source | https://opensource.org/licenses/MIT |
|
||||
| Licence version | ##1 March 2019## |
|
||||
And I press "Save changes"
|
||||
And I follow "Private files" in the user menu
|
||||
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
|
||||
And I click on "moodle-logo.png" "link"
|
||||
And I set the field "Choose licence" to "Test licence"
|
||||
And I press "Update"
|
||||
And I press "Save changes"
|
||||
And I am on site homepage
|
||||
And I navigate to "Licence > Licence manager" in site administration
|
||||
And I click on "Delete" "icon" in the "Test licence" "table_row"
|
||||
When I click on "Save changes" "button" in the "Delete licence" "dialogue"
|
||||
Then I should see "Cannot delete a licence which is currently assigned to one or more files"
|
||||
|
||||
@@ -33,3 +33,26 @@ Feature: Licence manager
|
||||
And "This is the site default licence" "icon" should exist in the "cc" "table_row"
|
||||
And "Enable licence" "icon" should not exist in the "cc" "table_row"
|
||||
And "This is the site default licence" "icon" should not exist in the "public" "table_row"
|
||||
|
||||
@javascript @_file_upload
|
||||
Scenario Outline: User licence preference is remembered depending of setting value
|
||||
Given the following config values are set as admin:
|
||||
| sitedefaultlicense | cc |
|
||||
| rememberuserlicensepref | <rememberuserlicensepref> |
|
||||
And I log in as "admin"
|
||||
And I follow "Private files" in the user menu
|
||||
And I follow "Add..."
|
||||
And I follow "Upload a file"
|
||||
And the field with xpath "//select[@name='license']" matches value "Creative Commons"
|
||||
And I click on "Close" "button" in the "File picker" "dialogue"
|
||||
When I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
|
||||
| Save as | empty_copy.txt |
|
||||
| license | Public domain |
|
||||
And I press "Save changes"
|
||||
And I follow "Add..."
|
||||
Then the field with xpath "//select[@name='license']" matches value "<expectedlicence>"
|
||||
|
||||
Examples:
|
||||
| rememberuserlicensepref | expectedlicence |
|
||||
| 0 | Creative Commons |
|
||||
| 1 | Public domain |
|
||||
|
||||
Reference in New Issue
Block a user