Autoría | Ultima modificación | Ver Log |
@javascript @theme_boostFeature: Language selector menuTo be able to set the preferred language for the siteAs a userI need to be presented with a language selector menuBackground:Given remote langimport tests are enabledAnd the following "courses" exist:| fullname | shortname || Course 1 | C1 |And the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher |And the following "language pack" exists:| language | en_ar |Scenario: Logged user is presented with a language selector which is placed within the user menuGiven I log in as "teacher1"And I am on site homepage# The language selector menu is not present in the navbar when a user is logged in.And language selector menu should not exist in the navbar# The language selector is present within the user menu.And "Language" "link" should exist in the user menuWhen I follow "Language" in the user menuThen I should see "Language selector" user submenuAnd "English ‎(en)‎" "link" should exist in the "Language selector" user submenuAnd "English (pirate) ‎(en_ar)‎" "link" should exist in the "Language selector" user submenuScenario: Non-logged user is presented with a language selector which is placed within the navbarGiven I am on site homepage# The language selector menu is present in the navbar when a user is not logged in.And language selector menu should exist in the navbarAnd "English ‎(en)‎" "link" should exist in the language selector menuAnd "English (pirate) ‎(en_ar)‎" "link" should exist in the language selector menuScenario: Logged user is not presented with a language selector in a course if a language is forced in that contextGiven I log in as "teacher1"And I am on "Course 1" course homepageAnd I navigate to "Settings" in current page administrationAnd I expand all fieldsetsAnd I set the following fields to these values:| id_lang | en |And I press "Save and display"# The language selector is not present within the user menu in the course context when a language is enforced.When I am on "Course 1" course homepageAnd "Language" "link" should not exist in the user menu# The language selector is present within the user menu in other contexts.And I am on site homepageAnd "Language" "link" should exist in the user menuScenario: Logged user is not presented with a language selector if there is less than two installed languagesGiven I log in as "admin"And I navigate to "Language > Language packs" in site administrationAnd I set the field "Installed language packs" to "en_ar"And I press "Uninstall selected language pack(s)"And I click on "Yes" "button" in the "Uninstall selected language pack(s)" "dialogue"And the "Installed language packs" select box should not contain "en_ar"When I am on site homepage# The language selector is not present within the user menu.And "Language" "link" should not exist in the user menuScenario: Non-logged user is not presented with a language selector if there is less than two installed languagesGiven I log in as "admin"And I navigate to "Language > Language packs" in site administrationAnd I set the field "Installed language packs" to "en_ar"And I press "Uninstall selected language pack(s)"And I click on "Yes" "button" in the "Uninstall selected language pack(s)" "dialogue"And the "Installed language packs" select box should not contain "en_ar"And I log outWhen I am on site homepage# The language selector menu is not present in the navbar.Then language selector menu should not exist in the navbar