selenium: correctly picking amount to withdraw

This commit is contained in:
Marcello Stanisci 2016-11-08 22:03:00 +01:00
parent 490bacd2ce
commit a4c073bfa4
7 changed files with 118 additions and 111 deletions

View File

@ -17,7 +17,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Taler Wallet\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-10-10 17:44+0200\n"
"POT-Creation-Date: 2016-11-08 21:43+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -43,57 +43,57 @@ msgstr ""
msgid "You are about to purchase:"
msgstr "Sie sind dabei, Folgendes zu kaufen:"
#: pages/confirm-create-reserve.tsx:291
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:298
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: pages/confirm-contract.tsx:116
#: pages/confirm-contract.tsx:141
#, c-format
msgid "You have insufficient funds of the requested currency in your wallet."
msgstr ""
#: popup/popup.tsx:222
#: pages/confirm-create-reserve.tsx:275
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:282
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: popup/popup.tsx:270
#, c-format
msgid "Error: could not retrieve balance information."
msgstr ""
#: popup/popup.tsx:267
#: popup/popup.tsx:303
#, fuzzy, c-format
msgid "Bank requested reserve (%1$s) for %2$s."
msgstr "Bank bestätig anlegen der Reserve (%1$s) bei %2$s"
#: popup/popup.tsx:278
#: popup/popup.tsx:314
#, c-format
msgid "Started to withdraw %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:288
#: popup/popup.tsx:324
#, c-format
msgid "Merchant %1$s offered contract %2$s."
msgstr ""
#: popup/popup.tsx:297
#: popup/popup.tsx:333
#, fuzzy, c-format
msgid "Withdrew %1$s from %2$s (%3$s)."
msgstr "Reserve (%1$s) mit %2$s bei %3$s erzeugt"
#: popup/popup.tsx:307
#: popup/popup.tsx:343
#, c-format
msgid "Paid %1$s to merchant %2$s. (%3$s)"
msgstr ""
#: popup/popup.tsx:345
#: popup/popup.tsx:381
#, c-format
msgid "Error: could not retrieve event history"
msgstr ""
#: popup/popup.tsx:379
#: popup/popup.tsx:415
#, c-format
msgid "Your wallet has no events recorded."
msgstr "Ihre Geldbörse verzeichnet keine Vorkommnisse."

View File

@ -17,7 +17,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Taler Wallet\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-10-10 17:44+0200\n"
"POT-Creation-Date: 2016-11-08 21:43+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -40,57 +40,57 @@ msgstr ""
msgid "You are about to purchase:"
msgstr ""
#: pages/confirm-create-reserve.tsx:291
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:298
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: pages/confirm-contract.tsx:116
#: pages/confirm-contract.tsx:141
#, c-format
msgid "You have insufficient funds of the requested currency in your wallet."
msgstr ""
#: popup/popup.tsx:222
#: pages/confirm-create-reserve.tsx:275
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:282
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: popup/popup.tsx:270
#, c-format
msgid "Error: could not retrieve balance information."
msgstr ""
#: popup/popup.tsx:267
#: popup/popup.tsx:303
#, c-format
msgid "Bank requested reserve (%1$s) for %2$s."
msgstr ""
#: popup/popup.tsx:278
#: popup/popup.tsx:314
#, c-format
msgid "Started to withdraw %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:288
#: popup/popup.tsx:324
#, c-format
msgid "Merchant %1$s offered contract %2$s."
msgstr ""
#: popup/popup.tsx:297
#: popup/popup.tsx:333
#, c-format
msgid "Withdrew %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:307
#: popup/popup.tsx:343
#, c-format
msgid "Paid %1$s to merchant %2$s. (%3$s)"
msgstr ""
#: popup/popup.tsx:345
#: popup/popup.tsx:381
#, c-format
msgid "Error: could not retrieve event history"
msgstr ""
#: popup/popup.tsx:379
#: popup/popup.tsx:415
#, c-format
msgid "Your wallet has no events recorded."
msgstr ""

View File

@ -17,7 +17,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Taler Wallet\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-10-10 17:44+0200\n"
"POT-Creation-Date: 2016-11-08 21:43+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -40,57 +40,57 @@ msgstr ""
msgid "You are about to purchase:"
msgstr ""
#: pages/confirm-create-reserve.tsx:291
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:298
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: pages/confirm-contract.tsx:116
#: pages/confirm-contract.tsx:141
#, c-format
msgid "You have insufficient funds of the requested currency in your wallet."
msgstr ""
#: popup/popup.tsx:222
#: pages/confirm-create-reserve.tsx:275
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:282
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: popup/popup.tsx:270
#, c-format
msgid "Error: could not retrieve balance information."
msgstr ""
#: popup/popup.tsx:267
#: popup/popup.tsx:303
#, c-format
msgid "Bank requested reserve (%1$s) for %2$s."
msgstr ""
#: popup/popup.tsx:278
#: popup/popup.tsx:314
#, c-format
msgid "Started to withdraw %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:288
#: popup/popup.tsx:324
#, c-format
msgid "Merchant %1$s offered contract %2$s."
msgstr ""
#: popup/popup.tsx:297
#: popup/popup.tsx:333
#, c-format
msgid "Withdrew %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:307
#: popup/popup.tsx:343
#, c-format
msgid "Paid %1$s to merchant %2$s. (%3$s)"
msgstr ""
#: popup/popup.tsx:345
#: popup/popup.tsx:381
#, c-format
msgid "Error: could not retrieve event history"
msgstr ""
#: popup/popup.tsx:379
#: popup/popup.tsx:415
#, c-format
msgid "Your wallet has no events recorded."
msgstr ""

View File

@ -17,7 +17,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Taler Wallet\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-10-10 17:44+0200\n"
"POT-Creation-Date: 2016-11-08 21:43+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -40,57 +40,57 @@ msgstr ""
msgid "You are about to purchase:"
msgstr ""
#: pages/confirm-create-reserve.tsx:291
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:298
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: pages/confirm-contract.tsx:116
#: pages/confirm-contract.tsx:141
#, c-format
msgid "You have insufficient funds of the requested currency in your wallet."
msgstr ""
#: popup/popup.tsx:222
#: pages/confirm-create-reserve.tsx:275
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:282
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: popup/popup.tsx:270
#, c-format
msgid "Error: could not retrieve balance information."
msgstr ""
#: popup/popup.tsx:267
#: popup/popup.tsx:303
#, c-format
msgid "Bank requested reserve (%1$s) for %2$s."
msgstr ""
#: popup/popup.tsx:278
#: popup/popup.tsx:314
#, c-format
msgid "Started to withdraw %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:288
#: popup/popup.tsx:324
#, c-format
msgid "Merchant %1$s offered contract %2$s."
msgstr ""
#: popup/popup.tsx:297
#: popup/popup.tsx:333
#, c-format
msgid "Withdrew %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:307
#: popup/popup.tsx:343
#, c-format
msgid "Paid %1$s to merchant %2$s. (%3$s)"
msgstr ""
#: popup/popup.tsx:345
#: popup/popup.tsx:381
#, c-format
msgid "Error: could not retrieve event history"
msgstr ""
#: popup/popup.tsx:379
#: popup/popup.tsx:415
#, c-format
msgid "Your wallet has no events recorded."
msgstr ""

View File

@ -1,7 +1,7 @@
if (!window.i18n) {
throw Error("Module loading order incorrect, please load i18n module before loading i18n-strings");
}
i18n.strings['de'] = {"domain":"de","locale_data":{"de":{"":{"domain":"de","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":["%1$s\n möchte einen Vertrag über %2$s\n mit Ihnen abschließen."],"You are about to purchase:":["Sie sind dabei, Folgendes zu kaufen:"],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":["Bank bestätig anlegen der Reserve (%1$s) bei %2$s"],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":["Reserve (%1$s) mit %2$s bei %3$s erzeugt"],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":["Ihre Geldbörse verzeichnet keine Vorkommnisse."]}}};
i18n.strings['en-US'] = {"domain":"en-US","locale_data":{"en-US":{"":{"domain":"en-US","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};
i18n.strings['fr'] = {"domain":"fr","locale_data":{"fr":{"":{"domain":"fr","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};
i18n.strings['it'] = {"domain":"it","locale_data":{"it":{"":{"domain":"it","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};
i18n.strings['de'] = {"domain":"de","locale_data":{"de":{"":{"domain":"de","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":["%1$s\n möchte einen Vertrag über %2$s\n mit Ihnen abschließen."],"You are about to purchase:":["Sie sind dabei, Folgendes zu kaufen:"],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":["Bank bestätig anlegen der Reserve (%1$s) bei %2$s"],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":["Reserve (%1$s) mit %2$s bei %3$s erzeugt"],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":["Ihre Geldbörse verzeichnet keine Vorkommnisse."]}}};
i18n.strings['en-US'] = {"domain":"en-US","locale_data":{"en-US":{"":{"domain":"en-US","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};
i18n.strings['fr'] = {"domain":"fr","locale_data":{"fr":{"":{"domain":"fr","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};
i18n.strings['it'] = {"domain":"it","locale_data":{"it":{"":{"domain":"it","plural_forms":"nplurals=2; plural=(n != 1);","lang":""},"%1$s\n wants to enter a contract over %2$s\n with you.":[""],"You are about to purchase:":[""],"You have insufficient funds of the requested currency in your wallet.":[""],"Error: URL is empty":[""],"Error: URL may not be relative":[""],"Error: could not retrieve balance information.":[""],"Bank requested reserve (%1$s) for %2$s.":[""],"Started to withdraw %1$s from %2$s (%3$s).":[""],"Merchant %1$s offered contract %2$s.":[""],"Withdrew %1$s from %2$s (%3$s).":[""],"Paid %1$s to merchant %2$s. (%3$s)":[""],"Error: could not retrieve event history":[""],"Your wallet has no events recorded.":[""]}}};

View File

@ -17,7 +17,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Taler Wallet\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-10-10 17:44+0200\n"
"POT-Creation-Date: 2016-11-08 21:43+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -40,57 +40,57 @@ msgstr ""
msgid "You are about to purchase:"
msgstr ""
#: pages/confirm-create-reserve.tsx:291
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:298
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: pages/confirm-contract.tsx:116
#: pages/confirm-contract.tsx:141
#, c-format
msgid "You have insufficient funds of the requested currency in your wallet."
msgstr ""
#: popup/popup.tsx:222
#: pages/confirm-create-reserve.tsx:275
#, c-format
msgid "Error: URL is empty"
msgstr ""
#: pages/confirm-create-reserve.tsx:282
#, c-format
msgid "Error: URL may not be relative"
msgstr ""
#: popup/popup.tsx:270
#, c-format
msgid "Error: could not retrieve balance information."
msgstr ""
#: popup/popup.tsx:267
#: popup/popup.tsx:303
#, c-format
msgid "Bank requested reserve (%1$s) for %2$s."
msgstr ""
#: popup/popup.tsx:278
#: popup/popup.tsx:314
#, c-format
msgid "Started to withdraw %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:288
#: popup/popup.tsx:324
#, c-format
msgid "Merchant %1$s offered contract %2$s."
msgstr ""
#: popup/popup.tsx:297
#: popup/popup.tsx:333
#, c-format
msgid "Withdrew %1$s from %2$s (%3$s)."
msgstr ""
#: popup/popup.tsx:307
#: popup/popup.tsx:343
#, c-format
msgid "Paid %1$s to merchant %2$s. (%3$s)"
msgstr ""
#: popup/popup.tsx:345
#: popup/popup.tsx:381
#, c-format
msgid "Error: could not retrieve event history"
msgstr ""
#: popup/popup.tsx:379
#: popup/popup.tsx:415
#, c-format
msgid "Your wallet has no events recorded."
msgstr ""

View File

@ -9,7 +9,7 @@ found, it defaults to https://test.taler.net/
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import WebDriverWait, Select
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from urllib import parse
import argparse
@ -169,7 +169,7 @@ def register(client):
logger.error('User not registered at bank')
def withdraw(client, amount_value=None):
def withdraw(client, amount_menuentry=None):
"""Register and withdraw (1) KUDOS for a fresh user"""
register(client)
# trigger withdrawal button
@ -178,11 +178,18 @@ def withdraw(client, amount_value=None):
except NoSuchElementException:
logger.error("Selecting exchange impossible")
sys.exit(1)
if amount_value:
xpath = "//select/option[@value='" + str(amount_value) + "']"
if amount_menuentry:
xpath_menu = '//select[@id="reserve-amount"]'
try:
desired_amount = client.find_element(By.XPATH, xpath)
desired_amount.click()
# Tried the more suitable select_by_visible_text(),
# did not work.
dropdown = client.find_element(By.XPATH, xpath_menu)
for option in dropdown.find_elements_by_tag_name("option"):
# Tried option.text, did not work.
if option.get_attribute("innerHTML") == amount_menuentry:
option = WebDriverWait(client, 10).until(EC.visibility_of(option))
option.click()
break
except NoSuchElementException:
logger.error("value '" + str(amount_value) + "' is not offered by this bank to withdraw, please adapt it")
sys.exit(1)
@ -235,7 +242,7 @@ logger.info("Creating the browser driver..")
client = ret['client']
client.implicitly_wait(10)
logger.info("Withdrawing..")
withdraw(client, 10)
withdraw(client, "10.00 PUDOS")
# switch_base() # inducing error
logger.info("Making donations..")
make_donation(client, 6.0)