Fix stickers and wallet e2e tests

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-06-14 18:28:03 +03:00
parent 26bbac83bc
commit c9048f2e35
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
5 changed files with 10 additions and 4 deletions

View File

@ -311,6 +311,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
if send_transaction_view.enter_password_input.is_element_displayed(): if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append(sign_button_warning.format('sending 0 ETH with an empty ETH balance')) self.errors.append(sign_button_warning.format('sending 0 ETH with an empty ETH balance'))
send_transaction_view.cancel_button.click()
asset_button = send_transaction_view.asset_by_name('STT') asset_button = send_transaction_view.asset_by_name('STT')
send_transaction_view.select_asset_button.click_until_presence_of_element(asset_button) send_transaction_view.select_asset_button.click_until_presence_of_element(asset_button)
asset_button.click() asset_button.click()
@ -326,6 +327,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
if send_transaction_view.enter_password_input.is_element_displayed(): if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append(sign_button_warning.format('sending 0 STT with an empty ETH balance')) self.errors.append(sign_button_warning.format('sending 0 STT with an empty ETH balance'))
send_transaction_view.cancel_button.click()
home_view = send_transaction_view.get_back_to_home_view() home_view = send_transaction_view.get_back_to_home_view()
# Requesting test ETH and waiting till the balance updates # Requesting test ETH and waiting till the balance updates
self.network_api.faucet(wallet_address[2:]) self.network_api.faucet(wallet_address[2:])

View File

@ -108,6 +108,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.enter_recipient_address_input.set_value(recipient['address']) send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click() send_transaction.done_button.click()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
send_transaction.sign_with_password.click()
send_transaction.enter_password_input.click() send_transaction.enter_password_input.click()
send_transaction.enter_password_input.send_keys('wrong_password') send_transaction.enter_password_input.send_keys('wrong_password')
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()

View File

@ -445,10 +445,12 @@ class BaseView(object):
return element return element
def swipe_down(self): def swipe_down(self):
self.driver.swipe(500, 500, 500, 1000) size = self.driver.get_window_size()
self.driver.swipe(size["width"]*0.5, size["height"]*0.8, size["width"]*0.5, size["height"]*0.2)
def swipe_left(self, y=1700): def swipe_left(self):
self.driver.swipe(1000, y, 100, y) size = self.driver.get_window_size()
self.driver.swipe(size["width"]*0.8, size["height"]*0.8, size["width"]*0.2, size["height"]*0.8)
def get_status_test_dapp_view(self): def get_status_test_dapp_view(self):
from views.web_views.status_test_dapp import StatusTestDAppView from views.web_views.status_test_dapp import StatusTestDAppView

View File

@ -13,7 +13,7 @@ class FirstRecipient(BaseButton):
class CancelButton(BaseButton): class CancelButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(CancelButton, self).__init__(driver) super(CancelButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('cancel-button') self.locator = self.Locator.xpath_selector("//*[@text='Cancel']")
class SignTransactionButton(BaseButton): class SignTransactionButton(BaseButton):

View File

@ -303,6 +303,7 @@ class WalletView(BaseView):
send_transaction_view.recent_recipients_button.click_until_presence_of_element(recent_recipient) send_transaction_view.recent_recipients_button.click_until_presence_of_element(recent_recipient)
recent_recipient.click() recent_recipient.click()
if kwargs.get('sign_transaction', True): if kwargs.get('sign_transaction', True):
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_transaction() send_transaction_view.sign_transaction()
def receive_transaction(self, **kwargs): def receive_transaction(self, **kwargs):