Fixing e2e tests

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-07-18 18:44:06 +03:00
parent 3a903fbaa2
commit 0c6c185394
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
8 changed files with 33 additions and 29 deletions

View File

@ -59,12 +59,13 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in = SignInView(self.driver)
welcome_screen = sign_in.create_user()
if not welcome_screen.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 private chat, browse and interact with DApps.']:
if not welcome_screen.element_by_text(text).is_element_displayed():
self.errors.append("'%s' text is not shown" % text)
# To Do: update new onboarding flow checks
# if not welcome_screen.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 private chat, browse and interact with DApps.']:
# if not welcome_screen.element_by_text(text).is_element_displayed():
# self.errors.append("'%s' text is not shown" % text)
welcome_screen.get_started_button.click()
text = 'There are no recent chats here yet. \nUse the (+) button to discover people \nto chat with'

View File

@ -108,7 +108,7 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
if signin_view.access_key_button.is_element_displayed():
signin_view.access_key_button.click()
recover_access_view.send_as_keyevent(phrase)
recover_access_view.password_input.click()
recover_access_view.recover_account_password_input.click()
if not elm.is_element_displayed():
self.errors.append('"{}" message is not shown'.format(msg))

View File

@ -102,7 +102,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
gas_limit = '25000'
send_transaction_view.gas_limit_input.clear()
send_transaction_view.gas_limit_input.set_value(gas_limit)
gas_price = '1'
gas_price = str(round(float(send_transaction_view.gas_price_input.text)) + 10)
send_transaction_view.gas_price_input.clear()
send_transaction_view.gas_price_input.set_value(gas_price)
if send_transaction_view.total_fee_input.text != '%s ETHro' % (d(gas_limit) * d(gas_price) / d(1000000000)):
@ -384,9 +384,9 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
# if not send_transaction_view.element_by_text(recipient['username']).is_element_displayed():
# self.errors.append('Recipient name is not shown')
if not send_transaction_view.element_by_text('ETHro').is_element_displayed():
if not send_transaction_view.element_by_text_part('ETHro').is_element_displayed():
self.errors.append("Asset field doesn't contain 'ETHro' text")
if not send_transaction_view.element_by_text(amount).is_element_displayed():
if not send_transaction_view.element_by_text_part(amount).is_element_displayed():
self.errors.append('Amount is not visible')
self.verify_no_errors()

View File

@ -21,8 +21,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
def test_text_message_1_1_chat(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
username_1 = 'user_%s' % get_current_time()
device_1_home, device_2_home = device_1.create_user(username=username_1), device_2.create_user()
device_1_home, device_2_home = device_1.create_user(), device_2.create_user()
profile_1 = device_1_home.profile_button.click()
default_username_1 = profile_1.default_username_text.text
device_1_home = profile_1.get_back_to_home_view()
@ -159,8 +158,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
username_1, username_2 = 'user_1', 'user_2'
device_1_home, device_2_home = device_1.create_user(username=username_1), device_2.create_user(
username=username_2)
device_1_home, device_2_home = device_1.create_user(), device_2.create_user()
profile_1 = device_1_home.profile_button.click()
default_username_1 = profile_1.default_username_text.text
device_1_home = profile_1.get_back_to_home_view()
@ -206,7 +204,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
username_1, username_2 = 'user_1', 'user_2'
home_1, home_2 = device_1.create_user(username=username_1), device_2.create_user(username=username_2)
home_1, home_2 = device_1.create_user(), device_2.create_user()
profile_1 = home_1.profile_button.click()
default_username_1 = profile_1.default_username_text.text
home_1 = profile_1.get_back_to_home_view()
@ -291,7 +289,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
username_2 = 'user_%s' % get_current_time()
device_1_home, device_2_home = device_1.create_user(), device_2.create_user(username=username_2)
device_1_home, device_2_home = device_1.create_user(), device_2.create_user()
profile_2 = device_2_home.profile_button.click()
default_username_2 = profile_2.default_username_text.text
device_2_home = profile_2.get_back_to_home_view()
@ -326,8 +324,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
def test_bold_and_italic_text_in_messages(self):
self.create_drivers(2)
sign_in_1, sign_in_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
username_2 = 'user_%s' % get_current_time()
device_1_home, device_2_home = sign_in_1.create_user(), sign_in_2.create_user(username=username_2)
device_1_home, device_2_home = sign_in_1.create_user(), sign_in_2.create_user()
profile_2 = device_2_home.profile_button.click()
default_username_2 = profile_2.default_username_text.text
device_2_home = profile_2.get_back_to_home_view()
@ -337,22 +334,24 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_2_chat = device_2_home.add_contact(device_1_public_key)
bold_text = 'bold text'
bold_text_expected = u'\u200b' + bold_text + u'\u200b' # Zero width whitespaces
device_2_chat.chat_message_input.send_keys('*%s*' % bold_text)
device_2_chat.send_message_button.click()
if not device_2_chat.chat_element_by_text(bold_text).is_element_displayed():
if not device_2_chat.chat_element_by_text(bold_text_expected).is_element_displayed():
self.errors.append('Bold text is not displayed in 1-1 chat for the sender \n')
device_1_chat = device_1_home.get_chat_with_user(default_username_2).click()
if not device_1_chat.chat_element_by_text(bold_text).is_element_displayed():
if not device_1_chat.chat_element_by_text(bold_text_expected).is_element_displayed():
self.errors.append('Bold text is not displayed in 1-1 chat for the recipient \n')
italic_text = 'italic text'
italic_text_expected = u'\u200b' + italic_text + u'\u200b'
device_2_chat.chat_message_input.send_keys('_%s_' % italic_text)
device_2_chat.send_message_button.click()
if not device_2_chat.chat_element_by_text(italic_text).is_element_displayed():
if not device_2_chat.chat_element_by_text(italic_text_expected).is_element_displayed():
self.errors.append('Italic text is not displayed in 1-1 chat for the sender \n')
if not device_1_chat.chat_element_by_text(italic_text).is_element_displayed():
if not device_1_chat.chat_element_by_text(italic_text_expected).is_element_displayed():
self.errors.append('Italic text is not displayed in 1-1 chat for the recipient \n')
device_1_chat.get_back_to_home_view()
@ -363,18 +362,18 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_2_chat.chat_message_input.send_keys('*%s*' % bold_text)
device_2_chat.send_message_button.click()
if not device_2_chat.chat_element_by_text(bold_text).is_element_displayed():
if not device_2_chat.chat_element_by_text(bold_text_expected).is_element_displayed():
self.errors.append('Bold text is not displayed in public chat for the sender')
if not device_1_chat.chat_element_by_text(bold_text).is_element_displayed():
if not device_1_chat.chat_element_by_text(bold_text_expected).is_element_displayed():
self.errors.append('Bold text is not displayed in public chat for the recipient')
device_2_chat.chat_message_input.send_keys('_%s_' % italic_text)
device_2_chat.send_message_button.click()
if not device_2_chat.chat_element_by_text(italic_text).is_element_displayed():
if not device_2_chat.chat_element_by_text(italic_text_expected).is_element_displayed():
self.errors.append('Italic text is not displayed in public chat for the sender')
if not device_1_chat.chat_element_by_text(italic_text).is_element_displayed():
if not device_1_chat.chat_element_by_text(italic_text_expected).is_element_displayed():
self.errors.append('Italic text is not displayed in 1-1 chat for the recipient')
self.verify_no_errors()

View File

@ -32,7 +32,7 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
chat_1.chat_message_input.send_keys(message)
chat_1.send_message_button.click()
chat_2.verify_message_is_under_today_text(message, self.errors)
# chat_2.verify_message_is_under_today_text(message, self.errors)
# TODO: should be replaced with ens name after https://github.com/status-im/status-react/pull/8487
# full_username = '%s • %s' % (username_1, default_username_1)
if chat_2.chat_element_by_text(message).username.text != default_username_1:

View File

@ -205,7 +205,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
self.driver.fail('It seems onborading screen is not shown.')
send_transaction_view.complete_onboarding()
if not send_transaction_view.sign_transaction_button.is_element_displayed():
if not send_transaction_view.sign_with_password.is_element_displayed():
self.driver.fail('It seems transaction sign screen is not shown.')
send_transaction_view.sign_transaction()

View File

@ -369,7 +369,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
gas_limit = '1005000'
send_transaction.gas_limit_input.set_value(gas_limit)
send_transaction.gas_price_input.clear()
gas_price = '24'
gas_price = str(round(float(send_transaction.gas_price_input.text)) + 10)
send_transaction.gas_price_input.set_value(gas_price)
send_transaction.update_fee_button.click()
send_transaction.sign_transaction()

View File

@ -130,6 +130,10 @@ class GasPriceInput(BaseEditBox):
super(GasPriceInput, self).__init__(driver)
self.locator = self.Locator.xpath_selector("(//*[@text='Gas limit']/..//android.widget.EditText)[2]")
@property
def text(self):
return self.find_element().text
class TotalFeeInput(BaseText):
def __init__(self, driver):