Fixed public key and chat name inputs and amount for tokens

Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
yevh-berdnyk 2018-08-07 16:23:31 +03:00
parent 1061fc7a68
commit 8b6f924b26
No known key found for this signature in database
GPG Key ID: E9B425FDFC4DEA9C
4 changed files with 18 additions and 11 deletions

View File

@ -50,10 +50,7 @@ class TestCreateAccount(SingleDeviceTestCase):
if not home.welcome_image.is_element_displayed():
self.errors.append('Welcome image is not shown')
for text in ['Welcome to Status',
'Here you can chat with people in a secure\n'
' private chat, browse and interact with DApps.\n'
' Use the “Plus” icon to explore Status',
]:
'Tap the plus (+) button to get started']:
if not home.element_by_text(text).is_element_displayed():
self.errors.append("'%s' text is not shown" % text)
home.profile_button.click()

View File

@ -197,7 +197,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.select_asset_button.click_until_presence_of_element(adi_button)
adi_button.click()
send_transaction.amount_edit_box.click()
amount = '0.0%s' % random.randint(100000, 999999)
amount = '0.0%s' % str(random.randint(100000, 999999)).strip('0')
send_transaction.amount_edit_box.set_value(amount)
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
@ -224,7 +224,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.select_asset_button.click_until_presence_of_element(adi_button)
adi_button.click()
send_transaction.amount_edit_box.click()
amount = '0.0%s' % random.randint(1000000, 9999999)
amount = '0.0%s' % str(random.randint(1000000, 9999999)).strip('0')
send_transaction.amount_edit_box.set_value(amount)
error_text = 'Amount is too precise. Max number of decimals is 7.'
if not send_transaction.element_by_text(error_text).is_element_displayed():

View File

@ -305,6 +305,17 @@ class BaseView(object):
info("Tap 'Confirm' on native keyboard")
self.driver.press_keycode(66)
def confirm_until_presence_of_element(self, desired_element, attempts=3):
counter = 0
while not desired_element.is_element_present(1) and counter <= attempts:
try:
self.confirm()
info('Wait for %s' % desired_element.name)
desired_element.wait_for_element(5)
return
except TimeoutException:
counter += 1
def click_system_back_button(self):
info('Click system back button')
self.driver.press_keycode(4)

View File

@ -123,9 +123,8 @@ class HomeView(BaseView):
start_new_chat = self.plus_button.click()
start_new_chat.start_new_chat_button.click()
start_new_chat.public_key_edit_box.set_value(public_key)
start_new_chat.confirm()
one_to_one_chat = self.get_chat_view()
one_to_one_chat.chat_message_input.wait_for_element(60)
start_new_chat.confirm_until_presence_of_element(one_to_one_chat.chat_message_input)
return one_to_one_chat
def start_1_1_chat(self, username):
@ -151,6 +150,6 @@ class HomeView(BaseView):
start_new_chat.join_public_chat_button.click()
start_new_chat.chat_name_editbox.set_value(chat_name)
time.sleep(2)
start_new_chat.confirm()
from views.chat_view import ChatView
return ChatView(self.driver)
chat_view = self.get_chat_view()
start_new_chat.confirm_until_presence_of_element(chat_view.chat_message_input)
return chat_view