first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,33 @@
@tool @tool_customlang
Feature: Within a moodle instance, an administrator should be able to modify langstrings for the entire Moodle installation.
In order to change langstrings in the adminsettings of the instance,
As an admin
I need to be able to access and change values in the the language customisation of the language pack.
Background:
# This is a very slow running test and on slow databases can take minutes to complete.
Given I mark this test as slow setting a timeout factor of 4
And I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
And I press "Open language pack for editing"
And I press "Continue"
And I set the field "Show strings of these components" to "moodle.php"
And I set the field "String identifier" to "moodledocslink"
And I press "Show strings"
And I set the field "core/moodledocslink" to "moodle documents"
@javascript
Scenario: Edit an string but don't save it to lang pack.
When I press "Apply changes and continue editing"
Then I should not see "moodle documents" in the "page-footer" "region"
And I should see "Documentation for this page" in the "page-footer" "region"
@javascript
Scenario: Customize an string as admin and save it to lang pack.
Given I press "Save changes to the language pack"
And I should see "There are 1 modified strings."
When I click on "Continue" "button"
Then I should not see "Documentation for this page" in the "page-footer" "region"
And I should see "moodle documents" in the "page-footer" "region"
@@ -0,0 +1,53 @@
@tool @tool_customlang
Feature: Within a moodle instance, an administrator should be able to export modified langstrings.
In order to export modified langstrings in the adminsettings of the instance,
As an admin
I need to be able to export the php-files of the language customisation of a language.
Background:
# This is a very slow running feature and on slow databases can take minutes to complete.
Given I mark this test as slow setting a timeout factor of 4
@javascript
Scenario: Export button should not appear if no customization is made
Given I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
Then I should see "Open language pack for editing"
And I should not see "Export custom strings"
@javascript
Scenario: Export button should not appear if no customization is saved into langpack
Given I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
And I press "Open language pack for editing"
And I press "Continue"
And I set the field "Show strings of these components" to "moodle.php"
And I set the field "String identifier" to "accept"
And I press "Show strings"
And I set the field "core/accept" to "Accept-custom_export"
When I press "Apply changes and continue editing"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
Then I should see "Open language pack for editing"
And I should see "There are 1 modified strings."
And I should not see "Export custom strings"
@javascript
Scenario: Export the php-file including a customised langstring.
Given I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
And I press "Open language pack for editing"
And I press "Continue"
And I set the field "Show strings of these components" to "moodle.php"
And I set the field "String identifier" to "accept"
And I press "Show strings"
And I set the field "core/accept" to "Accept-custom_export"
When I press "Save changes to the language pack"
And I should see "There are 1 modified strings."
And I click on "Continue" "button"
Then I set the field "lng" to "en"
And I click on "Export custom strings" "button"
And I set the field "Select component(s) to export" to "moodle.php"
@@ -0,0 +1,51 @@
@tool @tool_customlang @_file_upload
Feature: Within a moodle instance, an administrator should be able to import modified langstrings.
In order to import modified langstrings in the adminsettings from one to another instance,
As an admin
I need to be able to import the zips and php files of the language customisation of a language.
Background:
# This is a very slow running test and on slow databases can take minutes to complete.
Given I mark this test as slow setting a timeout factor of 4
And I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
And I click on "Import custom strings" "button"
And I press "Continue"
@javascript
Scenario: Import a PHP file to add a new core lang customization
When I upload "admin/tool/customlang/tests/fixtures/tool_customlang.php" file to "Language component(s)" filemanager
And I press "Import file"
Then I should see "String tool_customlang/pluginname updated successfully."
And I should see "String tool_customlang/nonexistentinvetedstring not found."
And I click on "Continue" "button"
And I should see "There are 1 modified strings."
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should see "An amazing import feature"
@javascript
Scenario: Try to import a PHP file from a non existent component
When I upload "admin/tool/customlang/tests/fixtures/mod_fakecomponent.php" file to "Language component(s)" filemanager
And I press "Import file"
Then I should see "Missing component mod_fakecomponent."
@javascript
Scenario: Import a zip file with some PHP files in it.
When I upload "admin/tool/customlang/tests/fixtures/customlang.zip" file to "Language component(s)" filemanager
And I press "Import file"
Then I should see "String core/administrationsite updated successfully."
And I should see "String core/language updated successfully."
And I should see "String core/nonexistentinvetedstring not found."
And I should see "String tool_customlang/pluginname updated successfully."
And I should see "String tool_customlang/nonexistentinvetedstring not found."
And I should see "Missing component mod_fakecomponent."
And I click on "Continue" "button"
And I should see "There are 3 modified strings."
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should see "Uploaded custom string"
And I should see "Another Uploaded string"
And I should see "An amazing import feature"
@@ -0,0 +1,84 @@
@tool @tool_customlang @_file_upload
Feature: Within a moodle instance, an administrator should be able to import langstrings with several modes.
In order to import modified langstrings in the adminsettings from one to another instance,
As an admin
I need to be able to import only some language customisation strings depending on some conditions.
Background:
# This is a very slow running feature and on slow databases can take minutes to complete.
Given I mark this test as slow setting a timeout factor of 4
# Add one customization.
And I log in as "admin"
And I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
And I press "Open language pack for editing"
And I press "Continue"
And I set the field "Show strings of these components" to "moodle.php"
And I set the field "String identifier" to "administrationsite"
And I press "Show strings"
And I set the field "core/administrationsite" to "Custom string example"
And I press "Save changes to the language pack"
And I should see "There are 1 modified strings."
And I click on "Continue" "button"
And I should see "Custom string example"
@javascript
Scenario: Update only customized strings
When I set the field "lng" to "en"
And I click on "Import custom strings" "button"
And I press "Continue"
And I upload "admin/tool/customlang/tests/fixtures/moodle.php" file to "Language component(s)" filemanager
And I set the field "Import mode" to "Update only strings with local customisation"
And I press "Import file"
Then I should see "String core/administrationsite updated successfully."
And I should see "Ignoring string core/language because it is not customised."
And I should see "String core/nonexistentinvetedstring not found."
And I click on "Continue" "button"
And I should see "There are 1 modified strings."
And I should not see "Uploaded custom string"
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should not see "Custom string example"
And I should see "Uploaded custom string"
And I should not see "Another Uploaded string"
@javascript
Scenario: Create only new strings
When I set the field "lng" to "en"
And I click on "Import custom strings" "button"
And I press "Continue"
And I upload "admin/tool/customlang/tests/fixtures/moodle.php" file to "Language component(s)" filemanager
And I set the field "Import mode" to "Create only strings without local customisation"
And I press "Import file"
Then I should see "Ignoring string core/administrationsite because it is already defined."
And I should see "String core/language updated successfully."
And I should see "String core/nonexistentinvetedstring not found."
And I click on "Continue" "button"
And I should see "There are 1 modified strings."
And I should not see "Uploaded custom string"
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should see "Custom string example"
And I should not see "Uploaded custom string"
And I should see "Another Uploaded string"
@javascript
Scenario: Import all strings
When I set the field "lng" to "en"
And I click on "Import custom strings" "button"
And I press "Continue"
And I upload "admin/tool/customlang/tests/fixtures/moodle.php" file to "Language component(s)" filemanager
And I set the field "Import mode" to "Create or update all strings from the component(s)"
And I press "Import file"
Then I should see "String core/administrationsite updated successfully."
And I should see "String core/language updated successfully."
And I should see "String core/nonexistentinvetedstring not found."
And I click on "Continue" "button"
And I should see "There are 2 modified strings."
And I should not see "Uploaded custom string"
And I click on "Save strings to language pack" "button"
And I click on "Continue" "button"
And I should not see "Custom string example"
And I should see "Uploaded custom string"
And I should see "Another Uploaded string"
@@ -0,0 +1,21 @@
@tool @tool_customlang @javascript
Feature: Verify the breadcrumbs in language customisation site administration pages
Whenever I navigate to language customisation page in site administration
As an admin
The breadcrumbs should be visible
Background:
Given I log in as "admin"
Scenario: Verify the breadcrumbs in language customisation page by visiting open language pack for editing and import custom strings pages
Given I navigate to "Language > Language customisation" in site administration
And I set the field "lng" to "en"
When I click on "Open language pack for editing" "button"
And I wait until the page is ready
And "Language customisation" "text" should exist in the ".breadcrumb" "css_element"
And "Language" "link" should exist in the ".breadcrumb" "css_element"
And I press the "back" button in the browser
And I click on "Import custom strings" "button"
And I wait until the page is ready
And "Language customisation" "text" should exist in the ".breadcrumb" "css_element"
And "Language" "link" should exist in the ".breadcrumb" "css_element"