diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-04-25 17:58:01 +0200 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-04-25 17:58:01 +0200 |
commit | 3777d850ebfb730fc309813c3effff08bda69910 (patch) | |
tree | d7a44946eca367a9c8b165cce51d7cf972bbadab | |
parent | c5a8773b175e29ec5b7da003596488180ec52a7d (diff) |
injecting bank registration script
-rw-r--r-- | selenium/wallet-test.py | 34 |
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) |