e2e: fixes

This commit is contained in:
Churikova Tetiana 2022-05-06 16:06:29 +02:00
parent 9891469c6f
commit 44a449660a
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
7 changed files with 39 additions and 21 deletions

View File

@ -527,7 +527,7 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase):
self.chat_2.share_via_messenger()
if not self.chat_2.image_in_android_messenger.is_element_present():
self.errors.append("Can't share image")
self.chat_2.click_system_back_button()
self.chat_2.click_system_back_button_until_element_is_shown()
self.chat_2.save_image_icon_button.click()
self.chat_2.show_images_button.click()
self.chat_2.allow_button.wait_and_click()
@ -539,6 +539,7 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase):
@marks.testrail_id(5310)
def test_1_1_chat_is_shown_message_sent_delivered_from_offline(self):
self.home_1.home_button.click()
self.home_2.home_button.click()

View File

@ -421,8 +421,8 @@ class TestPublicChatBrowserOneDeviceMerged(MultipleSharedDeviceTestCase):
self.home.just_fyi('Delete one tab')
web_page.remove_tab(name=urls['bbc.com'])
if web_page.element_by_text_part(urls['bbc.com']).is_element_displayed():
self.errors.append('Closed tab is present after deletion')
web_page.open_tabs_button.wait_for_invisibility_of_element()
web_page.element_by_text_part(urls['bbc.com']).wait_for_invisibility_of_element()
self.home.just_fyi('Close all tabs via "Close all", relogin and check that it is not reappearing')
web_page.close_all_button.click()

View File

@ -279,30 +279,25 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.account_name_input.send_keys(account_seed_collectibles)
self.wallet.add_account_generate_account_button.click()
account_button = self.wallet.get_account_by_name(account_seed_collectibles)
if not account_button.is_element_displayed():
self.wallet.accounts_status_account.swipe_left_on_element()
self.home.just_fyi('Check that collectibles are not shown on Ropsten')
account_button.click()
self.wallet.collectibles_button.click()
self.wallet.element_by_translation_id("display-collectibles").scroll_and_click()
if not self.wallet.element_by_translation_id("no-collectibles").is_element_displayed():
self.errors.append("Collectibles are shown on Ropsten network!")
self.home.just_fyi('Check that collectibles amount is shown on Rinkeby')
profile = self.home.profile_button.click()
profile.switch_network('Rinkeby with upstream RPC')
# Additional login as a workaround for issue when collectibles are not shown on test network
self.wallet.reopen_app()
profile = self.home.profile_button.click()
profile.wallet_button.click()
if not account_button.is_element_displayed():
self.wallet.accounts_status_account.swipe_left_on_element()
self.wallet.scan_tokens()
account_button.click()
self.wallet.transaction_history_button.click()
self.wallet.collectibles_button.click()
self.wallet.swipe_up()
self.wallet.element_by_translation_id("display-collectibles").scroll_and_click()
# Workaround for situation when after switching network from Ropsten collectibles are not shown
self.wallet.pull_to_refresh(5)
if self.wallet.element_by_translation_id("no-collectibles").is_element_displayed():
self.wallet.reopen_app()
profile.wallet_button.click()
if not account_button.is_element_displayed():
self.wallet.accounts_status_account.swipe_left_on_element()
account_button.click()
self.wallet.collectibles_button.click()
for asset in user['collectibles']:
self.wallet.get_collectibles_amount(asset).scroll_to_element()
if self.wallet.get_collectibles_amount(asset).text != user['collectibles'][asset]:

View File

@ -82,6 +82,7 @@ class TestPublicChatMultipleDeviceMergedMedium(MultipleSharedDeviceTestCase):
chat_2.add_to_contacts.click()
timeline_2 = chat_2.status_button.click()
for status in statuses:
chat_2.element_by_text_part(statuses['*formatted text*']).scroll_to_element()
expected_value = statuses[status]
if not timeline_2.element_by_text_part(expected_value).is_element_displayed():
self.errors.append(
@ -94,8 +95,7 @@ class TestPublicChatMultipleDeviceMergedMedium(MultipleSharedDeviceTestCase):
tag_status = '#public-chat-to-redirect-long-name'
timeline_1.set_new_status(tag_status)
public_chat_2 = self.home_2.get_chat_view()
public_chat_2.element_by_text(tag_status).wait_and_click()
public_chat_2.element_by_text(tag_status).scroll_and_click('up')
public_chat_2.user_name_text.wait_for_element(30)
if not public_chat_2.user_name_text.text == tag_status:
self.errors.append('Could not redirect a user to a public chat tapping the tag message from timeline_1')

View File

@ -869,8 +869,10 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
for key in self.drivers:
sign_ins[key] = SignInView(self.drivers[key])
homes[key] = sign_ins[key].create_user()
SignInView(self.drivers[2]).put_app_to_background_and_back()
public_keys[key], usernames[key] = sign_ins[key].get_public_key_and_username(True)
sign_ins[key].home_button.click()
SignInView(self.drivers[0]).put_app_to_background_and_back()
[driver.close_app() for driver in (self.drivers[1], self.drivers[2])]
chat_name = homes[0].get_random_chat_name()
@ -935,8 +937,10 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
for key in self.drivers:
sign_in_view = SignInView(self.drivers[key])
homes[key] = sign_in_view.create_user()
SignInView(self.drivers[2]).put_app_to_background_and_back()
public_keys[key], usernames[key] = sign_in_view.get_public_key_and_username(True)
sign_in_view.home_button.click()
SignInView(self.drivers[0]).put_app_to_background_and_back()
chat_name = homes[0].get_random_chat_name()
for i in range(1, 3):
homes[0].add_contact(public_keys[i])
@ -1585,9 +1589,11 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
recovery_phrase = profile_1.get_recovery_phrase()
profile_1.close_button.click()
profile_1.home_button.click()
device_2.put_app_to_background_and_back()
home_3 = device_3.create_user()
public_key_3, username_3 = home_3.get_public_key_and_username(return_username=True)
device_3.home_button.click()
device_1.put_app_to_background_and_back()
device_1_name, device_2_name, group_chat_name = 'creator', 'paired', 'some group chat'
home_2 = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))

View File

@ -596,7 +596,7 @@ class TestChatManagement(SingleDeviceTestCase):
wallet.click_system_back_button()
wallet.just_fyi("Send transaction to new account")
transaction_amount = '0.004'
transaction_amount = '0.006'
initial_balance = self.network_api.get_balance(status_account_address)
wallet.send_transaction(account_name=account_name, amount=transaction_amount, keycard=True)
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount)
@ -855,6 +855,7 @@ class TestChatManagement(SingleDeviceTestCase):
home.just_fyi("Checking setting pairing with new PIN")
profile.change_pairing_code_button.click()
keycard.enter_another_pin()
sign_in.create_password_input.wait_for_element()
sign_in.create_password_input.set_value(common_password)
sign_in.confirm_your_password_input.set_value(common_password + "1")
if not keycard.element_by_translation_id("pairing-code_error1").is_element_displayed():

View File

@ -346,6 +346,21 @@ class BaseView(object):
for _ in range(times):
self.driver.press_keycode(4)
def click_system_back_button_until_element_is_shown(self, attempts=3, element='home'):
counter = 0
if element is 'home':
element = self.home_button
while not element.is_element_present(1) and counter <= attempts:
try:
self.driver.press_keycode(4)
element.is_element_present(5)
return self
except (NoSuchElementException, TimeoutException):
counter += 1
else:
self.driver.info("Could not reach %s element by pressing back" % element.name)
def get_app_from_background(self):
self.driver.info('Get Status back from Recent apps')
self.driver.press_keycode(187)