e2e: medium pairing
This commit is contained in:
parent
b83fe64b0f
commit
1354f5a1f4
|
@ -127,6 +127,7 @@ class TestrailReport(BaseTestReport):
|
|||
test_cases['nightly']['share_profile'] = 50837
|
||||
test_cases['nightly']['chat_2'] = 50838
|
||||
test_cases['nightly']['group_chat'] = 50839
|
||||
test_cases['nightly']['pairing'] = 50840
|
||||
## Upgrade e2e
|
||||
test_cases['upgrade']['general'] = 881
|
||||
|
||||
|
|
|
@ -1205,197 +1205,6 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
|
|||
self.errors.append('History was not fetched after enabling use_history_node')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(695856)
|
||||
# TODO: can be included to TestPairingMultipleDevicesMerged after #13257
|
||||
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])
|
||||
home_1 = device_1.create_user()
|
||||
profile_1 = home_1.profile_button.click()
|
||||
profile_1.privacy_and_security_button.click()
|
||||
profile_1.backup_recovery_phrase_button.click()
|
||||
recovery_phrase = profile_1.backup_recovery_phrase()
|
||||
profile_1.home_button.double_click()
|
||||
name_1, name_2 = 'device_%s' % device_1.driver.number, 'device_%s' % device_2.driver.number
|
||||
comm_before_sync_name, channel, message = 'b-%s' % home_1.get_random_chat_name(), 'some-rand-chann', 'comm_message'
|
||||
comm_joined_name = 'Status'
|
||||
comm_after_sync_name = 'a-public-%s' % home_1.get_random_chat_name()
|
||||
group_chat_name = 'group-%s' % home_1.get_random_chat_name()
|
||||
channel_after_sync, message_after_sync = 'chann-after-sync', 'sent after sync'
|
||||
|
||||
device_1.just_fyi('join Status community, create community, create group chat, edit user picture')
|
||||
# Follow Status community
|
||||
# TODO: no predefined community to follow now
|
||||
# home_1.element_by_text(comm_joined_name).scroll_and_click()
|
||||
# from views.chat_view import CommunityView
|
||||
# comm_to_join_1 = CommunityView(self.drivers[0])
|
||||
# comm_to_join_1.follow_button.wait_and_click()
|
||||
# comm_to_join_1.home_button.double_click()
|
||||
# Create community as admin, add channel, send message
|
||||
comm_before_1 = home_1.create_community(comm_before_sync_name)
|
||||
channel_before_1 = comm_before_1.add_channel(channel)
|
||||
channel_before_1.send_message(message)
|
||||
home_1.home_button.double_click()
|
||||
# Starting group chat
|
||||
one_to_one_1 = home_1.add_contact(basic_user['public_key'])
|
||||
one_to_one_1.home_button.click()
|
||||
group_chat_1 = home_1.create_group_chat([basic_user['username']], group_chat_name)
|
||||
group_chat_1.home_button.click()
|
||||
# Editing profile picture
|
||||
home_1.profile_button.double_click()
|
||||
profile_1.edit_profile_picture('sauce_logo.png')
|
||||
|
||||
device_2.just_fyi('go to profile > Devices, set device name, discover device 2 to device 1')
|
||||
home_2 = device_2.recover_access(passphrase=' '.join(recovery_phrase.values()))
|
||||
profile_2 = home_2.profile_button.click()
|
||||
|
||||
device_2.just_fyi('Pair main and secondary devices')
|
||||
profile_2.discover_and_advertise_device(name_2)
|
||||
profile_1.discover_and_advertise_device(name_1)
|
||||
profile_1.get_toggle_device_by_name(name_2).wait_and_click()
|
||||
profile_1.sync_all_button.click()
|
||||
profile_1.sync_all_button.wait_for_visibility_of_element(15)
|
||||
[device.profile_button.double_click() for device in (profile_1, profile_2)]
|
||||
|
||||
device_2.just_fyi('check that created/joined community and profile details are updated')
|
||||
home_2 = profile_2.home_button.click()
|
||||
# TODO: no predefined community to follow
|
||||
# for community in (comm_before_sync_name, comm_joined_name):
|
||||
if not home_2.get_chat(comm_before_sync_name, community=True).is_element_displayed():
|
||||
self.errors.append('Community %s was not appeared after initial sync' % comm_before_sync_name)
|
||||
comm_before_2 = home_2.get_chat(comm_before_sync_name, community=True).click()
|
||||
channel_2 = comm_before_2.get_chat(channel).click()
|
||||
if not channel_2.chat_element_by_text(message).is_element_displayed(30):
|
||||
self.errors.append("Message sent to community channel before sync is not shown!")
|
||||
|
||||
device_1.just_fyi("Send message, add new channel and check it will be synced")
|
||||
home_1.home_button.click()
|
||||
home_1.get_chat(comm_before_sync_name, community=True).click()
|
||||
channel_1 = comm_before_1.get_chat(channel).click()
|
||||
channel_1.send_message(message_after_sync)
|
||||
if not channel_2.chat_element_by_text(message_after_sync).is_element_displayed(30):
|
||||
self.errors.append("Message sent to community channel after sync is not shown!")
|
||||
[channel.back_button.click() for channel in (channel_1, channel_2)]
|
||||
[home.get_chat(comm_before_sync_name, community=True).click() for home in (home_1, home_2)]
|
||||
comm_before_1.add_channel(channel_after_sync)
|
||||
if not comm_before_2.get_chat(channel_after_sync).is_element_displayed(30):
|
||||
self.errors.append("New added channel after sync is not shown!")
|
||||
|
||||
device_1.just_fyi("Leave community and check it will be synced")
|
||||
[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.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.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)
|
||||
# home_2.profile_button.click()
|
||||
# if not profile_2.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
|
||||
# self.errors.append('Profile picture was not updated after initial sync')
|
||||
# profile_2.home_button.click()
|
||||
#
|
||||
device_1.just_fyi('send message to group chat, check that message in group chat is shown')
|
||||
home_1 = profile_1.home_button.click()
|
||||
home_1.get_chat(group_chat_name).click()
|
||||
group_chat_1.send_message(message_after_sync)
|
||||
group_chat_1.back_button.click()
|
||||
group_chat_2 = home_2.get_chat(group_chat_name).click()
|
||||
if not group_chat_2.chat_element_by_text(message_after_sync).is_element_displayed():
|
||||
self.errors.append('"%s" message in group chat is not synced' % message_after_sync)
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6317)
|
||||
# TODO: can be included to TestPairingMultipleDevicesMerged after #13257
|
||||
def test_pair_devices_group_chat_different_messages_nicknames(self):
|
||||
self.create_drivers(3)
|
||||
device_1, device_2, device_3 = SignInView(self.drivers[0]), SignInView(self.drivers[1]), SignInView(
|
||||
self.drivers[2])
|
||||
home_1 = device_1.create_user()
|
||||
profile_1 = home_1.profile_button.click()
|
||||
profile_1.privacy_and_security_button.click()
|
||||
profile_1.backup_recovery_phrase_button.click()
|
||||
profile_1.ok_continue_button.click()
|
||||
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()))
|
||||
|
||||
device_1.just_fyi('Add contact, start group chat')
|
||||
nickname = 'my_tester'
|
||||
home_1.add_contact(public_key_3, nickname=nickname)
|
||||
home_1.get_back_to_home_view()
|
||||
chat_1 = home_1.create_group_chat([username_3], group_chat_name)
|
||||
chat_3 = home_3.get_chat(group_chat_name).click()
|
||||
chat_3.join_chat_button.click()
|
||||
|
||||
device_2.just_fyi('Go to profile > Devices, set device name, discover device 2 to device 1')
|
||||
profile_2 = home_2.profile_button.click()
|
||||
profile_2.discover_and_advertise_device(device_2_name)
|
||||
device_1.profile_button.click()
|
||||
profile_1.discover_and_advertise_device(device_1_name)
|
||||
profile_1.get_toggle_device_by_name(device_2_name).click()
|
||||
profile_1.sync_all_button.click()
|
||||
profile_1.sync_all_button.wait_for_visibility_of_element(15)
|
||||
profile_1.click_system_back_button(2)
|
||||
|
||||
device_1.just_fyi('Send message to group chat and verify it on all devices')
|
||||
text_message = 'some text'
|
||||
profile_1.home_button.click(desired_view='chat')
|
||||
profile_2.home_button.click()
|
||||
chat_1.send_message(text_message)
|
||||
chat_2 = home_2.get_chat(group_chat_name).click()
|
||||
for chat in chat_1, chat_2, chat_3:
|
||||
if not chat.chat_element_by_text(text_message).is_element_displayed():
|
||||
self.errors.append('Message was sent, but it is not shown')
|
||||
|
||||
device_3.just_fyi('Send message to group chat as member and verify nickname on it')
|
||||
message_from_member = 'member1'
|
||||
chat_3.send_message(message_from_member)
|
||||
chat_1.chat_element_by_text(message_from_member).wait_for_visibility_of_element(20)
|
||||
for chat in chat_1, chat_2:
|
||||
if not chat.chat_element_by_text(message_from_member).username != '%s %s' % (nickname, username_3):
|
||||
self.errors.append('Nickname is not shown in group chat')
|
||||
|
||||
device_1.just_fyi('Send image to group chat and verify it on all devices')
|
||||
chat_1.show_images_button.click()
|
||||
chat_1.allow_button.click()
|
||||
chat_1.first_image_from_gallery.click()
|
||||
chat_1.send_message_button.click()
|
||||
chat_1.chat_message_input.click()
|
||||
for chat in chat_1, chat_2, chat_3:
|
||||
if not chat.image_message_in_chat.is_element_displayed(60):
|
||||
self.errors.append('Image is not shown in chat after sending for %s' % chat.driver.number)
|
||||
|
||||
device_1.just_fyi('Send audio message to group chat and verify it on all devices')
|
||||
chat_1.record_audio_message(message_length_in_seconds=3)
|
||||
device_1.send_message_button.click()
|
||||
chat_1.chat_message_input.click()
|
||||
for chat in chat_1, chat_2, chat_3:
|
||||
if not chat.play_pause_audio_message_button.is_element_displayed(30):
|
||||
self.errors.append('Audio message is not shown in chat after sending!')
|
||||
|
||||
device_1.just_fyi('Send sticker to group chat and verify it on all devices')
|
||||
chat_1.profile_button.click()
|
||||
profile_1.switch_network()
|
||||
home_1.get_chat(group_chat_name).click()
|
||||
chat_1.install_sticker_pack_by_name()
|
||||
chat_1.sticker_icon.click()
|
||||
if not chat_1.sticker_message.is_element_displayed(30):
|
||||
self.errors.append('Sticker was not sent')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6330)
|
||||
# TODO: can be re-done to 1-driver test (sending between different account)
|
||||
def test_wallet_can_send_tx_all_tokens_via_max_option(self):
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
import pytest
|
||||
from tests import marks
|
||||
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
|
||||
from views.sign_in_view import SignInView
|
||||
|
||||
|
||||
@pytest.mark.xdist_group(name="one_3")
|
||||
@marks.medium
|
||||
class TestPairingSyncMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
|
||||
|
||||
@classmethod
|
||||
def setup_class(cls):
|
||||
cls.drivers, cls.loop = create_shared_drivers(3)
|
||||
cls.device_1, cls.device_2, cls.device_3 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]), SignInView(cls.drivers[2])
|
||||
cls.home_1 = cls.device_1.create_user()
|
||||
|
||||
cls.profile_1 = cls.home_1.profile_button.click()
|
||||
cls.profile_1.privacy_and_security_button.click()
|
||||
cls.profile_1.backup_recovery_phrase_button.click()
|
||||
cls.profile_1.ok_continue_button.click()
|
||||
cls.recovery_phrase = cls.profile_1.get_recovery_phrase()
|
||||
cls.profile_1.close_button.click()
|
||||
cls.profile_1.home_button.click()
|
||||
cls.device_2.put_app_to_background_and_back()
|
||||
cls.home_3 = cls.device_3.create_user()
|
||||
cls.public_key_3, cls.username_3 = cls.home_3.get_public_key_and_username(return_username=True)
|
||||
cls.device_3.home_button.click()
|
||||
cls.device_1.put_app_to_background_and_back()
|
||||
cls.comm_before_sync_name, cls.channel, cls.message = 'b-%s' % cls.home_1.get_random_chat_name(), 'some-rand-chann', 'comm_message'
|
||||
cls.device_1_name, cls.device_2_name, cls.group_chat_name = 'creator', 'paired', 'some group chat'
|
||||
cls.comm_after_sync_name = 'a-public-%s' % cls.home_1.get_random_chat_name()
|
||||
cls.channel_after_sync, cls.message_after_sync = 'chann-after-sync', 'sent after sync'
|
||||
|
||||
cls.device_1.just_fyi('Create community, create group chat, edit user picture')
|
||||
cls.comm_before_1 = cls.home_1.create_community(cls.comm_before_sync_name)
|
||||
cls.channel_before_1 = cls.comm_before_1.add_channel(cls.channel)
|
||||
cls.channel_before_1.send_message(cls.message)
|
||||
cls.home_1.home_button.double_click()
|
||||
|
||||
cls.device_1.just_fyi('Edit profile picture')
|
||||
cls.home_1.profile_button.double_click()
|
||||
cls.profile_1.edit_profile_picture('sauce_logo.png')
|
||||
|
||||
cls.device_1.just_fyi('Add contact, start group chat')
|
||||
cls.home_1.home_button.click()
|
||||
cls.home_1.add_contact(cls.public_key_3)
|
||||
cls.device_2.put_app_to_background_and_back()
|
||||
cls.home_1.get_back_to_home_view()
|
||||
cls.chat_1 = cls.home_1.create_group_chat([cls.username_3], cls.group_chat_name)
|
||||
cls.chat_3 = cls.home_3.get_chat(cls.group_chat_name).click()
|
||||
cls.chat_3.join_chat_button.click()
|
||||
|
||||
cls.device_2.just_fyi("(secondary device): restore same multiaccount on another device")
|
||||
cls.home_2 = cls.device_2.recover_access(passphrase=' '.join(cls.recovery_phrase.values()))
|
||||
cls.profile_1, cls.profile_2 = cls.home_1.profile_button.click(), cls.home_2.profile_button.click()
|
||||
cls.device_1.put_app_to_background_and_back()
|
||||
|
||||
cls.device_2.just_fyi('Pair main and secondary devices')
|
||||
cls.name_1, cls.name_2 = 'device_%s' % cls.device_1.driver.number, 'device_%s' % cls.device_2.driver.number
|
||||
cls.profile_2.discover_and_advertise_device(cls.name_2)
|
||||
cls.profile_1.discover_and_advertise_device(cls.name_1)
|
||||
cls.profile_1.get_toggle_device_by_name(cls.name_2).wait_and_click()
|
||||
cls.profile_1.sync_all_button.click()
|
||||
cls.profile_1.sync_all_button.wait_for_visibility_of_element(20)
|
||||
[device.profile_button.double_click() for device in (cls.profile_1, cls.profile_2)]
|
||||
[device.home_button.double_click() for device in (cls.profile_1, cls.profile_2, cls.device_3)]
|
||||
|
||||
@marks.testrail_id(702269)
|
||||
def test_pairing_sync_initial_community_send_message(self):
|
||||
# Pricture sync is not implemented yet
|
||||
self.device_2.just_fyi('check that created/joined community and profile details are updated')
|
||||
if not self.home_2.get_chat(self.comm_before_sync_name, community=True).is_element_displayed():
|
||||
self.errors.append('Community %s was not appeared after initial sync' % self.comm_before_sync_name)
|
||||
comm_before_2 = self.home_2.get_chat(self.comm_before_sync_name, community=True).click()
|
||||
channel_2 = comm_before_2.get_chat(self.channel).click()
|
||||
if not channel_2.chat_element_by_text(self.message).is_element_displayed(30):
|
||||
self.errors.append("Message sent to community channel before sync is not shown!")
|
||||
self.home_1.home_button.click()
|
||||
self.home_1.get_chat(self.comm_before_sync_name, community=True).click()
|
||||
channel_1 = self.comm_before_1.get_chat(self.channel).click()
|
||||
channel_1.send_message(self.message_after_sync)
|
||||
if not channel_2.chat_element_by_text(self.message_after_sync).is_element_displayed(30):
|
||||
self.errors.append("Message sent to community channel after sync is not shown!")
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702270)
|
||||
def test_pairing_sync_community_add_new_channel(self):
|
||||
self.device_1.just_fyi("Send message, add new channel and check it will be synced")
|
||||
self.device_3.put_app_to_background_and_back()
|
||||
[home.home_button.double_click() for home in (self.home_1, self.home_2)]
|
||||
[home.get_chat(self.comm_before_sync_name, community=True).click() for home in (self.home_1, self.home_2)]
|
||||
self.comm_before_1.add_channel(self.channel_after_sync)
|
||||
if not self.home_2.get_chat(self.channel_after_sync).is_element_displayed(30):
|
||||
self.errors.append("New added channel after sync is not shown!")
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702271)
|
||||
def test_pairing_sync_community_leave(self):
|
||||
self.device_3.put_app_to_background_and_back()
|
||||
[home.home_button.double_click() for home in (self.home_1, self.home_2)]
|
||||
self.device_1.just_fyi("Leave community and check it will be synced")
|
||||
[home.home_button.double_click() for home in (self.home_1, self.home_2)]
|
||||
self.home_1.get_chat(self.comm_before_sync_name, community=True).click()
|
||||
self.comm_before_1.leave_community()
|
||||
if not self.home_2.element_by_text_part(self.comm_before_sync_name).is_element_disappeared(30):
|
||||
self.errors.append("Leaving community was not synced!")
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(702272)
|
||||
def test_pairing_sync_community_add_new(self):
|
||||
self.device_3.put_app_to_background_and_back()
|
||||
[home.home_button.double_click() for home in (self.home_1, self.home_2)]
|
||||
self.home_1.create_community(self.comm_after_sync_name)
|
||||
if not self.home_2.element_by_text(self.comm_after_sync_name).is_element_displayed(30):
|
||||
self.errors.append('Added community was not appeared after initial sync')
|
||||
self.errors.append("Leaving community was not synced!")
|
||||
|
||||
@marks.testrail_id(702273)
|
||||
def test_pairing_sync_group_chat_send_different_messages(self):
|
||||
[home.home_button.double_click() for home in (self.home_1, self.home_2)]
|
||||
self.device_1.just_fyi('Send message to group chat and verify it on all devices')
|
||||
text_message = 'some text'
|
||||
[home.get_chat(self.group_chat_name).click() for home in (self.home_1, self.home_3)]
|
||||
self.chat_1.send_message(text_message)
|
||||
self.chat_2 = self.home_2.get_chat(self.group_chat_name).click()
|
||||
for chat in (self.chat_1, self.chat_2, self.chat_3):
|
||||
if not chat.chat_element_by_text(text_message).is_element_displayed():
|
||||
self.errors.append('Message was sent, but it is not shown')
|
||||
|
||||
self.device_3.just_fyi('Send message to group chat as member')
|
||||
message_from_member = 'member1'
|
||||
self.chat_3.send_message(message_from_member)
|
||||
self.chat_1.chat_element_by_text(message_from_member).wait_for_visibility_of_element(20)
|
||||
for chat in (self.chat_1, self.chat_2):
|
||||
if not chat.chat_element_by_text(message_from_member).is_element_displayed():
|
||||
self.errors.append('No message from member')
|
||||
|
||||
self.device_1.just_fyi('Send image to group chat and verify it on all devices')
|
||||
self.chat_1.show_images_button.click()
|
||||
self.chat_1.allow_button.click()
|
||||
self.chat_1.first_image_from_gallery.click()
|
||||
self.chat_1.send_message_button.click()
|
||||
self.chat_1.chat_message_input.click()
|
||||
for chat in (self.chat_1, self.chat_2, self.chat_3):
|
||||
if not chat.image_message_in_chat.is_element_displayed(60):
|
||||
self.errors.append('Image is not shown in chat after sending for %s' % chat.driver.number)
|
||||
|
||||
self.device_1.just_fyi('Send audio message to group chat and verify it on all devices')
|
||||
self.chat_1.record_audio_message(message_length_in_seconds=3)
|
||||
self.device_1.send_message_button.click()
|
||||
self.chat_1.chat_message_input.click()
|
||||
for chat in(self.chat_1, self.chat_2, self.chat_3):
|
||||
if not chat.play_pause_audio_message_button.is_element_displayed(30):
|
||||
self.errors.append('Audio message is not shown in chat after sending!')
|
||||
self.errors.verify_no_errors()
|
|
@ -17,19 +17,6 @@ from views.sign_in_view import SignInView
|
|||
@marks.medium
|
||||
class TestChatManagement(SingleDeviceTestCase):
|
||||
|
||||
@marks.testrail_id(6221)
|
||||
# TODO: delete? a lot of tests are already using this
|
||||
def test_app_on_background_by_back_button(self):
|
||||
sign_in = SignInView(self.driver)
|
||||
home = sign_in.create_user()
|
||||
home.click_system_back_button()
|
||||
home.driver.press_keycode(187)
|
||||
if self.driver.current_activity != '.NexusLauncherActivity':
|
||||
self.driver.fail('App is not in background! Current activity is: %s' % self.driver.current_activity)
|
||||
home.status_in_background_button.click()
|
||||
if not home.plus_button.is_element_displayed():
|
||||
self.driver.fail('Chats view was not opened')
|
||||
|
||||
@marks.testrail_id(6213)
|
||||
# TODO: check main e2e about block; may be it makes sense to add additional check to it and remove this e2e at all
|
||||
def test_contacts_unblock_user_is_not_added_back_to_contacts(self):
|
||||
|
|
Loading…
Reference in New Issue