Skip to content

Commit 422004f

Browse files
committed
e2e: fix for creating a new user
1 parent cb005af commit 422004f

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Diff for: test/appium/tests/activity_center/test_activity_center.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def prepare_devices(self):
1818
self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user, {'enable_notifications': True,
1919
'username': self.username_1}),
2020
(self.device_2.create_user, {'username': self.username_2}))))
21-
self.device_2_users_number = 1
2221
self.homes = self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
2322
self.profile_1, self.profile_2 = self.home_1.get_profile_view(), self.home_2.get_profile_view()
2423
self.public_key_1 = self.home_1.get_public_key()
@@ -91,8 +90,7 @@ def test_activity_center_contact_request_accept_swipe_mark_all_as_read(self):
9190
self.home_2.profile_button.click()
9291
self.profile_2.logout()
9392
new_username = "new user"
94-
self.device_2.create_user(username=new_username, user_number=self.device_2_users_number)
95-
self.device_2_users_number += 1
93+
self.device_2.create_user(username=new_username, first_user=False)
9694

9795
self.device_2.just_fyi('Device2 sends a contact request to Device1 via Paste button and check user details')
9896
self.home_2.driver.set_clipboard_text(self.public_key_1)
@@ -144,8 +142,7 @@ def test_add_contact_field_validation(self):
144142
self.home_2.profile_button.click()
145143
self.profile_2.logout()
146144
new_username_2 = "test user 123"
147-
self.device_2.create_user(username=new_username_2, user_number=self.device_2_users_number)
148-
self.device_2_users_number += 1
145+
self.device_2.create_user(username=new_username_2, first_user=False)
149146

150147
self.device_2.just_fyi('Device2 sends a contact request to Device1 using his profile link')
151148
self.home_2.driver.set_clipboard_text("https://status.app/u#" + self.public_key_1)

Diff for: test/appium/views/sign_in_view.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,16 @@ def set_profile(self, username: str, set_image=False):
219219
pass
220220

221221
def create_user(self, password=common_password, keycard=False, enable_notifications=False,
222-
username="test user", user_number=0):
222+
username="test user", first_user=True):
223223
self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s', enable_notification: '%s')" %
224224
(password, str(keycard), str(enable_notifications)), device=False)
225225
if self.element_by_text('CONTINUE').is_element_displayed(5):
226226
self.element_by_text('CONTINUE').click()
227-
if user_number == 0:
227+
if first_user:
228228
self.i_m_new_in_status_button.click_until_presence_of_element(self.generate_keys_button)
229-
elif user_number == 1:
230-
self.show_profiles_button.wait_and_click(20)
231-
self.plus_profiles_button.click()
232-
self.create_new_profile_button.click()
233229
else:
230+
if self.show_profiles_button.is_element_displayed(20):
231+
self.show_profiles_button.click()
234232
self.plus_profiles_button.click()
235233
self.create_new_profile_button.click()
236234
self.generate_keys_button.click_until_presence_of_element(self.profile_your_name_edit_box)

0 commit comments

Comments
 (0)