Merge branch 'MDL-69583-master' of git://github.com/ferranrecio/moodle
[moodle.git] / admin / tool / customlang / tests / behat / import_files.feature
CommitLineData
489f6f26
FR
1@tool @tool_customlang @_file_upload
2Feature: Within a moodle instance, an administrator should be able to import modified langstrings.
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 the zips and php files of the language customisation of a language.
6
7 Background:
8 Given I log in as "admin"
9 And I navigate to "Language > Language customisation" in site administration
10 And I set the field "lng" to "en"
11 And I click on "Import custom strings" "button"
12 And I press "Continue"
13
14 @javascript
15 Scenario: Import a PHP file to add a new core lang customization
16 When I upload "admin/tool/customlang/tests/fixtures/tool_customlang.php" file to "Language component(s)" filemanager
17 And I press "Import file"
18 Then I should see "String tool_customlang/pluginname updated successfully."
19 And I should see "String tool_customlang/nonexistentinvetedstring not found."
20 And I click on "Continue" "button"
21 And I should see "There are 1 modified strings."
22 And I click on "Save strings to language pack" "button"
23 And I click on "Continue" "button"
24 And I should see "An amazing import feature" in the "page-header" "region"
25
26 @javascript
27 Scenario: Try to import a PHP file from a non existent component
28 When I upload "admin/tool/customlang/tests/fixtures/mod_fakecomponent.php" file to "Language component(s)" filemanager
29 And I press "Import file"
30 Then I should see "Missing component mod_fakecomponent."
31
32 @javascript
33 Scenario: Import a zip file with some PHP files in it.
34 When I upload "admin/tool/customlang/tests/fixtures/customlang.zip" file to "Language component(s)" filemanager
35 And I press "Import file"
36 Then I should see "String core/administrationsite updated successfully."
37 And I should see "String core/language updated successfully."
38 And I should see "String core/nonexistentinvetedstring not found."
39 And I should see "String tool_customlang/pluginname updated successfully."
40 And I should see "String tool_customlang/nonexistentinvetedstring not found."
41 And I should see "Missing component mod_fakecomponent."
42 And I click on "Continue" "button"
43 And I should see "There are 3 modified strings."
44 And I click on "Save strings to language pack" "button"
45 And I click on "Continue" "button"
46 And I should see "Uploaded custom string" in the "page-header" "region"
47 And I should see "Another Uploaded string" in the "page-header" "region"
48 And I should see "An amazing import feature" in the "page-header" "region"