aboutsummaryrefslogtreecommitdiff
path: root/selenium
diff options
context:
space:
mode:
Diffstat (limited to 'selenium')
-rw-r--r--selenium/wallet-test.py34
1 files changed, 29 insertions, 5 deletions
diff --git a/selenium/wallet-test.py b/selenium/wallet-test.py
index 0725539a1..718fb5ccf 100644
--- a/selenium/wallet-test.py
+++ b/selenium/wallet-test.py
@@ -11,7 +11,7 @@ listener = """\
document.addEventListener('taler-id', function(evt){
window['extId'] = evt.detail.id;
});
- evt = new CustomEvent('taler-query-id');
+ var evt = new CustomEvent('taler-query-id');
document.dispatchEvent(evt);
"""
client.execute_script(listener)
@@ -24,9 +24,33 @@ poll = """\
time.sleep(1)
ext_id = client.execute_script(poll)
+# if client has error from its activity, ptints it and returns True
+def is_error(client):
+ for log_type in ['browser']:
+ for log in client.get_log(log_type):
+ if log['level'] is 'error':
+ print(log['level'] + ': ' + log['message'])
+ return True
+
+
labels = ['balance']
+# labels = ['balance', 'history', 'debug']
for l in labels:
- client.get('chrome-extensio://' + ext_id + '/popup/popup.html#/' + l)
-for log_type in ['browser']:
- for log in client.get_log(log_type):
- print(log['level'] + ': ' + log['message'])
+ client.get('chrome-extension://' + ext_id + '/popup/popup.html#/' + l)
+
+# TODO assert here
+is_error(client)
+
+# visit bank and trigger withdrawal
+client.get('https://bank.test.taler.net')
+client.get('https://bank.test.taler.net/accounts/register')
+
+register = """\
+ var form = document.getElementsByTagName('form');
+ form.username.value = 'test';
+ form.password.value = 'test';
+ form.submit();
+ """
+
+# TODO assert here
+client.execute_script(register)