diff --git a/test/appium/tests/activity_center/test_activity_center.py b/test/appium/tests/activity_center/test_activity_center.py index 38fd909d6f..a7473932a2 100644 --- a/test/appium/tests/activity_center/test_activity_center.py +++ b/test/appium/tests/activity_center/test_activity_center.py @@ -18,6 +18,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user, {'enable_notifications': True, 'username': self.username_1}), (self.device_2.create_user, {'username': self.username_2})))) + self.device_2_users_number = 1 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.home_1.get_public_key() @@ -90,7 +91,8 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC 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.create_user(username=new_username, user_number=self.device_2_users_number) + self.device_2_users_number += 1 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) @@ -142,7 +144,8 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC self.home_2.profile_button.click() self.profile_2.logout() new_username_2 = "test user 123" - self.device_2.create_user(third_user=True, username=new_username_2) + self.device_2.create_user(username=new_username_2, user_number=self.device_2_users_number) + self.device_2_users_number += 1 self.device_2.just_fyi('Device2 sends a contact request to Device1 using his profile link') self.home_2.driver.set_clipboard_text("https://status.app/u#" + self.public_key_1) diff --git a/test/appium/tests/critical/chats/test_public_chat_browsing.py b/test/appium/tests/critical/chats/test_public_chat_browsing.py index d0880a1e92..43fe64ced0 100644 --- a/test/appium/tests/critical/chats/test_public_chat_browsing.py +++ b/test/appium/tests/critical/chats/test_public_chat_browsing.py @@ -1049,7 +1049,9 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase): def test_community_join_when_node_owner_offline(self): for home in self.homes: home.navigate_back_to_home_view() - self.home_2.jump_to_messages_home() + self.home_2.jump_to_communities_home() + if self.home_2.get_chat(self.community_name, community=True).is_element_displayed(): + CommunityView(self.home_2.driver).leave_community(self.community_name) self.home_1.jump_to_communities_home() self.home_1.just_fyi("Device 1 creates open community") @@ -1062,6 +1064,7 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase): self.device_1.driver.terminate_app(app_package) self.home_2.just_fyi("Device 2 requests to join the community") + self.home_2.jump_to_messages_home() self.home_2.get_chat(self.username_1).click() self.chat_2.chat_element_by_text(community_name).view_community_button.click() self.community_2.join_community(open_community=False) diff --git a/test/appium/views/chat_view.py b/test/appium/views/chat_view.py index a0e0bcd43f..6653cf2c24 100644 --- a/test/appium/views/chat_view.py +++ b/test/appium/views/chat_view.py @@ -448,11 +448,14 @@ class CommunityView(HomeView): self.get_chat(name).click() return chat_view - def leave_community(self): - self.driver.info("Leaving community") - self.community_options_button.wait_and_click() - self.community_info_button.wait_and_click() - self.leave_community_button.scroll_and_click() + def leave_community(self, community_name: str): + self.driver.info("Leaving %s" % community_name) + home = self.get_home_view() + home.communities_tab.click() + community_element = home.get_chat(community_name, community=True) + community_element.long_press_until_element_is_shown(self.leave_community_button) + self.leave_community_button.click() + self.leave_community_button.click() def get_channel_avatar(self, channel_name='general'): return Button(self.driver, xpath='//*[@text="# %s"]/../*[@content-desc="channel-avatar"]' % channel_name) @@ -502,7 +505,6 @@ class CommunityView(HomeView): home = self.get_home_view() home.communities_tab.click() community_element = home.get_chat(community_name, community=True) - # community_element.long_press_until_element_is_shown(self.view_members_button) community_element.long_press_until_element_is_shown(self.share_community_button) self.share_community_button.click() for user_name in user_names_to_share: diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index 036a848df6..cf1d36a63b 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -218,21 +218,21 @@ class SignInView(BaseView): if set_image: pass - def create_user(self, password=common_password, keycard=False, enable_notifications=False, second_user=False, - third_user=False, username="test user"): + def create_user(self, password=common_password, keycard=False, enable_notifications=False, + username="test user", user_number=0): self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s', enable_notification: '%s')" % (password, str(keycard), str(enable_notifications)), device=False) if self.element_by_text('CONTINUE').is_element_displayed(5): self.element_by_text('CONTINUE').click() - if second_user: + if user_number == 0: + self.i_m_new_in_status_button.click_until_presence_of_element(self.generate_keys_button) + elif user_number == 1: self.show_profiles_button.wait_and_click(20) self.plus_profiles_button.click() self.create_new_profile_button.click() - elif third_user: + else: 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) self.set_password(password)