Skip to content

Commit

Permalink
MDL-84321 lang: Use the fixed strings in tests, too
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Jan 27, 2025
1 parent cb4070a commit 3f38b28
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion ai/classes/table/aiprovider_management_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use moodle_url;

/**
* Table to manage AI Provider plugins.
* Table to manage AI provider plugins.
*
* @package core_ai
* @copyright 2024 Matt Porritt <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion ai/classes/table/aiprovider_management_table_filterset.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace core_ai\table;

/**
* AI Provider management table filter set.
* AI provider management table filter set.
*
* @package core_ai
* @copyright 2024 Matt Porritt <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion ai/provider/azureai/classes/hook_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use core_ai\hook\after_ai_provider_form_hook;

/**
* Hook listener for Azure AI Provider.
* Hook listener for Azure AI provider.
*
* @package aiprovider_azureai
* @copyright 2024 Matt Porritt <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion ai/provider/azureai/db/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Hook listener callbacks for the Azure AI Provider.
* Hook listener callbacks for the Azure AI provider.
*
* @package aiprovider_azureai
* @copyright 2024 Matt Porritt <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion ai/provider/openai/classes/hook_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use core_ai\hook\after_ai_provider_form_hook;

/**
* Hook listener for Open AI Provider.
* Hook listener for Open AI provider.
*
* @package aiprovider_openai
* @copyright 2024 Matt Porritt <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion ai/provider/openai/db/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Hook listener callbacks for the Open AI Provider.
* Hook listener callbacks for the Open AI provider.
*
* @package aiprovider_openai
* @copyright 2024 Matt Porritt <[email protected]>
Expand Down
26 changes: 13 additions & 13 deletions ai/tests/behat/admin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ Feature: An administrator can manage AI subsystem settings
I can manage AI subsystem settings

@javascript
Scenario: An administrator can create AI Provider plugin instances using JavaScript
Scenario: An administrator can create AI provider plugin instances using JavaScript
Given I am logged in as "admin"
And I navigate to "AI > AI providers" in site administration
And I should see "Nothing to display"
When I click on "Create a new provider instance" "link"
And I select "OpenAI API Provider" from the "Choose AI Provider plugin" singleselect
And I select "OpenAI API provider" from the "Choose AI provider plugin" singleselect
And I set the following fields to these values:
| Name for instance | OpenAI API provider test|
| OpenAI API key | 123 |
| OpenAI organization ID| abc |
And I click on "Create instance" "button"
And I should see "OpenAI API provider test AI Provider instance created"
And I should see "OpenAI API provider test AI provider instance created"
And I should see "OpenAI API provider test"
And I click on "Create a new provider instance" "link"
And I select "Azure AI API Provider" from the "Choose AI Provider plugin" singleselect
And I select "Azure AI API provider" from the "Choose AI provider plugin" singleselect
And I set the following fields to these values:
| Name for instance | Azure AI provider test |
| Azure AI API key | 123 |
| Azure AI API endpoint| https://api.cognitive.microsofttranslator.com/ |
And I click on "Create instance" "button"
And I should see "Azure AI provider test AI Provider instance created"
And I should see "Azure AI provider test AI provider instance created"
And I should see "Azure AI provider test"

@javascript
Scenario: An administrator can enable AI Provider plugin instances using JavaScript
Scenario: An administrator can enable AI provider plugin instances using JavaScript
Given the following "core_ai > ai providers" exist:
|provider | name | enabled | apikey | orgid |
|aiprovider_openai| OpenAI API test | 0 | 123 | abc |
Expand All @@ -53,7 +53,7 @@ Feature: An administrator can manage AI subsystem settings
Then I should see "Azure AI API test disabled."

@javascript
Scenario: An administrator can configure AI Provider plugin instance
Scenario: An administrator can configure AI provider plugin instance
action settings using JavaScript
Given the following "core_ai > ai providers" exist:
|provider | name | enabled | apikey | orgid |
Expand All @@ -71,16 +71,16 @@ Feature: An administrator can manage AI subsystem settings
Then I should see "Generate text action settings updated"

@javascript
Scenario: An administrator can delete AI Provider plugin instances using JavaScript
Scenario: An administrator can delete AI provider plugin instances using JavaScript
Given the following "core_ai > ai providers" exist:
|provider | name | enabled | apikey | orgid |
|aiprovider_openai| OpenAI API test | 0 | 123 | abc |
And I am logged in as "admin"
And I navigate to "AI > AI providers" in site administration
And I click on the "Delete" link in the table row containing "OpenAI API test"
And "Delete AI Provider instance" "dialogue" should be visible
And I click on "Delete" "button" in the "Delete AI Provider instance" "dialogue"
Then I should see "OpenAI API test AI Provider instance deleted"
And "Delete AI provider instance" "dialogue" should be visible
And I click on "Delete" "button" in the "Delete AI provider instance" "dialogue"
Then I should see "OpenAI API test AI provider instance deleted"

@javascript
Scenario: An administrator can control the enabled state of AI placement plugins using JavaScript
Expand All @@ -94,7 +94,7 @@ Feature: An administrator can manage AI subsystem settings
Then I should see "Text editor placement disabled."

@javascript
Scenario: Placement actions should be available when an Administrator enables AI Providers using JavaScript
Scenario: Placement actions should be available when an Administrator enables AI providers using JavaScript
Given the following "core_ai > ai providers" exist:
|provider | name | enabled | apikey | orgid |
|aiprovider_openai| OpenAI API test | 1 | 123 | abc |
Expand All @@ -104,7 +104,7 @@ Feature: An administrator can manage AI subsystem settings
Then I should not see "This action is unavailable."

@javascript
Scenario: Placement actions should not be available when an Administrator disables AI Providers using JavaScript
Scenario: Placement actions should not be available when an Administrator disables AI providers using JavaScript
Given the following "core_ai > ai providers" exist:
|provider | name | enabled | apikey | orgid |
|aiprovider_openai| OpenAI API test | 1 | 123 | abc |
Expand Down
10 changes: 5 additions & 5 deletions filter/displayh5p/tests/behat/inline_editing_content.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: Inline editing H5P content anywhere
# Add H5P content to the page.
And I am on the "PageName1" "page activity" page logged in as "teacher1"
And I navigate to "Settings" in current page administration
And I click on "Configure H5P content" "button" in the "#fitem_id_page" "css_element"
And I click on "Insert H5P content" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I select "Private files" repository in file picker
And I click on "greeting-card.h5p" "file" in repository content area
Expand Down Expand Up @@ -86,7 +86,7 @@ Feature: Inline editing H5P content anywhere
# Add H5P content to the page.
And I am on the "PageName1" "page activity" page
And I navigate to "Settings" in current page administration
And I click on "Configure H5P content" "button" in the "#fitem_id_page" "css_element"
And I click on "Insert H5P content" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I select "Content bank" repository in file picker
And I click on "Greeting card" "file" in repository content area
Expand Down Expand Up @@ -130,7 +130,7 @@ Feature: Inline editing H5P content anywhere
# Add H5P content to the page.
And I am on the "PageName1" "page activity" page
And I navigate to "Settings" in current page administration
And I click on "Configure H5P content" "button" in the "#fitem_id_page" "css_element"
And I click on "Insert H5P content" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I select "Content bank" repository in file picker
And I click on "Greeting card" "file" in repository content area
Expand Down Expand Up @@ -176,7 +176,7 @@ Feature: Inline editing H5P content anywhere
# Add H5P content to the page.
And I am on the "PageName1" "page activity" page
And I navigate to "Settings" in current page administration
And I click on "Configure H5P content" "button" in the "#fitem_id_page" "css_element"
And I click on "Insert H5P content" "button" in the "#fitem_id_page" "css_element"
And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
And I click on "Save and display" "button"
Expand Down Expand Up @@ -219,7 +219,7 @@ Feature: Inline editing H5P content anywhere
| Text block title | H5PTest |
| Content | - |
And I configure the "H5PTest" block
And I click on "Configure H5P content" "button" in the "//div[contains(@id,'fitem_id_config_text')]" "xpath_element"
And I click on "Insert H5P content" "button" in the "//div[contains(@id,'fitem_id_config_text')]" "xpath_element"
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I select "Content bank" repository in file picker
And I click on "Greeting card" "file" in repository content area
Expand Down
2 changes: 1 addition & 1 deletion h5p/tests/behat/h5p_deployment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: Undeployed H5P content should be only available to users that can deplo
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | C1 | contenttype_h5p | teacher1 | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I click on "Content bank" "link" in the ".fp-repo-area" "css_element"
And I click on "filltheblanks.h5p" "link"
Expand Down
2 changes: 1 addition & 1 deletion lib/db/caches.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@
'canuselocalstore' => true,
],
// Cache to store AI rate limits.
// Used by AI Provider plugins to limit the number of requests to external services.
// Used by AI provider plugins to limit the number of requests to external services.
'ai_ratelimit' => [
'mode' => cache_store::MODE_APPLICATION,
'simplekeys' => true, // Cache must use simple keys (a-zA-Z0-9_).
Expand Down
24 changes: 12 additions & 12 deletions lib/editor/tiny/plugins/h5p/tests/behat/h5p.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
Scenario: TinyMCE can be used to embed an H5P activity
Given I change window size to "large"
And I am on the PageName1 "page activity editing" page logged in as admin
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
And I click on "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
When I click on "Save and display" "button"
Expand All @@ -40,7 +40,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I change window size to "large"
And I am on the "PageName1" "page activity editing" page logged in as "admin"
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
And I click on "guess-the-answer.h5p" "link"
Expand All @@ -55,15 +55,15 @@ Feature: Use the TinyMCE editor to upload an h5p package
| capability | permission | role | contextlevel | reference |
| tiny/h5p:addembed | Prohibit | editingteacher | Course | C1 |
When I am on the PageName1 "page activity editing" page logged in as teacher1
Then "Configure H5P content" "button" should not exist
Then "Insert H5P content" "button" should not exist

@javascript
Scenario: When a user does not have the Upload H5P capability, they can embed but not upload H5P content with TinyMCE
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/h5p:deploy | Prohibit | editingteacher | Course | C1 |
When I am on the PageName1 "page activity editing" page logged in as teacher1
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
Then I should not see "H5P file upload" in the "Insert H5P content" "dialogue"
And I should see "H5P URL" in the "Insert H5P content" "dialogue"
And I should not see "H5P options" in the "Insert H5P content" "dialogue"
Expand All @@ -74,7 +74,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
| user | admin |
| filepath | h5p/tests/fixtures/drag.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
And I click on "drag" "link"
Expand All @@ -88,7 +88,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
And I switch to the main frame
And I navigate to "Settings" in current page administration
And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1290772960722742119"
And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
And I wait "1" seconds
Expand All @@ -103,7 +103,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
| user | admin |
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
And I click on "guess-the-answer.h5p" "link"
Expand All @@ -116,7 +116,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
And I switch to the main frame
And I navigate to "Settings" in current page administration
And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I click on "H5P options" "link"
And I click on "Allow download" "checkbox"
And I click on "Insert H5P" "button" in the "Insert H5P content" "dialogue"
Expand All @@ -130,7 +130,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
And I switch to the main frame
And I navigate to "Settings" in current page administration
And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I click on "Allow download" "checkbox"
And I click on "Embed button" "checkbox"
And I click on "Copyright button" "checkbox"
Expand All @@ -147,7 +147,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
Scenario: H5P options are ignored for H5P URLs
Given I change window size to "large"
And I am on the PageName1 "page activity editing" page logged in as admin
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I set the field "H5P URL or file upload" to "https://moodle.h5p.com/content/1291366510035871129"
And I click on "H5P options" "link"
And I click on "Embed button" "checkbox"
Expand All @@ -160,7 +160,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
And I switch to the main frame
And I navigate to "Settings" in current page administration
And I select the ".h5p-placeholder" "css_element" in the "Page content" TinyMCE editor
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I click on "H5P options" "link"
And "input[aria-label=\"Embed button\"]:not([checked=checked])" "css_element" should exist

Expand All @@ -176,7 +176,7 @@ Feature: Use the TinyMCE editor to upload an h5p package
| user | admin |
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on the "Insert H5P content" button for the "Page content" TinyMCE editor
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
And I click on "guess-the-answer.h5p" "link"
Expand Down
2 changes: 1 addition & 1 deletion mod/data/tests/behat/add_entries.feature
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Feature: Users can add entries to database activities
And I am on the "Course 1" course page logged in as teacher1
When I click on "Test database name" "link"
And I click on "Add entry" "button"
And I click on "Configure H5P content" "button"
And I click on "Insert H5P content" "button"
Then I should see "Browse repositories..." in the "Insert H5P content" "dialogue"

@javascript
Expand Down
Loading

0 comments on commit 3f38b28

Please sign in to comment.