diff --git a/run_tests.sh b/run_tests.sh index f5f82a89..8d714ef9 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -24,9 +24,9 @@ echo "ran $ran integration tests." echo "total test time $SECONDS" ran=0; -#for f in tests/browser-tests/*.py; do -# python3 "$f" || close # if needed -# let "ran++" -#done -#echo "ran $ran browser tests." +for f in tests/browser-tests/*.py; do + python3 "$f" || close # if needed + let "ran++" +done +echo "ran $ran browser tests." echo "total test time $SECONDS" diff --git a/static-data/www/mail/settings.js b/static-data/www/mail/settings.js index c72bdeab..0667a31b 100644 --- a/static-data/www/mail/settings.js +++ b/static-data/www/mail/settings.js @@ -17,6 +17,8 @@ along with this program. If not, see . */ var notificationSetting = document.getElementById('notificationSetting') +var sigSetting = document.getElementById('mailSignatureSetting') + document.getElementById('forwardSecrecySetting').onchange = function(e){ postData = JSON.stringify({"default_forward_secrecy": e.target.checked}) fetch('/config/set/mail', { @@ -56,11 +58,27 @@ notificationSetting.onchange = function(e){ "content-type": "application/json", "token": webpass }}) - .then((resp) => resp.text()) .then(function(data) { mailSettings['notificationSetting'] = notificationSetting.checked PNotify.success({ text: 'Successfully toggled default mail notifications' }) }) +} + +sigSetting.onchange = function(){ + var postData = JSON.stringify({"signature": sigSetting.value}) + fetch('/config/set/mail', { + method: 'POST', + body: postData, + headers: { + "content-type": "application/json", + "token": webpass + }}) + .then(function(data) { + mailSettings['signature'] = sigSetting.value + PNotify.success({ + text: 'Set mail signature' + }) + }) } \ No newline at end of file diff --git a/tests/browser-tests/test-circles.py b/tests/browser-tests/test-circles.py index f1799dea..6918d80e 100644 --- a/tests/browser-tests/test-circles.py +++ b/tests/browser-tests/test-circles.py @@ -1,10 +1,10 @@ -from unittest.mock import patch import sys, os sys.path.append(".") sys.path.append("src/") import unittest, uuid TEST_DIR = 'testdata/-%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/' os.environ["ONIONR_HOME"] = TEST_DIR +from unittest.mock import patch from utils import createdirs @@ -34,8 +34,9 @@ class OnionrTests(unittest.TestCase): sleep(1) url = 'http' + escapeansi.escape_ANSI(Popen(['./onionr.sh', 'url'], stdout=subprocess.PIPE).communicate()[0].decode().split('http')[1]) web_driver = start_firefox(url=url, headless=BROWSER_HEADLESS) - if Text('Get Started').exists(): + if not Text('Circles').exists(): click('Get Started') + sleep(2) click('Circles') sleep(5) if not Text('Circle Name').exists(): @@ -45,6 +46,4 @@ class OnionrTests(unittest.TestCase): Popen(['./onionr.sh', 'stop']).wait() web_driver.quit() - - unittest.main() \ No newline at end of file diff --git a/tests/runtime-result.txt b/tests/runtime-result.txt index 13451494..a4deee2c 100644 --- a/tests/runtime-result.txt +++ b/tests/runtime-result.txt @@ -1 +1 @@ -1583304780 \ No newline at end of file +1583317276 \ No newline at end of file