e2e: new onboarding

This commit is contained in:
Churikova Tetiana 2023-03-30 15:14:27 +02:00
parent f744d761c0
commit 4f2f8dea4c
No known key found for this signature in database
GPG Key ID: EDE559EC439D18A0
7 changed files with 74 additions and 48 deletions

View File

@ -50,7 +50,7 @@ pytest_config_global = dict()
test_suite_data = TestSuiteData()
appium_container = AppiumContainer()
common_password = 'qwerty'
common_password = 'qwerty1234'
unique_password = 'unique' + get_current_time()
pin = '121212'
puk = '000000000000'

View File

@ -212,7 +212,7 @@ def pytest_configure(config):
sauce.storage.upload(file_path)
os.remove(file_path)
break
except ConnectionError:
except (ConnectionError, RemoteDisconnected):
sleep(10)
else:
sauce.storage.upload(config.getoption('apk'))

View File

@ -154,8 +154,8 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
run_in_parallel(
(
(sign_in_views[0].create_user, {'enable_notifications': True}),
(sign_in_views[1].create_user, {'enable_notifications': True}),
(sign_in_views[2].create_user, {'enable_notifications': True})
(sign_in_views[1].create_user, {'enable_notifications': True, 'username': "test user1"}),
(sign_in_views[2].create_user, {'enable_notifications': True, 'username': "test user2"})
)
)
)

View File

@ -494,7 +494,12 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
'yotube_full': {
'url': 'https://www.youtube.com/watch?v=XN-SVmuJH2g&list=PLbrz7IuP1hrgNtYe9g6YHwHO6F3OqNMao',
'txt': 'Status & Keycard Hardware-Enforced Security',
'subtitle': 'YouTube'}
'subtitle': 'YouTube'},
'yotube_mobile': {
'url': 'https://m.youtube.com/watch?v=Je7yErjEVt4',
'txt': 'Status, your gateway to Ethereum',
'subtitle': 'YouTube'},
# twitter link is temporary removed from check as current xpath locator in message.preview_title is not applicable for this type of links
# 'twitter': {
# 'url': 'https://twitter.com/ethdotorg/status/1445161651771162627?s=20',

View File

@ -95,6 +95,7 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
[home.chats_tab.click() for home in [self.home_1, self.home_2]]
@marks.testrail_id(702850)
@marks.xfail(reason="Blocked by 15500")
def test_activity_center_contact_request_decline(self):
self.device_1.put_app_to_background()
self.device_2.just_fyi('Device2 sends a contact request to Device1 via Paste button and check user details')
@ -183,8 +184,8 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
self.drivers, self.loop = create_shared_drivers(2)
self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
self.loop.run_until_complete(
run_in_parallel(((self.device_1.create_user, ),
(self.device_2.create_user,))))
run_in_parallel(((self.device_1.create_user, {'username': 'user1'}),
(self.device_2.create_user, {'username': 'user2'}))))
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()
users = self.loop.run_until_complete(run_in_parallel(
@ -331,6 +332,7 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(702957)
@marks.xfail(reason="Blocked by 15500")
def test_activity_center_mentions(self):
self.home_1.jump_to_communities_home()
self.home_2.jump_to_card_by_text('# %s' % self.channel_name)
@ -365,6 +367,7 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors()
@marks.testrail_id(702958)
@marks.xfail(reason="Blocked by 15500")
def test_activity_center_admin_notification_accept_swipe(self):
self.home_2.just_fyi("Clearing history")
self.home_2.jump_to_messages_home()
@ -380,7 +383,7 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
community_element = self.home_1.get_chat(community_name, community=True)
self.community_1.share_community(community_element, self.default_username_2)
self.home_1.just_fyi("Request access to community")
self.home_2.just_fyi("Request access to community")
self.home_2.jump_to_messages_home()
self.chat_2 = self.home_2.get_chat(self.default_username_1).click()
self.chat_2.element_by_text_part('View').click()

View File

@ -595,11 +595,11 @@ class BaseView(object):
def jump_to_messages_home(self):
self.jump_to_button.click()
self.chats_tab.click()
self.chats_tab.click_until_presence_of_element(self.jump_to_button)
def jump_to_communities_home(self):
self.jump_to_button.click()
self.communities_tab.click()
self.communities_tab.click_until_presence_of_element(self.jump_to_button)
def jump_to_card_by_text(self, text: str):
self.jump_to_button.click()

View File

@ -140,11 +140,8 @@ class SignInView(BaseView):
xpath="(//android.widget.EditText[@content-desc='password-input'])[1]")
self.confirm_your_password_input = EditBox(self.driver,
xpath="(//android.widget.EditText[@content-desc='password-input'])[2]")
self.enable_notifications_button = Button(self.driver, accessibility_id="enable-notifications-button")
self.maybe_later_button = Button(self.driver, accessibility_id="enable-notifications-later-button")
self.privacy_policy_link = PrivacyPolicyLink(self.driver)
self.terms_of_use_link = TermsOfUseLink(self.driver)
self.start_button = Button(self.driver, accessibility_id="welcome-button")
self.keycard_storage_button = KeycardKeyStorageButton(self.driver)
self.first_username_on_choose_chat_name = Text(self.driver,
xpath="//*[@content-desc='select-account-button-0']//android.widget.TextView[1]")
@ -177,60 +174,81 @@ class SignInView(BaseView):
self.continue_custom_seed_phrase_button = Button(self.driver, accessibility_id="continue-custom-seed-phrase")
self.cancel_custom_seed_phrase_button = Button(self.driver, accessibility_id="cancel-custom-seed-phrase")
def create_user(self, password=common_password, keycard=False, enable_notifications=False, second_user=False):
# New onboarding
self.generate_keys_button = Button(self.driver, translation_id="create-multiaccount")
self.profile_your_name_edit_box = EditBox(self.driver, accessibility_id="profile-title-input")
self.profile_continue_button = Button(self.driver, accessibility_id="submit-create-profile-button")
self.profile_password_edit_box = EditBox(self.driver, translation_id="password-creation-placeholder-1")
self.profile_repeat_password_edit_box = EditBox(self.driver, translation_id="password-creation-placeholder-2")
self.profile_confirm_password_button = Button(self.driver, translation_id="password-creation-confirm")
self.enable_biometric_maybe_later_button = Button(self.driver, translation_id="maybe-later")
self.enable_notifications_button = Button(self.driver, accessibility_id="enable-notifications-button")
self.maybe_later_button = Button(self.driver, accessibility_id="enable-notifications-later-button")
self.start_button = Button(self.driver, accessibility_id="welcome-button")
self.use_recovery_phrase_button = Button(self.driver, translation_id="use-recovery-phrase")
self.passphrase_edit_box = EditBox(self.driver, accessibility_id="use-recovery-phrase")
def set_password(self, password: str):
self.profile_password_edit_box.set_value(password)
self.profile_repeat_password_edit_box.click()
self.profile_repeat_password_edit_box.send_keys(password)
self.checkbox_button.scroll_to_element()
self.checkbox_button.double_click()
self.profile_confirm_password_button.click()
def set_profile(self, username: str, set_image=False):
self.profile_your_name_edit_box.set_value(username)
self.profile_continue_button.click_until_presence_of_element(self.profile_password_edit_box)
if set_image:
pass
def create_user(self, password=common_password, keycard=False, enable_notifications=False, second_user=False,
username="test user"):
self.driver.info("## Creating new multiaccount (password:'%s', keycard:'%s', enable_notification: '%s')" %
(password, str(keycard), str(enable_notifications)), device=False)
if not second_user:
self.i_m_new_in_status_button.click_until_presence_of_element(self.generate_key_button)
self.generate_key_button.click()
self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2"))
if keycard:
keycard_flow = self.keycard_storage_button.click()
keycard_flow.confirm_pin_and_proceed()
keycard_flow.backup_seed_phrase()
else:
self.next_button.click()
self.create_password_input.set_value(password)
self.confirm_your_password_input.set_value(password)
self.next_button.click()
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)
self.enable_biometric_maybe_later_button.wait_and_click(30)
# self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2"))
# if keycard:
# keycard_flow = self.keycard_storage_button.click()
# keycard_flow.confirm_pin_and_proceed()
# keycard_flow.backup_seed_phrase()
# else:
# self.next_button.click()
# self.create_password_input.set_value(password)
# self.confirm_your_password_input.set_value(password)
# self.next_button.click()
if enable_notifications:
self.enable_notifications_button.click_until_presence_of_element(self.start_button)
else:
self.maybe_later_button.click_until_presence_of_element(self.start_button)
self.start_button.click()
self.chats_tab.wait_for_visibility_of_element(30)
self.driver.info("## New multiaccount is created successfully!", device=False)
return self.get_home_view()
def recover_access(self, passphrase: str, password: str = common_password, keycard=False,
enable_notifications=False, second_user=False):
def recover_access(self, passphrase: str, password: str = common_password+'1234', keycard=False,
enable_notifications=False, second_user=False, username='Restore user', set_image=False):
self.driver.info("## Recover access(password:%s, keycard:%s)" % (password, str(keycard)), device=False)
if not second_user:
self.accept_tos_checkbox.enable()
self.get_started_button.click_until_presence_of_element(self.access_key_button)
self.access_key_button.click()
self.enter_seed_phrase_button.click()
self.seedphrase_input.click()
self.seedphrase_input.set_value(passphrase)
self.next_button.click()
self.reencrypt_your_key_button.click()
if keycard:
keycard_flow = self.keycard_storage_button.click()
keycard_flow.confirm_pin_and_proceed()
else:
self.next_button.click()
self.create_password_input.set_value(password)
self.confirm_your_password_input.set_value(password)
self.next_button.click_until_presence_of_element(self.maybe_later_button)
self.maybe_later_button.wait_for_element(30)
self.i_m_new_in_status_button.click_until_presence_of_element(self.generate_keys_button)
self.use_recovery_phrase_button.click()
self.passphrase_edit_box.set_value(passphrase)
self.continue_button.click_until_presence_of_element(self.profile_your_name_edit_box)
self.set_profile(username, set_image)
self.set_password(password)
self.enable_biometric_maybe_later_button.wait_and_click(30)
if enable_notifications:
self.enable_notifications_button.click_until_presence_of_element(self.start_button)
else:
self.maybe_later_button.click_until_presence_of_element(self.start_button)
self.start_button.click()
self.profile_button.wait_for_visibility_of_element(30)
self.chats_tab.wait_for_visibility_of_element(30)
self.driver.info("## Multiaccount is recovered successfully!", device=False)
return self.get_home_view()