1 |
efrain |
1 |
@tool @tool_customlang @_file_upload
|
|
|
2 |
Feature: Within a moodle instance, an administrator should be able to import langstrings with several modes.
|
|
|
3 |
In order to import modified langstrings in the adminsettings from one to another instance,
|
|
|
4 |
As an admin
|
|
|
5 |
I need to be able to import only some language customisation strings depending on some conditions.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
# This is a very slow running feature and on slow databases can take minutes to complete.
|
|
|
9 |
Given I mark this test as slow setting a timeout factor of 4
|
|
|
10 |
|
|
|
11 |
# Add one customization.
|
|
|
12 |
And I log in as "admin"
|
|
|
13 |
And I navigate to "Language > Language customisation" in site administration
|
|
|
14 |
And I set the field "lng" to "en"
|
|
|
15 |
And I press "Open language pack for editing"
|
|
|
16 |
And I press "Continue"
|
|
|
17 |
And I set the field "Show strings of these components" to "moodle.php"
|
|
|
18 |
And I set the field "String identifier" to "administrationsite"
|
|
|
19 |
And I press "Show strings"
|
|
|
20 |
And I set the field "core/administrationsite" to "Custom string example"
|
|
|
21 |
And I press "Save changes to the language pack"
|
|
|
22 |
And I should see "There are 1 modified strings."
|
|
|
23 |
And I click on "Continue" "button"
|
|
|
24 |
And I should see "Custom string example"
|
|
|
25 |
|
|
|
26 |
@javascript
|
|
|
27 |
Scenario: Update only customized strings
|
|
|
28 |
When I set the field "lng" to "en"
|
|
|
29 |
And I click on "Import custom strings" "button"
|
|
|
30 |
And I press "Continue"
|
|
|
31 |
And I upload "admin/tool/customlang/tests/fixtures/moodle.php" file to "Language component(s)" filemanager
|
|
|
32 |
And I set the field "Import mode" to "Update only strings with local customisation"
|
|
|
33 |
And I press "Import file"
|
|
|
34 |
Then I should see "String core/administrationsite updated successfully."
|
|
|
35 |
And I should see "Ignoring string core/language because it is not customised."
|
|
|
36 |
And I should see "String core/nonexistentinvetedstring not found."
|
|
|
37 |
And I click on "Continue" "button"
|
|
|
38 |
And I should see "There are 1 modified strings."
|
|
|
39 |
And I should not see "Uploaded custom string"
|
|
|
40 |
And I click on "Save strings to language pack" "button"
|
|
|
41 |
And I click on "Continue" "button"
|
|
|
42 |
And I should not see "Custom string example"
|
|
|
43 |
And I should see "Uploaded custom string"
|
|
|
44 |
And I should not see "Another Uploaded string"
|
|
|
45 |
|
|
|
46 |
@javascript
|
|
|
47 |
Scenario: Create only new strings
|
|
|
48 |
When I set the field "lng" to "en"
|
|
|
49 |
And I click on "Import custom strings" "button"
|
|
|
50 |
And I press "Continue"
|
|
|
51 |
And I upload "admin/tool/customlang/tests/fixtures/moodle.php" file to "Language component(s)" filemanager
|
|
|
52 |
And I set the field "Import mode" to "Create only strings without local customisation"
|
|
|
53 |
And I press "Import file"
|
|
|
54 |
Then I should see "Ignoring string core/administrationsite because it is already defined."
|
|
|
55 |
And I should see "String core/language updated successfully."
|
|
|
56 |
And I should see "String core/nonexistentinvetedstring not found."
|
|
|
57 |
And I click on "Continue" "button"
|
|
|
58 |
And I should see "There are 1 modified strings."
|
|
|
59 |
And I should not see "Uploaded custom string"
|
|
|
60 |
And I click on "Save strings to language pack" "button"
|
|
|
61 |
And I click on "Continue" "button"
|
|
|
62 |
And I should see "Custom string example"
|
|
|
63 |
And I should not see "Uploaded custom string"
|
|
|
64 |
And I should see "Another Uploaded string"
|
|
|
65 |
|
|
|
66 |
@javascript
|
|
|
67 |
Scenario: Import all strings
|
|
|
68 |
When I set the field "lng" to "en"
|
|
|
69 |
And I click on "Import custom strings" "button"
|
|
|
70 |
And I press "Continue"
|
|
|
71 |
And I upload "admin/tool/customlang/tests/fixtures/moodle.php" file to "Language component(s)" filemanager
|
|
|
72 |
And I set the field "Import mode" to "Create or update all strings from the component(s)"
|
|
|
73 |
And I press "Import file"
|
|
|
74 |
Then I should see "String core/administrationsite updated successfully."
|
|
|
75 |
And I should see "String core/language updated successfully."
|
|
|
76 |
And I should see "String core/nonexistentinvetedstring not found."
|
|
|
77 |
And I click on "Continue" "button"
|
|
|
78 |
And I should see "There are 2 modified strings."
|
|
|
79 |
And I should not see "Uploaded custom string"
|
|
|
80 |
And I click on "Save strings to language pack" "button"
|
|
|
81 |
And I click on "Continue" "button"
|
|
|
82 |
And I should not see "Custom string example"
|
|
|
83 |
And I should see "Uploaded custom string"
|
|
|
84 |
And I should see "Another Uploaded string"
|