aboutsummaryrefslogtreecommitdiff
path: root/selenium
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-05-03 11:12:12 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-05-03 11:12:12 +0200
commit08e60506d5df6db78fe29541b751fb7bf13861d0 (patch)
treee9aeeca6f563be8506997188d3cba20cf658ec4b /selenium
parentce87fc0b90262cb44dda780b128c1ab0afd3b609 (diff)
downloadwallet-core-08e60506d5df6db78fe29541b751fb7bf13861d0.tar.xz
selenium: the wallet can select amounts from the bank's dropdown
Diffstat (limited to 'selenium')
-rw-r--r--selenium/test.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/selenium/test.py b/selenium/test.py
index d697f73c8..b2bece4e0 100644
--- a/selenium/test.py
+++ b/selenium/test.py
@@ -145,7 +145,7 @@ def register(client):
logger.error('User not registered at bank')
-def withdraw(client):
+def withdraw(client, amount_value=None):
"""Register and withdraw (1) KUDOS for a fresh user"""
register(client)
# trigger withdrawal button
@@ -154,6 +154,13 @@ def withdraw(client):
except NoSuchElementException:
logger.error("Selecting exchange impossible")
sys.exit(1)
+ if amount_value:
+ xpath = "//select/option[@value='" + str(amount_value) + "']"
+ try:
+ client.find_element(By.XPATH, xpath)
+ except NoSuchElementException:
+ logger.error("value '" + str(amount_value) + "' is not offered by this bank to withdraw, please adapt it")
+ sys.exit(1)
button.click()
location = client.execute_script("return document.location.href")
client.get(location)
@@ -198,7 +205,7 @@ args = parser.parse_args()
ret = client_setup(args)
client = ret['client']
client.implicitly_wait(10)
-withdraw(client)
+withdraw(client, 11)
make_donation(client)
buy_article(client)
logger.info("Test passed")