e2e: dbs, improvements
This commit is contained in:
parent
8dd75205f3
commit
2ed3b50663
|
@ -89,6 +89,7 @@ class TestrailReport(BaseTestReport):
|
|||
'include_all': False}
|
||||
run = self.post('add_run/%s' % self.project_id, request_body)
|
||||
self.run_id = run['id']
|
||||
print("Testrun: %sruns/view/%s" % (self.url, self.run_id))
|
||||
|
||||
def get_cases(self, section_ids):
|
||||
test_cases = list()
|
||||
|
@ -157,9 +158,7 @@ class TestrailReport(BaseTestReport):
|
|||
else:
|
||||
for phase in test_cases:
|
||||
if phase != 'upgrade':
|
||||
print("For %s phase" % phase)
|
||||
for category in test_cases[phase]:
|
||||
print("For %s category" % category)
|
||||
for case in self.get_cases([test_cases[phase][category]]):
|
||||
case_ids.append(case['id'])
|
||||
return case_ids
|
||||
|
|
|
@ -102,7 +102,7 @@ class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase):
|
|||
[message.transaction_status.wait_for_element_text(message.confirmed, 60) for message in
|
||||
(sender_message, receiver_message)]
|
||||
|
||||
# TODO: should be added PNs for receiver after getting more stable feature (rechecked 23.11.21, valid)
|
||||
# TODO: should be added PNs for receiver after getting more stable feature (rechecked 04.10.22, valid)
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6265)
|
||||
|
@ -337,19 +337,19 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase):
|
|||
self.chat_2.send_message(message_before_edit_1_1)
|
||||
|
||||
self.chat_2.edit_message_in_chat(message_before_edit_1_1, message_after_edit_1_1)
|
||||
if not self.home_1.element_by_text_part(message_after_edit_1_1).is_element_present():
|
||||
if not self.home_1.element_by_text_part(message_after_edit_1_1).is_element_displayed():
|
||||
self.errors.append('UNedited message version displayed on preview')
|
||||
self.home_1.get_chat(self.default_username_2).click()
|
||||
chat_element = self.chat_1.chat_element_by_text(message_after_edit_1_1)
|
||||
if not chat_element.is_element_present(30):
|
||||
if not chat_element.is_element_displayed(30):
|
||||
self.errors.append('No edited message in 1-1 chat displayed')
|
||||
if not self.chat_1.element_by_text_part("⌫ Edited").is_element_present(30):
|
||||
if not self.chat_1.element_by_text_part("⌫ Edited").is_element_displayed(30):
|
||||
self.errors.append('No mark in message bubble about this message was edited on receiver side')
|
||||
|
||||
self.device_2.just_fyi("Verify Device1 can not edit and delete received message from Device2")
|
||||
chat_element.long_press_element()
|
||||
for action in ("edit", "delete"):
|
||||
if self.chat_1.element_by_translation_id(action).is_element_present():
|
||||
if self.chat_1.element_by_translation_id(action).is_element_displayed():
|
||||
self.errors.append('Option to %s someone else message available!' % action)
|
||||
self.home_1.click_system_back_button()
|
||||
|
||||
|
@ -532,9 +532,9 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase):
|
|||
self.chat_2.image_message_in_chat.click_until_presence_of_element(self.chat_2.share_image_icon_button)
|
||||
self.chat_2.share_image_icon_button.click()
|
||||
self.chat_2.share_via_messenger()
|
||||
if not self.chat_2.image_in_android_messenger.is_element_present():
|
||||
if not self.chat_2.image_in_android_messenger.is_element_displayed():
|
||||
self.errors.append("Can't share image")
|
||||
self.chat_2.click_system_back_button_until_element_is_shown()
|
||||
self.chat_2.click_system_back_button_until_element_is_shown(element=self.chat_2.save_image_icon_button)
|
||||
self.chat_2.save_image_icon_button.click()
|
||||
self.chat_2.show_images_button.click()
|
||||
self.chat_2.allow_button.wait_and_click()
|
||||
|
@ -1153,7 +1153,7 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase):
|
|||
self.errors.append('Sticker was not sent from Recent')
|
||||
|
||||
# self.home_2.just_fyi('Check that can install stickers by tapping on sticker message')
|
||||
# TODO: disabled because of #13683 (rechecked 27.07.22, valid)
|
||||
# TODO: disabled because of #13683 (rechecked 04.10.22, valid)
|
||||
self.home_2.home_button.double_click()
|
||||
self.home_2.get_chat(self.sender['username']).click()
|
||||
# self.chat_2.chat_item.click()
|
||||
|
|
|
@ -50,7 +50,7 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
|
|||
self.home.just_fyi("Sharing contact code via messenger")
|
||||
self.profile.share_button.click()
|
||||
self.profile.share_via_messenger()
|
||||
if not self.profile.element_by_text_part(public_key).is_element_present():
|
||||
if not self.profile.element_by_text_part(public_key).is_element_displayed():
|
||||
self.errors.append("Can't share public key")
|
||||
self.profile.click_system_back_button_until_element_is_shown()
|
||||
|
||||
|
@ -78,7 +78,7 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
|
|||
self.home.just_fyi("Sharing wallet address via messenger")
|
||||
request.share_button.click()
|
||||
wallet.share_via_messenger()
|
||||
if not wallet.element_by_text_part(address).is_element_present():
|
||||
if not wallet.element_by_text_part(address).is_element_displayed():
|
||||
self.errors.append("Can't share address")
|
||||
wallet.click_system_back_button_until_element_is_shown()
|
||||
|
||||
|
@ -477,4 +477,4 @@ class TestRestoreOneDeviceMerged(MultipleSharedDeviceTestCase):
|
|||
transaction_amount_added = wallet.get_unique_amount()
|
||||
wallet.send_transaction(amount=transaction_amount_added, recipient=transaction_senders['ETH_8']['address'],
|
||||
keycard=True, sign_transaction=True)
|
||||
self.errors.verify_no_errors()
|
||||
self.errors.verify_no_errors()
|
|
@ -292,7 +292,7 @@ class TestPublicChatBrowserOneDeviceMerged(MultipleSharedDeviceTestCase):
|
|||
def test_public_chat_copy_and_paste_message_in_chat_input(self):
|
||||
message_text = {'text_message': 'mmmeowesage_text'}
|
||||
formatted_message = {'message_with_link': 'https://status.im',
|
||||
# TODO: blocked with 11161 (rechecked 23.11.21, valid)
|
||||
# TODO: blocked with 11161 (rechecked 04.10.22, valid)
|
||||
# 'message_with_tag': '#successishere'
|
||||
}
|
||||
message_input = self.chat.chat_message_input
|
||||
|
|
|
@ -155,7 +155,7 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
|
|||
self.errors.append("Tx is not sent!")
|
||||
send_tx.ok_button.click()
|
||||
|
||||
# TODO: disabled due to 10838 (rechecked 27.07.22, valid)
|
||||
# TODO: disabled due to 10838 (rechecked 04.10.22, valid)
|
||||
# transactions_view = wallet.transaction_history_button.click()
|
||||
# transactions_view.transactions_table.find_transaction(amount=amount, asset=symbol)
|
||||
self.errors.verify_no_errors()
|
||||
|
|
|
@ -169,13 +169,13 @@ class TestActivityCenterMultipleDeviceMedium(MultipleSharedDeviceTestCase):
|
|||
self.home_1.home_button.double_click()
|
||||
|
||||
self.home_1.just_fyi("Check there are no unread messages counter on chats after message is read")
|
||||
if (self.home_1.notifications_unread_badge.is_element_present() or
|
||||
if (self.home_1.notifications_unread_badge.is_element_displayed() or
|
||||
self.home_1.get_chat_from_home_view(self.group_chat_name_1).new_messages_counter.text == "1"):
|
||||
self.errors.append("Unread message indicator is kept after message is read in chat")
|
||||
|
||||
self.home_1.just_fyi("Check there is an empty view on Activity Center")
|
||||
self.home_1.notifications_button.click()
|
||||
if not self.home_1.element_by_translation_id('empty-activity-center').is_element_present():
|
||||
if not self.home_1.element_by_translation_id('empty-activity-center').is_element_displayed():
|
||||
self.errors.append("Activity Center still has some chats after user has opened all of them")
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
|
|
@ -148,7 +148,7 @@ class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleShared
|
|||
self.profile_1.bootnodes_button.click()
|
||||
self.profile_1.add_bootnode_button.click()
|
||||
self.profile_1.specify_name_input.set_value('test')
|
||||
# TODO: blocked as validation is missing for bootnodes (rechecked 27.07.22, valid)
|
||||
# TODO: blocked as validation is missing for bootnodes (rechecked 04.10.22, valid)
|
||||
# profile_1.bootnode_address_input.set_value('invalid_bootnode_address')
|
||||
# if not profile_1.element_by_text_part('Invalid format').is_element_displayed():
|
||||
# self.errors.append('Validation message about invalid format of bootnode is not shown')
|
||||
|
@ -420,7 +420,7 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
|
|||
self.chat_1.send_message(self.message_1)
|
||||
self.chat_1.send_message(self.message_2)
|
||||
self.chat_1.pin_message(self.message_1)
|
||||
if not self.chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_present():
|
||||
if not self.chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_displayed():
|
||||
self.drivers[0].fail("Message is not pinned!")
|
||||
|
||||
self.home_1.just_fyi("Check that Device2 can pin Device1 message in 1-1 chat and two pinned "
|
||||
|
@ -435,16 +435,16 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
|
|||
self.chat_1.chat_options.click()
|
||||
self.chat_1.view_profile_button.click()
|
||||
self.chat_1.pinned_messages_button.click()
|
||||
if not (self.chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_present() and
|
||||
self.chat_1.chat_element_by_text(self.message_2).pinned_by_label.is_element_present() and
|
||||
self.chat_1.chat_element_by_text(self.message_1).is_element_present() and
|
||||
self.chat_1.chat_element_by_text(self.message_2).is_element_present()):
|
||||
if not (self.chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_displayed() and
|
||||
self.chat_1.chat_element_by_text(self.message_2).pinned_by_label.is_element_displayed() and
|
||||
self.chat_1.chat_element_by_text(self.message_1).is_element_displayed() and
|
||||
self.chat_1.chat_element_by_text(self.message_2).is_element_displayed()):
|
||||
self.drivers[0].fail("Something missed on Pinned messaged on Device 1!")
|
||||
self.chat_2.pinned_messages_button.click()
|
||||
if not (self.chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_present() and
|
||||
self.chat_2.chat_element_by_text(self.message_2).pinned_by_label.is_element_present() and
|
||||
self.chat_2.chat_element_by_text(self.message_1).is_element_present() and
|
||||
self.chat_2.chat_element_by_text(self.message_2).is_element_present()):
|
||||
if not (self.chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_displayed() and
|
||||
self.chat_2.chat_element_by_text(self.message_2).pinned_by_label.is_element_displayed() and
|
||||
self.chat_2.chat_element_by_text(self.message_1).is_element_displayed() and
|
||||
self.chat_2.chat_element_by_text(self.message_2).is_element_displayed()):
|
||||
self.drivers[0].fail("Something missed on Pinned messaged on Device 2!")
|
||||
self.chat_1.close_button.click()
|
||||
|
||||
|
@ -454,25 +454,25 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
|
|||
self.chat_1.send_message(self.message_4)
|
||||
self.chat_1.pin_message(self.message_3)
|
||||
self.chat_1.pin_message(self.message_4)
|
||||
if not self.chat_1.unpin_message_popup.is_element_present():
|
||||
if not self.chat_1.unpin_message_popup.is_element_displayed():
|
||||
self.drivers[0].fail("No 'Unpin' dialog appears when pining 4th message")
|
||||
|
||||
self.home_1.just_fyi("Unpin one message so that another could be pinned")
|
||||
self.chat_1.unpin_message_popup.message_text(self.message_1).click()
|
||||
self.chat_1.unpin_message_popup.click_unpin_message_button()
|
||||
|
||||
if self.chat_1.unpin_message_popup.is_element_present():
|
||||
if self.chat_1.unpin_message_popup.is_element_displayed():
|
||||
self.drivers[0].fail("Unpin message pop up keep staying after Unpin button pressed")
|
||||
if self.chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_present():
|
||||
if self.chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_displayed():
|
||||
self.drivers[0].fail("Message is not unpinned!")
|
||||
if not self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_present():
|
||||
if not self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed():
|
||||
self.drivers[0].fail("Message is not pinned!")
|
||||
|
||||
self.home_1.just_fyi("Unpin another message and check it's unpinned for another user")
|
||||
self.chat_2.close_button.click()
|
||||
self.chat_2.pin_message(self.message_4, action="unpin")
|
||||
self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.wait_for_invisibility_of_element()
|
||||
if self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_present():
|
||||
if self.chat_1.chat_element_by_text(self.message_4).pinned_by_label.is_element_displayed():
|
||||
self.drivers[0].fail("Message_4 is not unpinned!")
|
||||
|
||||
@marks.testrail_id(702065)
|
||||
|
@ -577,13 +577,13 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
|
|||
[home.get_chat(self.new_group_chat_name).click() for home in (self.home_1, self.home_2)]
|
||||
self.group_chat_1.send_message(self.message_1)
|
||||
self.group_chat_1.pin_message(self.message_1)
|
||||
if not (self.group_chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_present(30) and
|
||||
self.group_chat_2.chat_element_by_text(self.message_1).pinned_by_label.is_element_present(30)):
|
||||
if not (self.group_chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_displayed(30) and
|
||||
self.group_chat_2.chat_element_by_text(self.message_1).pinned_by_label.is_element_displayed(30)):
|
||||
self.errors.append("Message is not pinned in group chat!")
|
||||
|
||||
self.home_1.just_fyi("Check that non admin user can not unpin messages")
|
||||
self.group_chat_2.chat_element_by_text(self.message_1).long_press_element()
|
||||
if self.group_chat_2.element_by_translation_id("unpin").is_element_present():
|
||||
if self.group_chat_2.element_by_translation_id("unpin").is_element_displayed():
|
||||
self.errors.append("Unpin option is available for non-admin user")
|
||||
|
||||
self.home_1.just_fyi("Grant another user with admin rights and check he can unpin message now")
|
||||
|
@ -593,8 +593,8 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
|
|||
options.make_admin_button.click()
|
||||
self.group_chat_2.click_system_back_button()
|
||||
self.group_chat_2.pin_message(self.message_1, action="unpin")
|
||||
if (self.group_chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_present() and
|
||||
self.group_chat_2.chat_element_by_text(self.message_1).pinned_by_label.is_element_present()):
|
||||
if (self.group_chat_1.chat_element_by_text(self.message_1).pinned_by_label.is_element_displayed() and
|
||||
self.group_chat_2.chat_element_by_text(self.message_1).pinned_by_label.is_element_displayed()):
|
||||
self.errors.append("Message failed be unpinned by user who granted admin permissions!")
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
|
|
@ -43,7 +43,7 @@ class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
|
|||
self.sign_in.open_weblink_and_login(deep_link)
|
||||
self.home = self.sign_in.get_home_view()
|
||||
self.home.plus_button.click_until_presence_of_element(self.home.start_new_chat_button)
|
||||
if not self.home.start_new_chat_button.is_element_present():
|
||||
if not self.home.start_new_chat_button.is_element_displayed():
|
||||
self.errors.append(
|
||||
"Can't navigate to start new chat after app opened from deep link with invalid public key")
|
||||
self.drivers[0].close_app()
|
||||
|
@ -78,7 +78,7 @@ class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
|
|||
web_view = self.sign_in.get_chat_view()
|
||||
try:
|
||||
test_dapp_view = web_view.open_in_status_button.click()
|
||||
test_dapp_view.allow_button.is_element_present()
|
||||
test_dapp_view.allow_button.is_element_displayed()
|
||||
except NoSuchElementException:
|
||||
self.drivers[0].fail("DApp '%s' is not opened!" % dapp_name)
|
||||
self.home.reopen_app()
|
||||
|
@ -96,7 +96,7 @@ class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
|
|||
chat.share_button.click()
|
||||
chat.share_via_messenger()
|
||||
if not chat.element_by_text_part(
|
||||
'https://join.status.im/u/%s' % dummy_user["public_key"]).is_element_present():
|
||||
'https://join.status.im/u/%s' % dummy_user["public_key"]).is_element_displayed():
|
||||
self.errors.append("Can't share public key of contact")
|
||||
for _ in range(2):
|
||||
chat.click_system_back_button_until_element_is_shown()
|
||||
|
@ -112,7 +112,7 @@ class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
|
|||
self.public_chat.share_chat_button.click()
|
||||
self.public_chat.share_via_messenger()
|
||||
if not self.public_chat.element_by_text_part(
|
||||
'https://join.status.im/%s' % self.public_chat_name).is_element_present():
|
||||
'https://join.status.im/%s' % self.public_chat_name).is_element_displayed():
|
||||
self.errors.append("Can't share link to public chat")
|
||||
for _ in range(2):
|
||||
self.public_chat.click_system_back_button_until_element_is_shown()
|
||||
|
@ -130,8 +130,8 @@ class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
|
|||
expeceted_text_1 = 'https://join.status.im/b/https://dap.ps'
|
||||
expeceted_text_2 = 'https://join.status.im/b/http://dap.ps'
|
||||
|
||||
if not (browser.element_by_text_part(expeceted_text_1).is_element_present() or
|
||||
browser.element_by_text_part(expeceted_text_2).is_element_present()):
|
||||
if not (browser.element_by_text_part(expeceted_text_1).is_element_displayed() or
|
||||
browser.element_by_text_part(expeceted_text_2).is_element_displayed()):
|
||||
self.errors.append("Can't share link to URL")
|
||||
|
||||
browser.click_system_back_button_until_element_is_shown()
|
||||
|
|
|
@ -108,8 +108,6 @@ class TestPairingSyncMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
|
|||
self.profile_1.sync_all_button.wait_for_visibility_of_element(20)
|
||||
[device.profile_button.double_click() for device in (self.profile_1, self.profile_2)]
|
||||
[device.home_button.double_click() for device in (self.profile_1, self.device_3)]
|
||||
# TODO Relogin to workaround #13647, should be removed after fix of the issue(rechecked 27.07.22, valid)
|
||||
self.profile_2.relogin()
|
||||
self.device_3.put_app_to_background_and_back()
|
||||
|
||||
@marks.testrail_id(702133)
|
||||
|
|
|
@ -470,13 +470,13 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||
sign_in = SignInView(self.driver)
|
||||
sign_in.create_user()
|
||||
wallet = sign_in.wallet_button.click()
|
||||
if wallet.backup_recovery_phrase_warning_text.is_element_present():
|
||||
if wallet.backup_recovery_phrase_warning_text.is_element_displayed():
|
||||
self.driver.fail("'Back up your seed phrase' warning is shown on Wallet while no funds are present")
|
||||
address = wallet.get_wallet_address()
|
||||
self.click = wallet.close_button.click()
|
||||
w3.donate_testnet_eth(address, 0.0001)
|
||||
wallet.wait_balance_is_changed()
|
||||
if not wallet.backup_recovery_phrase_warning_text.is_element_present(30):
|
||||
if not wallet.backup_recovery_phrase_warning_text.is_element_displayed(30):
|
||||
self.driver.fail("'Back up your seed phrase' warning is not shown on Wallet with funds")
|
||||
profile = wallet.get_profile_view()
|
||||
wallet.backup_recovery_phrase_warning_text.click()
|
||||
|
@ -813,7 +813,7 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||
no_link_tos_error_msg = 'Could not open Terms of Use from'
|
||||
|
||||
signin.just_fyi("Checking privacy policy and TOS links")
|
||||
if not signin.privacy_policy_link.is_element_present():
|
||||
if not signin.privacy_policy_link.is_element_displayed():
|
||||
self.errors.append('%s Sign in view!' % no_link_found_error_msg)
|
||||
if not signin.terms_of_use_link.is_element_displayed():
|
||||
self.driver.fail("No Terms of Use link on Sign in view!")
|
||||
|
@ -990,6 +990,7 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||
self.driver.fail("Unblocked user not added previously in contact list added in contacts!")
|
||||
|
||||
@marks.testrail_id(5721)
|
||||
@marks.xfail(reason="may be failed due to #14013")
|
||||
def test_group_chat_cant_add_more_twenty_participants(self):
|
||||
user_20_contacts = dict()
|
||||
user_20_contacts[
|
||||
|
@ -1123,7 +1124,7 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||
|
||||
@marks.testrail_id(6300)
|
||||
@marks.skip
|
||||
# TODO: waiting mode (rechecked 27.07.22, valid)
|
||||
# TODO: waiting mode (rechecked 04.10.22, valid)
|
||||
def test_webview_security(self):
|
||||
home_view = SignInView(self.driver).create_user()
|
||||
daap_view = home_view.dapp_tab_button.click()
|
||||
|
|
|
@ -95,10 +95,9 @@ class BaseElement(object):
|
|||
counter = 0
|
||||
self.driver.info("Click until `%s` by `%s`: `%s` will be presented" % (
|
||||
desired_element.name, desired_element.by, desired_element.locator))
|
||||
while not desired_element.is_element_present(1) and counter <= attempts:
|
||||
while not desired_element.is_element_displayed(1) and counter <= attempts:
|
||||
try:
|
||||
self.find_element().click()
|
||||
desired_element.is_element_present(5)
|
||||
return self.navigate()
|
||||
except (NoSuchElementException, TimeoutException):
|
||||
counter += 1
|
||||
|
@ -178,11 +177,11 @@ class BaseElement(object):
|
|||
self.scroll_to_element(direction=direction)
|
||||
self.click()
|
||||
|
||||
def is_element_present(self, sec=5):
|
||||
try:
|
||||
return self.wait_for_element(sec)
|
||||
except TimeoutException:
|
||||
return False
|
||||
# def is_element_present(self, sec=5):
|
||||
# try:
|
||||
# return self.wait_for_element(sec)
|
||||
# except TimeoutException:
|
||||
# return False
|
||||
|
||||
def is_element_displayed(self, sec=5, ignored_exceptions=None):
|
||||
try:
|
||||
|
@ -374,7 +373,7 @@ class Button(BaseElement):
|
|||
counter = 0
|
||||
self.driver.info("Click until `%s` by `%s`: `%s` is NOT presented" % (
|
||||
desired_element.name, desired_element.by, desired_element.locator))
|
||||
while desired_element.is_element_present(1) and counter <= attempts:
|
||||
while desired_element.is_element_displayed(1) and counter <= attempts:
|
||||
try:
|
||||
self.find_element().click()
|
||||
counter += 1
|
||||
|
|
|
@ -196,7 +196,7 @@ class AirplaneModeButton(Button):
|
|||
def click(self):
|
||||
counter = 0
|
||||
desired_element = AirplaneModeButton(self.driver)
|
||||
while not desired_element.is_element_present() and counter <= 3:
|
||||
while not desired_element.is_element_displayed() and counter <= 3:
|
||||
try:
|
||||
self.open_quick_action_menu()
|
||||
desired_element.wait_for_element(5)
|
||||
|
@ -313,7 +313,7 @@ class BaseView(object):
|
|||
|
||||
def close_native_device_dialog(self, alert_text_part):
|
||||
element = self.element_by_text_part(alert_text_part)
|
||||
if element.is_element_present(1):
|
||||
if element.is_element_displayed(1):
|
||||
self.driver.info("Closing '%s' alert..." % alert_text_part)
|
||||
self.native_close_button.click()
|
||||
|
||||
|
@ -330,7 +330,7 @@ class BaseView(object):
|
|||
|
||||
def confirm_until_presence_of_element(self, desired_element, attempts=3):
|
||||
counter = 0
|
||||
while not desired_element.is_element_present(1) and counter <= attempts:
|
||||
while not desired_element.is_element_displayed(1) and counter <= attempts:
|
||||
try:
|
||||
self.confirm()
|
||||
self.driver.info("Wait for '%s'" % desired_element.name)
|
||||
|
@ -352,17 +352,16 @@ class BaseView(object):
|
|||
counter = 0
|
||||
if element == 'home':
|
||||
element = self.home_button
|
||||
while not element.is_element_present(1) and counter <= attempts:
|
||||
while not element.is_element_displayed(1) and counter <= attempts:
|
||||
self.driver.press_keycode(4)
|
||||
try:
|
||||
element.is_element_present(5)
|
||||
element.wait_for_element(2)
|
||||
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)
|
||||
|
|
|
@ -976,7 +976,7 @@ class ChatView(BaseView):
|
|||
|
||||
if image:
|
||||
self.timeline_open_images_panel_button.click()
|
||||
if self.allow_button.is_element_present():
|
||||
if self.allow_button.is_element_displayed():
|
||||
self.allow_button.click()
|
||||
self.first_image_from_gallery.click()
|
||||
self.timeline_send_my_status_button.click()
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -470,7 +470,7 @@ class ProfileView(BaseView):
|
|||
def retry_to_connect_to_mailserver(self):
|
||||
self.driver.info("Retrying to connect to mailserver 5 times")
|
||||
i = 0
|
||||
while self.element_by_translation_id("mailserver-error-title").is_element_present(20) and i < 5:
|
||||
while self.element_by_translation_id("mailserver-error-title").is_element_displayed(20) and i < 5:
|
||||
self.element_by_translation_id("mailserver-retry", uppercase=True).click()
|
||||
i += 1
|
||||
self.just_fyi("retrying to connect: %s attempt" % i)
|
||||
|
|
|
@ -105,7 +105,7 @@ class TermsOfUseLink(Button):
|
|||
|
||||
def click(self):
|
||||
counter = 0
|
||||
while PrivacyPolicyLink(self.driver).is_element_present(1) and counter <= 5:
|
||||
while PrivacyPolicyLink(self.driver).is_element_displayed(1) and counter <= 5:
|
||||
try:
|
||||
self.click_inside_element_by_coordinate(times_to_click=2)
|
||||
counter += 1
|
||||
|
|
|
@ -182,7 +182,7 @@ 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(
|
||||
elif self.asset_by_name(asset).is_element_displayed() and self.get_asset_amount_by_name(
|
||||
asset) == initial_balance:
|
||||
if scan_tokens:
|
||||
self.scan_tokens()
|
||||
|
@ -192,7 +192,7 @@ class WalletView(BaseView):
|
|||
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):
|
||||
elif not self.asset_by_name(asset).is_element_displayed(10):
|
||||
if scan_tokens:
|
||||
self.scan_tokens()
|
||||
self.swipe_up()
|
||||
|
|
|
@ -45,7 +45,7 @@ class BaseWebView(BaseView):
|
|||
def wait_for_d_aap_to_load(self, wait_time=35):
|
||||
self.driver.info("Waiting %ss for dapp to load" % wait_time)
|
||||
counter = 0
|
||||
while self.progress_bar_icon.is_element_present(5):
|
||||
while self.progress_bar_icon.is_element_displayed(5):
|
||||
time.sleep(1)
|
||||
counter += 1
|
||||
if counter > wait_time:
|
||||
|
|
Loading…
Reference in New Issue