From 422004f1468ebf2886ba548e81592f8fe4cabd7a Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Mon, 6 Nov 2023 14:12:04 +0200 Subject: [PATCH] e2e: fix for creating a new user --- .../tests/activity_center/test_activity_center.py | 7 ++----- test/appium/views/sign_in_view.py | 10 ++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/test/appium/tests/activity_center/test_activity_center.py b/test/appium/tests/activity_center/test_activity_center.py index a7473932a2..28ab66043a 100644 --- a/test/appium/tests/activity_center/test_activity_center.py +++ b/test/appium/tests/activity_center/test_activity_center.py @@ -18,7 +18,6 @@ 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() @@ -91,8 +90,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC self.home_2.profile_button.click() self.profile_2.logout() new_username = "new user" - self.device_2.create_user(username=new_username, user_number=self.device_2_users_number) - self.device_2_users_number += 1 + self.device_2.create_user(username=new_username, first_user=False) 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) @@ -144,8 +142,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC self.home_2.profile_button.click() self.profile_2.logout() new_username_2 = "test user 123" - 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.create_user(username=new_username_2, first_user=False) 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/views/sign_in_view.py b/test/appium/views/sign_in_view.py index cf1d36a63b..2a55afc147 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -219,18 +219,16 @@ class SignInView(BaseView): pass def create_user(self, password=common_password, keycard=False, enable_notifications=False, - username="test user", user_number=0): + username="test user", first_user=True): 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 user_number == 0: + if first_user: 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() else: + if self.show_profiles_button.is_element_displayed(20): + self.show_profiles_button.click() self.plus_profiles_button.click() self.create_new_profile_button.click() self.generate_keys_button.click_until_presence_of_element(self.profile_your_name_edit_box)