Enable asset in Wallet before usage

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-05-27 19:45:20 +03:00
parent 5382cad5ec
commit 092860f38a
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
6 changed files with 25 additions and 17 deletions

View File

@ -84,18 +84,14 @@ class TestWalletManagement(SingleDeviceTestCase):
sign_in.create_user() sign_in.create_user()
wallet = sign_in.wallet_button.click() wallet = sign_in.wallet_button.click()
wallet.set_up_wallet() wallet.set_up_wallet()
wallet.options_button.click() asset = "MDS"
wallet.manage_assets_button.click() wallet.select_asset(asset)
select_asset = 'MDS' wallet.asset_by_name(asset).scroll_to_element()
deselect_asset = 'STT' if not wallet.asset_by_name(asset).is_element_displayed():
wallet.asset_checkbox_by_name(select_asset).click() self.errors.append('%s asset is not shown in wallet' % asset)
wallet.asset_checkbox_by_name(deselect_asset).click() wallet.select_asset(asset)
wallet.cross_icon.click() if wallet.asset_by_name(asset).is_element_displayed():
wallet.asset_by_name(select_asset).scroll_to_element() self.errors.append('%s asset is shown in wallet but was deselected' % asset)
if not wallet.asset_by_name(select_asset).is_element_displayed():
self.errors.append('%s asset is not shown in wallet' % select_asset)
if wallet.asset_by_name(deselect_asset).is_element_displayed():
self.errors.append('%s asset is shown in wallet but was deselected' % deselect_asset)
self.verify_no_errors() self.verify_no_errors()
@marks.testrail_id(5358) @marks.testrail_id(5358)
@ -127,11 +123,8 @@ class TestWalletManagement(SingleDeviceTestCase):
profile.switch_network('Mainnet with upstream RPC') profile.switch_network('Mainnet with upstream RPC')
wallet = sign_in.wallet_button.click() wallet = sign_in.wallet_button.click()
wallet.set_up_wallet() wallet.set_up_wallet()
wallet.options_button.click()
wallet.manage_assets_button.click()
asset_name = 'CryptoKitties' asset_name = 'CryptoKitties'
wallet.asset_checkbox_by_name(asset_name).click() wallet.select_asset(asset_name)
wallet.cross_icon.click()
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
send_transaction.select_asset_button.click() send_transaction.select_asset_button.click()
if send_transaction.asset_by_name(asset_name).is_element_displayed(): if send_transaction.asset_by_name(asset_name).is_element_displayed():

View File

@ -438,6 +438,12 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
self.errors.append("'Insufficient funds' error is now shown when sending 1 ETH from chat with balance 0") self.errors.append("'Insufficient funds' error is now shown when sending 1 ETH from chat with balance 0")
send_transaction.cross_icon.click() send_transaction.cross_icon.click()
chat_view.commands_button.click() chat_view.commands_button.click()
# enable STT in wallet
chat_view.wallet_button.click()
wallet_view.select_asset("STT")
wallet_view.home_button.click()
chat_view.send_command.click() chat_view.send_command.click()
chat_view.asset_by_name('STT').click() chat_view.asset_by_name('STT').click()
chat_view.send_as_keyevent('1') chat_view.send_as_keyevent('1')

View File

@ -297,6 +297,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
home_view = singin_view.create_user() home_view = singin_view.create_user()
wallet = home_view.wallet_button.click() wallet = home_view.wallet_button.click()
wallet.set_up_wallet() wallet.set_up_wallet()
wallet.select_asset("STT")
wallet_address = wallet.get_wallet_address() wallet_address = wallet.get_wallet_address()
recipient = '0x' + basic_user['address'] recipient = '0x' + basic_user['address']

View File

@ -270,6 +270,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.create_user() sign_in_view.create_user()
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet() wallet_view.set_up_wallet()
wallet_view.select_asset("STT")
send_transaction = wallet_view.send_transaction_button.click() send_transaction = wallet_view.send_transaction_button.click()
send_transaction.amount_edit_box.set_value(1) send_transaction.amount_edit_box.set_value(1)
error_text = send_transaction.element_by_text('Insufficient funds') error_text = send_transaction.element_by_text('Insufficient funds')

View File

@ -484,7 +484,7 @@ class BaseView(object):
@staticmethod @staticmethod
def get_unique_amount(): def get_unique_amount():
return '0.0%s' % datetime.now().strftime('%-m%-d%-H%-M%-S').strip('0') return '0.00%s' % datetime.now().strftime('%-d%-H%-M%-S').strip('0')
@staticmethod @staticmethod
def get_public_chat_name(): def get_public_chat_name():

View File

@ -268,6 +268,13 @@ class WalletView(BaseView):
def asset_checkbox_by_name(self, asset_name): def asset_checkbox_by_name(self, asset_name):
return AssetCheckBox(self.driver, asset_name) return AssetCheckBox(self.driver, asset_name)
def select_asset(self, *args):
self.options_button.click()
self.manage_assets_button.click()
for asset in args:
self.asset_checkbox_by_name(asset).click()
self.cross_icon.click()
def send_transaction(self, **kwargs): def send_transaction(self, **kwargs):
send_transaction_view = self.send_transaction_button.click() send_transaction_view = self.send_transaction_button.click()
send_transaction_view.select_asset_button.click() send_transaction_view.select_asset_button.click()