1 |
efrain |
1 |
@tool @tool_admin_presets @_file_upload @javascript
|
|
|
2 |
Feature: I can upload a preset file
|
|
|
3 |
|
|
|
4 |
Background: Go to the Import settings page
|
|
|
5 |
Given I log in as "admin"
|
|
|
6 |
And I navigate to "Site admin presets" in site administration
|
|
|
7 |
And I click on "Import preset" "link_or_button"
|
|
|
8 |
|
|
|
9 |
Scenario: Import settings and plugins from a valid XML file
|
|
|
10 |
Given I should see "Import site admin preset"
|
|
|
11 |
And I click on "Import" "button"
|
|
|
12 |
And I should see "You must supply a value here"
|
|
|
13 |
And I upload "admin/presets/tests/fixtures/import_settings_plugins.xml" file to "Select file" filemanager
|
|
|
14 |
And I click on "Import" "button"
|
|
|
15 |
And I should see "Setting changes"
|
|
|
16 |
And I should see "Imported preset"
|
|
|
17 |
And I should see "Enable portfolios" in the "core" "table_row"
|
|
|
18 |
And I should see "900" in the "mod_lesson" "table_row"
|
|
|
19 |
When I click on "Apply" "button"
|
|
|
20 |
And I should see "Setting changes"
|
|
|
21 |
And I should see "Unchanged settings"
|
|
|
22 |
And I click on "Continue" "button"
|
|
|
23 |
Then I should see "Imported preset" in the "Site admin presets table" "table"
|
|
|
24 |
And I navigate to "Advanced features" in site administration
|
|
|
25 |
And the following fields match these values:
|
|
|
26 |
| Enable portfolios | 1 |
|
|
|
27 |
And I navigate to "Plugins > Activity modules > Lesson" in site administration
|
|
|
28 |
And the following fields match these values:
|
|
|
29 |
| Popup window width | 900 |
|
|
|
30 |
|
|
|
31 |
Scenario: Rename imported settings
|
|
|
32 |
Given I should see "Import site admin preset"
|
|
|
33 |
And I set the field "Name" to "Renamed preset"
|
|
|
34 |
And I upload "admin/presets/tests/fixtures/import_settings_plugins.xml" file to "Select file" filemanager
|
|
|
35 |
And I click on "Import" "button"
|
|
|
36 |
And I should not see "Imported preset"
|
|
|
37 |
And I should see "Renamed preset"
|
|
|
38 |
When I click on "Apply" "button"
|
|
|
39 |
And I click on "Continue" "button"
|
|
|
40 |
Then I should not see "Imported preset" in the "Site admin presets table" "table"
|
|
|
41 |
And I should see "Renamed preset" in the "Site admin presets table" "table"
|
|
|
42 |
|
|
|
43 |
Scenario: Import settings from an invalid XML file
|
|
|
44 |
Given I set the field "Name" to "Renamed preset"
|
|
|
45 |
And I upload "admin/presets/tests/fixtures/invalid_xml_file.xml" file to "Select file" filemanager
|
|
|
46 |
When I click on "Import" "button"
|
|
|
47 |
Then I should see "Wrong file"
|
|
|
48 |
And I should not see "Setting changes"
|
|
|
49 |
And I navigate to "Site admin presets" in site administration
|
|
|
50 |
And I should not see "Renamed preset"
|
|
|
51 |
|
|
|
52 |
Scenario: Import unexisting settings category
|
|
|
53 |
Given I set the field "Name" to "Renamed preset"
|
|
|
54 |
And I upload "admin/presets/tests/fixtures/unexisting_category.xml" file to "Select file" filemanager
|
|
|
55 |
When I click on "Import" "button"
|
|
|
56 |
Then I should see "No valid settings"
|
|
|
57 |
And I should not see "Setting changes"
|
|
|
58 |
And I navigate to "Site admin presets" in site administration
|
|
|
59 |
And I should not see "Renamed preset"
|
|
|
60 |
|
|
|
61 |
Scenario: Import one unexisting setting
|
|
|
62 |
Given the following config values are set as admin:
|
|
|
63 |
| debug | 0 |
|
|
|
64 |
| debugdisplay | 0 |
|
|
|
65 |
And I set the field "Name" to "Renamed preset"
|
|
|
66 |
And I upload "admin/presets/tests/fixtures/import_settings_with_unexisting_setting.xml" file to "Select file" filemanager
|
|
|
67 |
When I click on "Import" "button"
|
|
|
68 |
And I should see "Setting changes"
|
|
|
69 |
And I should see "Enable portfolios" in the "core" "table_row"
|
|
|
70 |
And I should not see "No valid settings"
|
|
|
71 |
And I click on "Apply" "button"
|
|
|
72 |
And I should see "Setting changes"
|
|
|
73 |
And I click on "Continue" "button"
|
|
|
74 |
Then I should see "Renamed preset" in the "Site admin presets table" "table"
|
|
|
75 |
And I navigate to "Advanced features" in site administration
|
|
|
76 |
And the following fields match these values:
|
|
|
77 |
| Enable portfolios | 1 |
|