Skip to content

Commit

Permalink
Improve the installation and usage of language packs in Behat tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Jan 9, 2024
1 parent c86756d commit 5351900
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ moodle-local_navbarplus
Changes
-------

### Unreleased

* 2024-01-08 - Improve the installation and usage of language packs in Behat tests.

### v4.3-r1

* 2023-10-20 - Prepare compatibility for Moodle 4.3.
Expand Down
23 changes: 7 additions & 16 deletions tests/behat/local_navbarplus.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
# | inserticonswithlinks | fa-sign-out|/login/logout.php|Logout | local_navbarplus |
# does not work here, as the value contains pipe characters and so the table does not have same number of columns in every row.
# Escaping the pipes with backslash helped, but then the tests failed because the value is not usable anymore.
# The short notation for the settings like
# Given the following "users" exist:
# | username | lang |
# | student1 | de |
# does not work since Moodle 3.9 anymore, so the language has to be set manually.
Feature: Configuring the navbarplus plugin
In order to have custom items in the additional navbar
As admin
Expand All @@ -31,23 +26,19 @@ Feature: Configuring the navbarplus plugin
And I should not see the icon with the title "Falsetest" in the navbar

Scenario: Configuring item with additional language attribute
Given the following "users" exist:
| username |
| student1 |
Given the following "language packs" exist:
| language |
| de |
And the following "users" exist:
| username | lang |
| student1 | de |
When I log in as "admin"
And I navigate to "Language > Language packs" in site administration
And I set the field "Available language packs" to "de"
And I press "Install selected language pack(s)"
When I navigate to "Appearance > Navbar Plus" in site administration
And I navigate to "Appearance > Navbar Plus" in site administration
And I set the field "id_s_local_navbarplus_inserticonswithlinks" to "fa-language|/?redirect=0|Languagetest|de"
And I press "Save"
Then I should not see the icon with the title "Languagetest" and the iconclass "fa-language" and the link "/?redirect=0" in the navbar
And I log out
When I log in as "student1"
And I follow "Preferences" in the user menu
And I click on "Preferred language" "link"
And I set the field "Preferred language" to "Deutsch ‎(de)‎"
And I press "Save changes"
Then I should see the icon with the title "Languagetest" and the iconclass "fa-language" and the link "/?redirect=0" in the navbar

Scenario: Configuring item with the new window attribute
Expand Down

0 comments on commit 5351900

Please sign in to comment.