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:
Joseph Nuthalapati 2018-03-29 11:54:36 +05:30 committed by James Valleroy
parent a152811d70
commit 42e2995abc
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 6 additions and 8 deletions

View File

@ -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):

View File

@ -86,7 +86,7 @@
<h3>{% trans "Configuration" %}</h3>
<form class="form" method="post">
<form class="form form-configuration" method="post">
{% csrf_token %}
{{ form|bootstrap }}