Add faucet.ropsten.be in tests

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-05-08 18:40:08 +03:00
parent 55fd6cefa7
commit 3a0c0a8557
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
2 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@ class NetworkApi(object):
def __init__(self):
self.network_url = 'http://api-%s.etherscan.io/api?' % pytest.config.getoption('network')
self.faucet_url = 'https://faucet-ropsten.status.im/donate'
self.faucet_backup_url = 'https://faucet.ropsten.be/donate'
self.chat_bot_url = 'http://offsite.chat:8099'
def get_transactions(self, address: str) -> List[dict]:
@ -102,10 +103,14 @@ class NetworkApi(object):
def faucet(self, address):
return requests.request('GET', '%s/0x%s' % (self.faucet_url, address)).json()
def faucet_backup(self, address):
return requests.request('GET', '%s/0x%s' % (self.faucet_backup_url, address)).json()
def get_donate(self, address, wait_time=300):
initial_balance = self.get_balance(address)
counter = 0
if initial_balance < 1000000000000000000:
self.faucet_backup(address)
response = self.faucet(address)
while True:
if counter >= wait_time:

View File

@ -66,7 +66,7 @@ class TransactionsButton(BaseButton):
def click(self):
self.driver.swipe(500, 1000, 500, 800)
self.find_element().click()
self.wait_for_visibility_of_element().click()
return self.navigate()
class SendTwoTxInBatchButton(BaseButton):