mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
tor: Make tests independent of language
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
a152811d70
commit
42e2995abc
@ -34,12 +34,10 @@ app_checkbox_id = {
|
||||
'tor': 'id_tor-enabled',
|
||||
}
|
||||
|
||||
app_config_updating_text = {
|
||||
'tor': 'Tor configuration is being updated',
|
||||
}
|
||||
|
||||
default_url = config['DEFAULT']['url']
|
||||
|
||||
apps_with_loaders = ['tor']
|
||||
|
||||
|
||||
def get_app_module(app_name):
|
||||
module = app_name
|
||||
@ -80,7 +78,7 @@ def _change_status(browser, app_name, change_status_to='enabled'):
|
||||
checkbox = browser.find_by_id(get_app_checkbox_id(app_name))
|
||||
checkbox.check() if change_status_to == 'enabled' else checkbox.uncheck()
|
||||
interface.submit(browser, 'form-configuration')
|
||||
if app_name == app_config_updating_text:
|
||||
if app_name in apps_with_loaders:
|
||||
wait_for_config_update(browser, app_name)
|
||||
|
||||
|
||||
@ -93,8 +91,8 @@ def disable(browser, app_name):
|
||||
|
||||
|
||||
def wait_for_config_update(browser, app_name):
|
||||
while browser.is_text_present(app_config_updating_text['tor']):
|
||||
sleep(1)
|
||||
while len(browser.find_by_css('.running-status.loading')) != 0:
|
||||
sleep(0.1)
|
||||
|
||||
|
||||
def select_domain_name(browser, app_name, domain_name):
|
||||
|
||||
@ -86,7 +86,7 @@
|
||||
|
||||
<h3>{% trans "Configuration" %}</h3>
|
||||
|
||||
<form class="form" method="post">
|
||||
<form class="form form-configuration" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{{ form|bootstrap }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user