mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
language: Fix tests broken by recent feature
Tests were breaking because of the following reasons: - Language options were moved to another page - Language selections were changed from English to their respective languages Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
143a24a64a
commit
b2fea1b0de
@ -29,23 +29,3 @@ Scenario: Change hostname
|
|||||||
Scenario: Change domain name
|
Scenario: Change domain name
|
||||||
When I change the domain name to mydomain
|
When I change the domain name to mydomain
|
||||||
Then the domain name should be mydomain
|
Then the domain name should be mydomain
|
||||||
|
|
||||||
Scenario Outline: Change language
|
|
||||||
When I change the language to <language>
|
|
||||||
Then Plinth language should be <language>
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
| language |
|
|
||||||
| Danish |
|
|
||||||
| German |
|
|
||||||
| Spanish |
|
|
||||||
| French |
|
|
||||||
| Norwegian Bokmål |
|
|
||||||
| Dutch |
|
|
||||||
| Polish |
|
|
||||||
| Portuguese |
|
|
||||||
| Russian |
|
|
||||||
| Swedish |
|
|
||||||
| Telugu |
|
|
||||||
| Turkish |
|
|
||||||
| Simplified Chinese |
|
|
||||||
|
|||||||
@ -38,3 +38,23 @@ Scenario: Delete user
|
|||||||
Given the user alice exists
|
Given the user alice exists
|
||||||
When I delete the user alice
|
When I delete the user alice
|
||||||
Then alice should not be listed as a user
|
Then alice should not be listed as a user
|
||||||
|
|
||||||
|
Scenario Outline: Change language
|
||||||
|
When I change the language to <language>
|
||||||
|
Then Plinth language should be <language>
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| language |
|
||||||
|
| dansk |
|
||||||
|
| Deutsch |
|
||||||
|
| español |
|
||||||
|
| français |
|
||||||
|
| norsk (bokmål) |
|
||||||
|
| Nederlands |
|
||||||
|
| polski |
|
||||||
|
| Português |
|
||||||
|
| Русский |
|
||||||
|
| svenska |
|
||||||
|
| తెలుగు |
|
||||||
|
| Türkçe |
|
||||||
|
| 简体中文 |
|
||||||
|
|||||||
@ -20,19 +20,19 @@ from pytest_bdd import given, parsers, then, when
|
|||||||
from support import system
|
from support import system
|
||||||
|
|
||||||
language_codes = {
|
language_codes = {
|
||||||
'Danish': 'da',
|
'Deutsch': 'de',
|
||||||
'German': 'de',
|
'Nederlands': 'nl',
|
||||||
'Spanish': 'es',
|
'Português': 'pt',
|
||||||
'French': 'fr',
|
'Türkçe': 'tr',
|
||||||
'Norwegian Bokmål': 'nb',
|
'dansk': 'da',
|
||||||
'Dutch': 'nl',
|
'español': 'es',
|
||||||
'Polish': 'pl',
|
'français': 'fr',
|
||||||
'Portuguese': 'pt',
|
'norsk (bokmål)': 'nb',
|
||||||
'Russian': 'ru',
|
'polski': 'pl',
|
||||||
'Swedish': 'sv',
|
'svenska': 'sv',
|
||||||
'Telugu': 'te',
|
'Русский': 'ru',
|
||||||
'Turkish': 'tr',
|
'తెలుగు': 'te',
|
||||||
'Simplified Chinese': 'zh-hans',
|
'简体中文': 'zh-hans'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ def login(browser, url, username, password):
|
|||||||
else:
|
else:
|
||||||
browser.visit(default_url + '/plinth/firstboot/welcome')
|
browser.visit(default_url + '/plinth/firstboot/welcome')
|
||||||
browser.find_by_value('Start Setup').click()
|
browser.find_by_value('Start Setup').click()
|
||||||
create_admin_account(browser, 'tester', 'testingtesting')
|
create_admin_account(browser, username, 'testingtesting')
|
||||||
login(browser, url, username, password)
|
login(browser, url, username, password)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,12 +59,12 @@ def set_domain_name(browser, domain_name):
|
|||||||
|
|
||||||
|
|
||||||
def set_language(browser, language_code):
|
def set_language(browser, language_code):
|
||||||
nav_to_module(browser, 'config')
|
username = config['DEFAULT']['username']
|
||||||
browser.find_by_xpath(
|
browser.visit(config['DEFAULT']['url'] +
|
||||||
'//select[@id="id_configuration-language"]//option[@value="' \
|
'/plinth/sys/users/{}/edit/'.format(username))
|
||||||
+ language_code + '"]'
|
browser.find_by_xpath('//select[@id="id_language"]//option[@value="' +
|
||||||
).first.click()
|
language_code + '"]').first.click()
|
||||||
submit(browser)
|
browser.find_by_css('input[type=submit]').click()
|
||||||
|
|
||||||
|
|
||||||
def check_language(browser, language_code):
|
def check_language(browser, language_code):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user