e2e: fixes, align, e2e for sync

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-06-29 17:55:55 +02:00
parent 6598ef3466
commit d3fefb6238
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
12 changed files with 69 additions and 35 deletions

View File

@ -1195,7 +1195,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
if not device_2_home.mobile_connection_on_icon.is_element_displayed():
self.errors.append('No mobile connection ON icon is shown')
device_2_home.get_chat('#%s'% public_chat_name).click()
if not device_2_public.chat_element_by_text(public_chat_message).is_element_displayed(30):
if not device_2_public.chat_element_by_text(public_chat_message).is_element_displayed(90):
self.errors.append("Chat history was not fetched with mobile data fetching ON")
device_2_home.just_fyi('check redirect to sync settings by tappin "Sync" in connection status bottom sheet')

View File

@ -835,7 +835,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
chat_public_1, chat_public_2 = home_1.get_chat_view(), home_2.get_chat_view()
chat_public_1.send_message(message_from_sender)
chat_public_2.quote_message(message_from_sender)
if chat_public_2.quote_username_in_message_input.text != ("" + device_1_username):
if chat_public_2.quote_username_in_message_input.text != ("Replying to " + device_1_username):
self.errors.append(
" %s is not displayed in reply quote snippet replying to own message " % device_1_username)

View File

@ -148,13 +148,16 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
send_message = chat_2_sender_message.sign_and_send.click()
send_message.next_button.click()
send_message.sign_transaction()
home_2.just_fyi('Check that transaction message is updated with new status after offline')
chat_2.toggle_airplane_mode()
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
chat_2.toggle_airplane_mode()
[message.transaction_status.wait_for_element_text(message.confirmed, wait_time=60) for message in
[message.transaction_status.wait_for_element_text(message.pending, wait_time=60) for message in
(chat_2_sender_message, chat_1_request_message)]
# TODO: blocked because of #12256
# home_2.just_fyi('Check that transaction message is updated with new status after offline')
# chat_2.toggle_airplane_mode()
# self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
# chat_2.toggle_airplane_mode()
#[message.transaction_status.wait_for_element_text(message.confirmed, wait_time=60) for message in
#(chat_2_sender_message, chat_1_request_message)]
self.errors.verify_no_errors()
@marks.testrail_id(6265)

View File

@ -143,13 +143,17 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
send_message = chat_2_sender_message.sign_and_send.click()
send_message.next_button.click()
send_message.sign_transaction(keycard=True)
[message.transaction_status.wait_for_element_text(message.pending, wait_time=60) for message in
(chat_2_sender_message, chat_1_request_message)]
home_2.just_fyi('Check that transaction message is updated with new status after offline')
chat_2.toggle_airplane_mode()
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
chat_2.toggle_airplane_mode()
[message.transaction_status.wait_for_element_text(message.confirmed, wait_time=60) for message in
(chat_2_sender_message, chat_1_request_message)]
# TODO: blocked because of #12256
# home_2.just_fyi('Check that transaction message is updated with new status after offline')
# chat_2.toggle_airplane_mode()
# self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
# chat_2.toggle_airplane_mode()
# chat_1_request_message.transaction_status.wait_for_element_text(chat_1_request_message.confirmed, wait_time=60)
# [message.transaction_status.wait_for_element_text(message.confirmed, wait_time=60) for message in
# (chat_2_sender_message, chat_1_request_message)]
self.errors.verify_no_errors()

View File

@ -336,7 +336,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_2_home.just_fyi('reply to image message')
device_2_chat.reply_message_button.click()
if device_2_chat.quote_username_in_message_input.text != "%s" % device_1_username:
if device_2_chat.quote_username_in_message_input.text != "Replying to %s" % device_1_username:
self.errors.append("Username is not displayed in reply quote snippet replying to image message")
reply_to_message_from_receiver = "image reply"
device_2_chat.send_message(reply_to_message_from_receiver)

View File

@ -218,4 +218,30 @@ class TestPublicChatSingleDevice(SingleDeviceTestCase):
if not home_view.element_by_text(tag_message).is_element_displayed():
self.errors.append('Could not find the public chat in user chat list.')
times = {
"three-days" : '5 days',
"one-week" : '12 days',
"one-month" : ['43 days', '42 days', '41 days', '40 days'],
}
signin.just_fyi("Check that can fetch more history")
home_view.element_by_text(tag_message).click()
profile = home_view.profile_button.click()
profile.sync_settings_button.click()
profile.sync_history_for_button.click()
for period in times:
profile.just_fyi("Checking %s period" % period)
profile.element_by_translation_id(period).click()
profile.home_button.click(desired_view='chat')
chat.element_by_text_part(fetch_more).wait_and_click(120)
if period != "one-month":
if not profile.element_by_text_part(times[period]).is_element_displayed(30):
self.errors.append("'Quiet here for %s' is not shown after fetching more history" % times[period])
else:
variants = times[period]
res = any(profile.element_by_text_part(variant).is_element_displayed(30) for variant in variants)
if not res:
self.errors.append("History is not fetched for one month!" )
home_view.profile_button.click(desired_element_text=profile.get_translation_by_key("default-sync-period"))
self.errors.verify_no_errors()

View File

@ -12,18 +12,17 @@ class TestTransactionDApp(SingleDeviceTestCase):
def test_request_stt_from_daap(self):
sender = transaction_senders['K']
home = SignInView(self.driver).recover_access(sender['passphrase'], unique_password)
wallet = home.wallet_button.click()
initial_amount_STT = wallet.get_asset_amount_by_name('STT')
status_test_dapp = home.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.assets_button.click()
send_transaction = status_test_dapp.request_stt_button.click()
if not send_transaction.onboarding_message.is_element_displayed():
self.driver.fail('It seems onboarding screen is not shown.')
home.ok_got_it_button.click()
home.cancel_button.click()
wallet = home.wallet_button.click()
initial_amount_STT = wallet.get_asset_amount_by_name('STT')
wallet.dapp_tab_button.click(desired_element_text='Request STT')
#wallet.dapp_tab_button.click(desired_element_text='Request STT')
send_transaction = status_test_dapp.request_stt_button.click()
send_transaction.sign_transaction(unique_password)
status_test_dapp.wallet_button.click()

View File

@ -15,6 +15,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True)
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.asset_by_name('STT').wait_for_element(30)
initial_amount_STT = wallet_view.get_asset_amount_by_name('STT')
status_test_dapp = home_view.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
@ -24,7 +25,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
status_test_dapp.wallet_button.click()
send_transaction_view.just_fyi('Verify that wallet balance is updated')
wallet_view.wait_balance_is_changed('STT', initial_amount_STT)
wallet_view.wait_balance_is_changed('STT', initial_amount_STT, scan_tokens=True)
send_transaction_view.just_fyi('Check logcat for sensitive data')
values_in_logcat = send_transaction_view.find_values_in_logcat(mnemonic=sender['passphrase'],

View File

@ -23,10 +23,9 @@ class KeycardView(BaseView):
self.confirm_seed_phrase_edit_box = EditBox(self.driver, accessibility_id="enter-word")
def enter_default_pin(self):
self.driver.info("**Enter default pin 121212**")
for _ in range(3):
self.driver.info("**Enter default pin 111111**")
for _ in range(6):
self.one_button.click()
self.two_button.click()
def enter_another_pin(self):
self.driver.info("**Enter not-default pin 222222**")

View File

@ -223,6 +223,8 @@ class ProfileView(BaseView):
suffix="/following-sibling::android.widget.Switch[1]")
self.ask_me_when_on_mobile_network = Button(self.driver, translation_id="mobile-network-ask-me",
suffix="/following-sibling::android.widget.Switch[1]")
##Sync history data
self.sync_history_for_button = Button(self.driver, accessibility_id="default-sync-period-button")
## History nodes
self.mail_server_button = Button(self.driver, accessibility_id="offline-messages-settings-button")
self.mail_server_address_input = EditBox(self.driver, translation_id="mailserver-address",

View File

@ -206,8 +206,8 @@ class SignInView(BaseView):
def sign_in(self, password=common_password, keycard=False, position=1):
self.driver.info("**Sign in (password:%s, keycard:%s)**" % (password, str(keycard)))
self.multi_account_on_login_button.wait_for_visibility_of_element(30)
self.get_multiaccount_by_position(position).click()
if self.multi_account_on_login_button.is_element_displayed(30):
self.get_multiaccount_by_position(position).click()
if keycard:
from views.keycard_view import KeycardView

View File

@ -152,25 +152,25 @@ class WalletView(BaseView):
if counter >= wait_time:
self.driver.fail('Balance %s %s is not changed during %s seconds!' % (asset, initial_balance,wait_time))
elif self.asset_by_name(asset).is_element_present() and self.get_asset_amount_by_name(asset) == initial_balance:
if not self.transaction_history_button.is_element_displayed():
self.wallet_account_by_name(self.status_account_name).click()
if (counter/60).is_integer():
self.pull_to_refresh()
counter+=20
# if not self.transaction_history_button.is_element_displayed():
# self.wallet_account_by_name(self.status_account_name).click()
# if (counter/60).is_integer():
# self.pull_to_refresh()
# counter+=20
self.wallet_button.double_click()
counter += 10
time.sleep(10)
self.driver.info('*Waiting %ss for %s updated balance*' % (counter,asset))
elif not self.asset_by_name(asset).is_element_present(10):
counter += 10
time.sleep(10)
if scan_tokens:
self.scan_tokens()
self.driver.info('*Waiting %ss for %s updated balance*' % (counter,asset))
elif not self.asset_by_name(asset).is_element_present(10):
counter += 10
time.sleep(10)
self.swipe_up()
self.driver.info('*Waiting %s seconds for %s to display asset*' % (counter, asset))
else:
self.driver.info('**Balance is updated!**')
self.wallet_button.double_click()
# self.wallet_button.double_click()
self.element_by_translation_id("wallet-total-value").scroll_to_element(direction='up')
return self