e2e: fix for creating a new user

This commit is contained in:
Yevheniia Berdnyk 2023-11-06 14:12:04 +02:00
parent cb005afff2
commit 422004f146
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
2 changed files with 6 additions and 11 deletions

View File

@ -18,7 +18,6 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user, {'enable_notifications': True, self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user, {'enable_notifications': True,
'username': self.username_1}), 'username': self.username_1}),
(self.device_2.create_user, {'username': self.username_2})))) (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.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.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() self.public_key_1 = self.home_1.get_public_key()
@ -91,8 +90,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
self.home_2.profile_button.click() self.home_2.profile_button.click()
self.profile_2.logout() self.profile_2.logout()
new_username = "new user" new_username = "new user"
self.device_2.create_user(username=new_username, user_number=self.device_2_users_number) self.device_2.create_user(username=new_username, first_user=False)
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.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.driver.set_clipboard_text(self.public_key_1)
@ -144,8 +142,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
self.home_2.profile_button.click() self.home_2.profile_button.click()
self.profile_2.logout() self.profile_2.logout()
new_username_2 = "test user 123" 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.create_user(username=new_username_2, first_user=False)
self.device_2_users_number += 1
self.device_2.just_fyi('Device2 sends a contact request to Device1 using his profile link') 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) self.home_2.driver.set_clipboard_text("https://status.app/u#" + self.public_key_1)

View File

@ -219,18 +219,16 @@ class SignInView(BaseView):
pass pass
def create_user(self, password=common_password, keycard=False, enable_notifications=False, 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')" % self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s', enable_notification: '%s')" %
(password, str(keycard), str(enable_notifications)), device=False) (password, str(keycard), str(enable_notifications)), device=False)
if self.element_by_text('CONTINUE').is_element_displayed(5): if self.element_by_text('CONTINUE').is_element_displayed(5):
self.element_by_text('CONTINUE').click() 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) 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: else:
if self.show_profiles_button.is_element_displayed(20):
self.show_profiles_button.click()
self.plus_profiles_button.click() self.plus_profiles_button.click()
self.create_new_profile_button.click() self.create_new_profile_button.click()
self.generate_keys_button.click_until_presence_of_element(self.profile_your_name_edit_box) self.generate_keys_button.click_until_presence_of_element(self.profile_your_name_edit_box)