1 |
efrain |
1 |
@tool @tool_licensemanager
|
|
|
2 |
Feature: Licence manager
|
|
|
3 |
In order to manage licences
|
|
|
4 |
As an admin
|
|
|
5 |
I need to be able to view and alter licence preferences in the licence manager.
|
|
|
6 |
|
|
|
7 |
Scenario: I should be able to see the default Moodle licences.
|
|
|
8 |
Given I log in as "admin"
|
|
|
9 |
When I navigate to "Licence > Licence manager" in site administration
|
|
|
10 |
Then I should see "Licence not specified" in the "unknown" "table_row"
|
|
|
11 |
And I should see "All rights reserved" in the "allrightsreserved" "table_row"
|
|
|
12 |
And I should see "Public domain" in the "public" "table_row"
|
|
|
13 |
And I should see "Creative Commons - 4.0 International" in the "cc-4.0" "table_row"
|
|
|
14 |
And I should see "Creative Commons - NoDerivatives 4.0 International" in the "cc-nd-4.0" "table_row"
|
|
|
15 |
And I should see "Creative Commons - NonCommercial-NoDerivatives 4.0 International" in the "cc-nc-nd-4.0" "table_row"
|
|
|
16 |
And I should see "Creative Commons - NonCommercial-ShareAlike 4.0 International" in the "cc-nc-sa-4.0" "table_row"
|
|
|
17 |
And I should see "Creative Commons - ShareAlike 4.0 International" in the "cc-sa-4.0" "table_row"
|
|
|
18 |
And I should see "Creative Commons - NonCommercial 4.0 International" in the "cc-nc-4.0" "table_row"
|
|
|
19 |
|
|
|
20 |
Scenario: I should be able to enable and disable licences
|
|
|
21 |
Given I log in as "admin"
|
|
|
22 |
And I navigate to "Licence > Licence settings" in site administration
|
|
|
23 |
When I set the field "Default site licence" to "Public domain"
|
|
|
24 |
And I press "Save changes"
|
|
|
25 |
And I navigate to "Licence > Licence manager" in site administration
|
|
|
26 |
Then "This is the site default licence" "icon" should exist in the "public" "table_row"
|
|
|
27 |
And "Enable licence" "icon" should not exist in the "public" "table_row"
|
|
|
28 |
And "This is the site default licence" "icon" should not exist in the "cc-4.0" "table_row"
|
|
|
29 |
And I navigate to "Licence > Licence settings" in site administration
|
|
|
30 |
And I set the field "Default site licence" to "Creative Commons"
|
|
|
31 |
And I press "Save changes"
|
|
|
32 |
And I navigate to "Licence > Licence manager" in site administration
|
|
|
33 |
And "This is the site default licence" "icon" should exist in the "cc-4.0" "table_row"
|
|
|
34 |
And "Enable licence" "icon" should not exist in the "cc-4.0" "table_row"
|
|
|
35 |
And "This is the site default licence" "icon" should not exist in the "public" "table_row"
|
|
|
36 |
|
|
|
37 |
@javascript @_file_upload
|
|
|
38 |
Scenario Outline: User licence preference is remembered depending of setting value
|
|
|
39 |
Given the following config values are set as admin:
|
|
|
40 |
| sitedefaultlicense | cc-4.0 |
|
|
|
41 |
| rememberuserlicensepref | <rememberuserlicensepref> |
|
|
|
42 |
And I log in as "admin"
|
|
|
43 |
And I follow "Private files" in the user menu
|
|
|
44 |
And I follow "Add..."
|
|
|
45 |
And I follow "Upload a file"
|
|
|
46 |
And the field with xpath "//select[@name='license']" matches value "Creative Commons - 4.0 International"
|
|
|
47 |
And I click on "Close" "button" in the "File picker" "dialogue"
|
|
|
48 |
When I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as:
|
|
|
49 |
| Save as | empty_copy.txt |
|
|
|
50 |
| license | Public domain |
|
|
|
51 |
And I press "Save changes"
|
|
|
52 |
And I follow "Add..."
|
|
|
53 |
Then the field with xpath "//select[@name='license']" matches value "<expectedlicence>"
|
|
|
54 |
|
|
|
55 |
Examples:
|
|
|
56 |
| rememberuserlicensepref | expectedlicence |
|
|
|
57 |
| 0 | Creative Commons - 4.0 International |
|
|
|
58 |
| 1 | Public domain |
|