summaryrefslogtreecommitdiff
path: root/selenium
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-04-27 14:39:39 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-04-27 14:39:39 +0200
commit07715206e54cab23788e3167e5a77509ffd3e369 (patch)
treed3a40c7f2bb45de56019c288dc9c279062c0ca2d /selenium
parent320eac1675fd3c4b2de4d5dd404ecc413b9ea505 (diff)
downloadwallet-core-07715206e54cab23788e3167e5a77509ffd3e369.tar.gz
wallet-core-07715206e54cab23788e3167e5a77509ffd3e369.tar.bz2
wallet-core-07715206e54cab23788e3167e5a77509ffd3e369.zip
make donations via selenium
Diffstat (limited to 'selenium')
-rw-r--r--selenium/test.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/selenium/test.py b/selenium/test.py
index 8720c79d7..c0a5de742 100644
--- a/selenium/test.py
+++ b/selenium/test.py
@@ -6,7 +6,8 @@ import time
import logging
logger = logging.getLogger(__name__)
-bank_url = 'http://127.0.0.1:9898'
+bank = 'http://bank.test.taler.net'
+donations = 'http://shop.test.taler.net'
def client_setup():
"""Return a dict containing the driver and the extension's id"""
@@ -41,10 +42,21 @@ def is_error(client):
return False
+def make_donation(client):
+ """Make donation at shop.test.taler.net. Assume the wallet has coins"""
+ client.get(donations)
+ form = client.find_element(By.TAG_NAME, "form")
+ form.submit() # amount and receiver chosen
+ confirm_taler = client.find_element(By.XPATH, "//form//input[@type='button']")
+ confirm_taler.click() # Taler as payment option chosen
+ wait = WebDriverWait(client, 10)
+ confirm_pay = wait.until(EC.element_to_be_clickable((By.XPATH, "//button[@class='accept']")))
+ confirm_pay.click()
+
def register(client):
"""Register a new user to the bank delaying its execution until the
profile page is shown"""
- client.get(bank_url + '/accounts/register')
+ client.get(bank + '/accounts/register')
client.find_element(By.TAG_NAME, "form")
register = """\
var form = document.getElementsByTagName('form')[0];
@@ -93,8 +105,8 @@ def withdraw(client):
else: logger.info('Withdrawal successful')
-
ret = client_setup()
client = ret['client']
withdraw(client)
-client.close()
+make_donation(client)
+# client.close()