e2e: new pub key (#16779)

Co-authored-by: Churikova Tetiana <tatiana@status.im>
This commit is contained in:
Yevheniia Berdnyk 2023-07-27 14:14:09 +03:00 committed by GitHub
parent 4f044765e1
commit ce08131c01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 95 additions and 42 deletions

View File

@ -2,7 +2,7 @@
name: MVPBug Report
about: MVPBug Report
title: ''
labels: E:MobileBugfixesMVP
labels: 'E:MobileBugfixesMVP'
assignees: ''
---

View File

@ -1401,10 +1401,9 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
chat.long_press_element()
if self.home_1.mute_chat_button.text != transl["unmute-chat"]:
self.errors.append("Chat is not muted")
# ToDo: enable the next check when https://github.com/status-im/status-mobile/issues/16768 is fixed
# expected_text = "%s %s" % (transl["muted-until"], transl["until-you-turn-it-back-on"])
# if not self.home_1.element_by_text(expected_text).is_element_displayed():
# self.errors.append("Text '%s' is not shown for muted chat" %expected_text)
expected_text = "Muted until you turn it back on"
if not self.home_1.element_by_text(expected_text).is_element_displayed():
self.errors.append("Text '%s' is not shown for muted chat" %expected_text)
self.home_1.mute_chat_button.click()
unmuted_message = "after unmute"

View File

@ -558,11 +558,10 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
chat.long_press_element()
if self.homes[1].mute_chat_button.text != transl["unmute-chat"]:
self.errors.append("Chat is not muted")
# ToDo: enable the next check when https://github.com/status-im/status-mobile/issues/16768 is fixed
# # expected_text = "Muted until %s today" % device_time + 1
# expected_text = "%s %s" % (transl["muted-until"], transl["until-you-turn-it-back-on"])
# if not self.homes[1].element_by_text(expected_text).is_element_displayed():
# self.errors.append("Text '%s' is not shown for muted chat" % expected_text)
# expected_text = "Muted until %s today" % device_time + 1
expected_text = "Muted until you turn it back on"
if not self.homes[1].element_by_text(expected_text).is_element_displayed():
self.errors.append("Text '%s' is not shown for muted chat" % expected_text)
self.chats[1].just_fyi("Member 1 unmutes the chat")
# self.chats[1].just_fyi("Close app and change device time so chat will be unmuted by timer")
# self.homes[1].put_app_to_background()

View File

@ -349,6 +349,22 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(702869)
def test_community_undo_delete_message(self):
if not self.channel.chat_message_input.is_element_displayed():
self.home.click_system_back_button_until_element_is_shown()
self.home.get_to_community_channel_from_home(self.community_name)
message_to_delete = "message to delete and undo"
self.channel.send_message(message_to_delete)
self.channel.delete_message_in_chat(message_to_delete)
self.channel.element_by_text("Undo").click()
try:
self.channel.chat_element_by_text(message_to_delete).wait_for_visibility_of_element()
except TimeoutException:
pytest.fail("Message was not restored by clicking 'Undo' button")
if self.channel.element_starts_with_text("Message deleted").is_element_displayed():
pytest.fail("Text about deleted message is shown in the chat")
@marks.testrail_id(703382)
def test_community_mute_community_and_channel(self):
self.home.jump_to_communities_home()
@ -386,7 +402,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
device_time = self.home.driver.device_time
current_time = datetime.datetime.strptime(device_time, "%Y-%m-%dT%H:%M:%S%z")
expected_time = current_time + datetime.timedelta(days=7)
expected_text = "Muted until %s" % expected_time.strftime('%H:%M %a %d %b')
expected_text = "Muted until %s" % expected_time.strftime('%H:%M %a %-d %b')
self.community_view.get_channel(self.channel_name).long_press_element()
if not self.home.element_by_text(expected_text).is_element_displayed():
self.errors.append("Text '%s' is not shown for a muted community channel" % expected_text)
@ -402,21 +418,17 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(703133)
@marks.xfail(reason="Restoring communities issue: 16787; "
"restoring contacts issue: 15500",
run=False)
def test_restore_multiaccount_with_waku_backup_remove_switch(self):
self.home.jump_to_communities_home()
profile = self.home.profile_button.click()
profile.logout()
self.home.just_fyi("Restore user with predefined communities and contacts")
self.sign_in.recover_access(passphrase=waku_user.seed, second_user=True)
self.home.just_fyi("Restore user with predefined communities, check communities")
self.home.communities_tab.click()
for key in ['admin_open', 'member_open', 'admin_closed', 'member_closed']:
if not self.home.element_by_text(waku_user.communities[key]).is_element_displayed(30):
self.errors.append("%s was not restored from waku-backup!!" % key)
# TODO: there is a bug when pending community sometimes restored as joined; needs investigation
# self.home.opened_communities_tab.click()
# if not self.home.element_by_text(waku_user.communities['member_pending']).is_element_displayed(30):
# self.errors.append("Pending community %s was not restored from waku-backup!" % waku_user.communities['member_pending'])
self.home.just_fyi("Restore user with predefined communities and contacts")
self.home.just_fyi("Check contacts/blocked users")
self.home.chats_tab.click()
@ -433,23 +445,33 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
if shown_name_text in waku_user.contacts:
waku_user.contacts.remove(shown_name_text)
continue
else:
contact_row.click()
shown_name_text = profile.default_username_text.text
if shown_name_text in waku_user.contacts:
waku_user.contacts.remove(shown_name_text)
continue
else:
chat = self.home.get_chat_view()
chat.profile_send_message_button.click()
for name in waku_user.contacts:
if chat.element_starts_with_text(name).is_element_displayed(sec=20):
waku_user.contacts.remove(name)
continue
# else:
# contact_row.click()
# shown_name_text = profile.default_username_text.text
# if shown_name_text in waku_user.contacts:
# waku_user.contacts.remove(shown_name_text)
# continue
# else:
# chat = self.home.get_chat_view()
# chat.profile_send_message_button.click()
# for name in waku_user.contacts:
# if chat.element_starts_with_text(name).is_element_displayed(sec=20):
# waku_user.contacts.remove(name)
# continue
if waku_user.contacts:
self.errors.append(
"Contact(s) was (were) not restored from backup: %s!" % ", ".join(waku_user.contacts))
self.home.just_fyi("Check restored communities")
self.home.communities_tab.click()
for key in ['admin_open', 'member_open', 'admin_closed', 'member_closed']:
if not self.home.element_by_text(waku_user.communities[key]).is_element_displayed(30):
self.errors.append("%s was not restored from waku-backup!!" % key)
# TODO: there is a bug when pending community sometimes restored as joined; needs investigation
# self.home.opened_communities_tab.click()
# if not self.home.element_by_text(waku_user.communities['member_pending']).is_element_displayed(30):
# self.errors.append("Pending community %s was not restored from waku-backup!" % waku_user.communities['member_pending'])
if not pytest_config_global['pr_number']:
self.home.just_fyi("Perform back up")
self.home.click_system_back_button_until_element_is_shown()
@ -498,7 +520,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
'username': self.username_1}),
(self.device_2.create_user, {'username': self.username_2}))))
self.homes = self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
self.public_key_2 = self.home_2.get_public_key()
self.public_key_2 = self.home_2.get_public_key_via_share_profile_tab()
self.profile_1 = self.home_1.get_profile_view()
[home.click_system_back_button_until_element_is_shown() for home in self.homes]
[home.chats_tab.click() for home in self.homes]

View File

@ -19,7 +19,8 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
(self.device_2.create_user, {'username': self.username_2}))))
self.homes = self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
self.profile_1, self.profile_2 = self.home_1.get_profile_view(), self.home_2.get_profile_view()
self.public_key_1, self.public_key_2 = (home.get_public_key() for home in self.homes)
self.public_key_1 = self.home_1.get_public_key()
self.public_key_2 = self.home_2.get_public_key_via_share_profile_tab()
[home.click_system_back_button_until_element_is_shown() for home in self.homes]
[home.chats_tab.click() for home in self.homes]
@ -78,9 +79,22 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
@marks.testrail_id(702851)
def test_activity_center_contact_request_accept_swipe_mark_all_as_read(self):
self.device_2.just_fyi('Device2 re-sends a contact request to Device1')
self.device_2.just_fyi('Creating a new user on Device2')
self.home_2.jump_to_messages_home()
self.home_2.add_contact(self.public_key_1, remove_from_contacts=True)
self.home_2.profile_button.click()
self.profile_2.logout()
new_username = "new user"
self.device_2.create_user(second_user=True, username=new_username)
self.device_2.just_fyi('Device2 sends a contact request to Device1 via Paste button and check user details')
self.home_2.driver.set_clipboard_text(self.public_key_1)
self.home_2.new_chat_button.click_until_presence_of_element(self.home_2.add_a_contact_chat_bottom_sheet_button)
self.home_2.add_a_contact_chat_bottom_sheet_button.click()
self.home_2.element_by_translation_id("paste").click()
self.home_2.element_by_translation_id("user-found").wait_for_visibility_of_element(10)
chat = self.home_2.get_chat_view()
chat.view_profile_new_contact_button.click_until_presence_of_element(chat.profile_block_contact_button)
chat.profile_add_to_contacts_button.click()
self.device_1.just_fyi('Device1 accepts pending contact request by swiping')
self.home_1.chats_tab.click()
@ -88,7 +102,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
self.home_1.open_activity_center_button.click()
self.home_1.just_fyi("Mark all as read")
cr_element = self.home_1.get_element_from_activity_center_view(self.username_2)
cr_element = self.home_1.get_element_from_activity_center_view(new_username)
self.home_1.more_options_activity_button.click()
self.home_1.mark_all_read_activity_button.click()
if cr_element.is_element_displayed():
@ -100,7 +114,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
self.home_1.activity_notification_swipe_button.click_inside_element_by_coordinate(rel_x=0.5, rel_y=0.5)
self.home_1.close_activity_centre.click()
self.home_1.contacts_tab.click()
if not self.home_1.contact_details_row(username=self.username_2).is_element_displayed(20):
if not self.home_1.contact_details_row(username=new_username).is_element_displayed(20):
self.errors.append("Contact was not added to contact list after accepting contact request (as receiver)")
self.device_2.just_fyi('Device1 check that contact appeared in contact list mutually')

View File

@ -7,5 +7,6 @@ communities = {
'member_closed': 'test_comm_enc',
'member_pending': 'RC1 testing community'
}
contacts = ['Test_contact', 'MyCustomNickname']
blocked_user = 'Clear Flat Milkweedbug'
# contacts = ['Test_contact', 'MyCustomNickname'] # enable back when https://github.com/status-im/status-mobile/issues/15500 is fixed
contacts = ['Used Bulky Wirehair', 'Vengeful Healthy Arcticseal']
blocked_user = 'Clear Flat Milkweedbug'

View File

@ -240,6 +240,7 @@ class HomeView(BaseView):
# Notification centre
self.notifications_button = Button(self.driver, accessibility_id="notifications-button")
self.notifications_unread_badge = BaseElement(self.driver, accessibility_id="activity-center-unread-count")
self.show_qr_code_button = Button(self.driver, accessibility_id="show-qr-button")
self.open_activity_center_button = Button(self.driver, accessibility_id="open-activity-center-button")
self.close_activity_centre = Button(self.driver, accessibility_id="close-activity-center")
@ -313,6 +314,11 @@ class HomeView(BaseView):
self.more_options_activity_button = Button(self.driver, accessibility_id="activity-center-open-more")
self.mark_all_read_activity_button = Button(self.driver, translation_id="mark-all-notifications-as-read")
# Share tab
self.link_to_profile_text = Text(
self.driver,
xpath="(//*[@content-desc='link-to-profile']/preceding-sibling::*[1]/android.widget.TextView)[1]")
def wait_for_syncing_complete(self):
self.driver.info('Waiting for syncing to complete')
while True:
@ -518,3 +524,11 @@ class HomeView(BaseView):
def get_contact_rows_count(self):
return len(ContactDetailsRow(self.driver).find_elements())
def get_public_key_via_share_profile_tab(self):
self.driver.info("Getting public key via Share tab")
self.show_qr_code_button.click()
self.link_to_profile_text.click()
c_text = self.driver.get_clipboard_text()
self.click_system_back_button()
return c_text.split("/")[-1]

View File

@ -224,7 +224,11 @@ class SignInView(BaseView):
username="test user"):
self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s', enable_notification: '%s')" %
(password, str(keycard), str(enable_notifications)), device=False)
if not second_user:
if second_user:
self.show_profiles_button.wait_and_click(20)
self.plus_profiles_button.click()
self.create_new_profile_button.click()
else:
self.i_m_new_in_status_button.click_until_presence_of_element(self.generate_keys_button)
self.generate_keys_button.click_until_presence_of_element(self.profile_your_name_edit_box)
self.set_profile(username)