e2e: fixes

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-12-21 14:57:13 +01:00
parent be79a8e54c
commit e5ff46fdd5
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
14 changed files with 56 additions and 43 deletions

View File

@ -42,11 +42,11 @@ rlp==1.2.0
sauceclient==1.0.0
scrypt==0.8.17
selenium==3.14.1
six==1.10.0
six==1.11.0
urllib3==1.26.3
yarl==1.6.3
zbarlight==3.0
docker==4.4.0
influxdb==5.3.1
web3
imagehash
web3==5.25.0
imagehash

View File

@ -96,7 +96,7 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.get_started_button.click()
if sign_in.generate_key_button.is_element_displayed():
self.errors.append("Agree with ToS is not mandatory to proceed onboarding!")
sign_in.accept_tos_checkbox.click()
sign_in.accept_tos_checkbox.enable()
sign_in.get_started_button.click_until_presence_of_element(sign_in.generate_key_button)
sign_in.generate_key_button.click()
from views.sign_in_view import MultiAccountButton
@ -141,7 +141,7 @@ class TestCreateAccount(SingleDeviceTestCase):
@marks.high
def test_pass_phrase_validation(self):
sign_in = SignInView(self.driver)
sign_in.accept_tos_checkbox.click()
sign_in.accept_tos_checkbox.enable()
sign_in.get_started_button.click_until_presence_of_element(sign_in.access_key_button)
sign_in.access_key_button.click()
validations = [
@ -219,7 +219,7 @@ class TestCreateAccount(SingleDeviceTestCase):
@marks.medium
def test_create_account_short_and_mismatch_password(self):
sign_in = SignInView(self.driver)
sign_in.accept_tos_checkbox.click()
sign_in.accept_tos_checkbox.enable()
sign_in.get_started_button.click()
sign_in.generate_key_button.click()
sign_in.next_button.click()

View File

@ -179,7 +179,7 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in = SignInView(self.driver)
sign_in.just_fyi('Cancel on PIN code setup stage')
sign_in.accept_tos_checkbox.click()
sign_in.accept_tos_checkbox.enable()
sign_in.get_started_button.click()
sign_in.generate_key_button.click()
username = sign_in.first_username_on_choose_chat_name.text
@ -232,7 +232,7 @@ class TestCreateAccount(SingleDeviceTestCase):
@marks.flaky
def test_keycard_interruption_access_key_onboarding_flow(self):
sign_in = SignInView(self.driver)
sign_in.accept_tos_checkbox.click()
sign_in.accept_tos_checkbox.enable()
sign_in.get_started_button.click()
sign_in.access_key_button.click()
@ -277,7 +277,7 @@ class TestCreateAccount(SingleDeviceTestCase):
recovered_user = transaction_senders['A']
sign_in.just_fyi('Recover multiaccount')
sign_in.accept_tos_checkbox.click()
sign_in.accept_tos_checkbox.enable()
sign_in.get_started_button.click_until_presence_of_element(sign_in.access_key_button)
sign_in.access_key_button.click()
sign_in.recover_with_keycard_button.click()
@ -324,7 +324,7 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.toggle_airplane_mode()
sign_in.just_fyi('Recover multiaccount offline')
sign_in.accept_tos_checkbox.click()
sign_in.accept_tos_checkbox.enable()
sign_in.get_started_button.click_until_presence_of_element(sign_in.access_key_button)
sign_in.access_key_button.click()
sign_in.recover_with_keycard_button.click()
@ -673,7 +673,7 @@ class TestKeycardCreateMultiaccountMultipleDevice(MultipleDeviceTestCase):
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1.just_fyi("Create keycard account and save seed phrase")
device_1.accept_tos_checkbox.click()
device_1.accept_tos_checkbox.enable()
device_1.get_started_button.click()
device_1.generate_key_button.click_until_presence_of_element(device_1.next_button)
device_1.next_button.click_until_absense_of_element(device_1.element_by_translation_id("intro-wizard-title2"))

View File

@ -1219,7 +1219,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
@marks.testrail_id(695856)
@marks.medium
@marks.flaky
#@marks.flaky
def test_pair_devices_sync_photo_community_group_chats(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
@ -1296,12 +1296,12 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
[home.home_button.double_click() for home in (home_1, home_2)]
home_1.get_chat(comm_before_sync_name, community=True).click()
comm_before_1.leave_community()
if not home_2.get_chat(comm_before_sync_name).is_element_disappeared(30):
if not home_2.element_by_text_part(comm_before_sync_name).is_element_disappeared(30):
self.errors.append("Leaving community was not synced!")
device_1.just_fyi("Adding new community and check it will be synced")
home_1.create_community(comm_after_sync_name)
if not home_2.get_chat(comm_after_sync_name, community=True).is_element_displayed(30):
if not home_2.element_by_text(comm_after_sync_name).is_element_displayed(30):
self.errors.append('Added community was not appeared after initial sync')
# TODO: skip until #11558 (rechecked 23.11.21, valid)

View File

@ -168,7 +168,10 @@ class TestWalletManagement(SingleDeviceTestCase):
self.errors.append('%s asset is not shown in wallet after relogin' % asset)
sign_in.just_fyi("Deselecting asset")
wallet.select_asset(asset)
wallet.multiaccount_more_options.click()
wallet.manage_assets_button.click()
wallet.asset_checkbox_by_name(asset).click()
wallet.cross_icon.click()
if wallet.asset_by_name(asset).is_element_displayed():
self.errors.append('%s asset is shown in wallet but was deselected' % asset)
self.errors.verify_no_errors()

View File

@ -696,7 +696,6 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
if public_chat_after_block_1.chat_element_by_text(message_after_block_2).is_element_displayed():
self.errors.append("Message from blocked user '%s' is received" % device_2.driver.number)
public_chat_after_block_1.get_back_to_home_view()
if home_1.notifications_unread_badge.is_element_displayed():
device_1.driver.fail("Unread badge is shown after receiving new message from blocked user")
if blocked_chat_user.is_element_displayed():
@ -718,6 +717,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
device_1.click_system_home_button()
self.drivers[0].launch_app()
device_1.sign_in()
public_chat_after_block_1.home_button.double_click()
if home_1.notifications_unread_badge.is_element_displayed():
device_1.driver.fail("Unread badge is shown after after fetching new messages from offline")
if blocked_chat_user.is_element_displayed():

View File

@ -109,8 +109,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
home_1.just_fyi('go back online and check that 1-1 chat will be fetched')
home_1.toggle_airplane_mode()
chat_element = home_1.get_chat(username_2)
chat_element.wait_for_visibility_of_element(30)
chat_element = home_1.get_chat(username_2, wait_time=60)
chat_1 = chat_element.click()
chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element(2)
@ -162,13 +161,14 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
if device_2_chat.user_name_text.text != default_username_1:
self.errors.append("Default username '%s' is not shown in one-to-one chat" % default_username_1)
profile_1.just_fyi("Check timestamps for sender and receiver")
for chat in device_1_chat, device_2_chat:
chat.verify_message_is_under_today_text(timestamp_message, self.errors)
timestamp = chat.chat_element_by_text(timestamp_message).timestamp_message.text
if timestamp not in sent_time_variants:
self.errors.append(
"Timestamp is not shown, expected '%s', in fact '%s'" % (sent_time_variants.join(","), timestamp))
# TODO: disabled until https://github.com/status-im/status-react/issues/12936 fix
# profile_1.just_fyi("Check timestamps for sender and receiver")
# for chat in device_1_chat, device_2_chat:
# chat.verify_message_is_under_today_text(timestamp_message, self.errors)
# timestamp = chat.chat_element_by_text(timestamp_message).timestamp_message.text
# if timestamp not in sent_time_variants:
# self.errors.append(
# "Timestamp is not shown, expected '%s', in fact '%s'" % (sent_time_variants.join(","), timestamp))
device_2_home.just_fyi("Add user to contact and verify his default username")
device_2_chat.add_to_contacts.click()
@ -883,7 +883,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
chat.send_message_button.click()
message_bubble = chat.chat_element_by_text(formatted_message[message])
message_bubble.timestamp_message.long_press_element()
message_bubble.sent_status_checkmark.long_press_element()
chat.element_by_text('Copy').click()
message_input.paste_text_from_clipboard()
@ -964,13 +964,10 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
self.errors.append('"%s" is not show in chat preview on home screen!' % message)
home.get_chat('@%s' % ens).click()
home.just_fyi('Check redirect to user profile on mention by ENS tap')
chat.chat_element_by_text(message).click()
if not chat.profile_block_contact.is_element_displayed():
self.errors.append('No redirect to user profile after tapping on message with mention (ENS) in 1-1 chat')
home.just_fyi('Set nickname and mention user by nickname in 1-1 chat')
russian_nickname = 'МОЙ дорогой ДРУх'
chat.chat_options.click()
chat.view_profile_button.click()
chat.set_nickname(russian_nickname)
chat.select_mention_from_suggestion_list(russian_nickname + ' @' + ens)

View File

@ -28,6 +28,8 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
@marks.testrail_id(5313)
@marks.critical
@marks.skip
#TODO: should be updated after https://github.com/status-im/status-react/issues/12936
def test_public_chat_messaging_emojis_timestamps(self):
home_1, home_2 = HomeView(self.drivers[0]), HomeView(self.drivers[1])
home_1.just_fyi("Check preselected chats, redirect to status chat")

View File

@ -402,6 +402,13 @@ class SilentButton(Button):
class CheckBox(Button):
def click(self):
def __init__(self, driver, **kwargs):
super(Button, self).__init__(driver, **kwargs)
def enable(self):
super(CheckBox, self).click_until_presence_of_element(Button(self.driver, accessibility_id="checkbox-on"))
return self.navigate()
def disable(self):
super(CheckBox, self).click_until_presence_of_element(Button(self.driver, accessibility_id="checkbox-off"))
return self.navigate()

View File

@ -144,7 +144,8 @@ class ChatElementByText(Text):
@property
def timestamp_message(self):
class TimeStampText(Text):
class TimeStampText(Button):
def __init__(self, driver, parent_locator: str):
super().__init__(driver, xpath="(%s//android.widget.TextView)[last()]" % parent_locator)
@ -191,6 +192,10 @@ class ChatElementByText(Text):
status = 'delivered'
return status
@property
def sent_status_checkmark(self) -> object:
return Text(self.driver, prefix=self.locator, xpath="//*[@content-desc='sent']")
@property
def replied_message_text(self):
class RepliedMessageText(Text):

View File

@ -195,7 +195,7 @@ class HomeView(BaseView):
self.notifications_accept_and_add_button = Button(self.driver,
accessibility_id="accept-and-add-activity-center")
self.notifications_select_all = Button(self.driver, xpath="(//android.widget.CheckBox["
"@content-desc='checkbox'])[1]")
"@content-desc='checkbox-off'])[1]")
# Options on long tap
self.chats_menu_invite_friends_button = Button(self.driver, accessibility_id="chats-menu-invite-friends-button")
@ -231,11 +231,11 @@ class HomeView(BaseView):
except TimeoutException:
break
def get_chat(self, username, community=False):
def get_chat(self, username, community=False,wait_time=30):
self.driver.info("Looking for chat: '%s'" % username)
chat_element = ChatElement(self.driver, username[:25], community=community)
if not chat_element.is_element_displayed():
self.notifications_unread_badge.wait_and_click(30)
self.notifications_unread_badge.wait_and_click(wait_time)
chat_in_ac = ActivityCenterChatElement(self.driver, username[:25])
chat_in_ac.wait_for_element(20)
chat_in_ac.click()

View File

@ -38,6 +38,7 @@ class KeycardView(BaseView):
def get_recovery_word(self, word_id):
word_element = SilentButton(self.driver, accessibility_id="word%s" % word_id)
word_element.wait_for_visibility_of_element()
return word_element.text
def get_required_word_number(self):

View File

@ -176,7 +176,7 @@ class SignInView(BaseView):
self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s')" % (password, str(keycard)),
device=False)
if not second_user:
self.accept_tos_checkbox.click()
self.accept_tos_checkbox.enable()
self.get_started_button.click_until_presence_of_element(self.generate_key_button)
self.generate_key_button.click()
@ -204,7 +204,7 @@ class SignInView(BaseView):
enable_notifications=False, second_user=False):
self.driver.info("## Recover access(password:%s, keycard:%s)" % (password, str(keycard)), device=False)
if not second_user:
self.accept_tos_checkbox.click()
self.accept_tos_checkbox.enable()
self.get_started_button.click_until_presence_of_element(self.access_key_button)
self.access_key_button.click()
self.enter_seed_phrase_button.click()

View File

@ -18,9 +18,9 @@ class AssetCheckBox(CheckBox):
def __init__(self, driver, asset_name):
super().__init__(driver, xpath="//*[@text='%s']" % asset_name)
def click(self):
def enable(self):
self.scroll_to_element(12)
super().click()
super().enable()
class BackupRecoveryPhrase(Button):
@ -102,8 +102,6 @@ class WalletView(BaseView):
self.manage_assets_button = Button(self.driver, accessibility_id="wallet-manage-assets")
self.manage_accounts_button = Button(self.driver, accessibility_id="wallet-manage-accounts")
self.scan_tokens_button = Button(self.driver, accessibility_id="wallet-scan-token")
self.stt_check_box = CheckBox(self.driver,
xpath="//*[@text='STT']/../android.view.ViewGroup[@content-desc='checkbox-off']")
self.all_assets_full_names = Text(self.driver,
xpath="//*[@content-desc='checkbox-off']/../android.widget.TextView[1]")
self.all_assets_symbols = Button(self.driver,
@ -270,7 +268,7 @@ class WalletView(BaseView):
self.multiaccount_more_options.click()
self.manage_assets_button.click()
for asset in args:
self.asset_checkbox_by_name(asset).click()
self.asset_checkbox_by_name(asset).enable()
self.cross_icon.click()
def scan_tokens(self, *args):