Fix high/critical e2e for profile

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2019-08-29 17:53:17 +02:00
parent a5907fe0ca
commit 081b90ff4e
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
3 changed files with 22 additions and 12 deletions

View File

@ -163,6 +163,8 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
if sign_in_view.profile_button.counter.text != '1': if sign_in_view.profile_button.counter.text != '1':
self.errors.append('Profile button counter is not shown after re-login') self.errors.append('Profile button counter is not shown after re-login')
sign_in_view.profile_button.click() sign_in_view.profile_button.click()
profile_view.privacy_and_security_button.click()
profile_view.backup_recovery_phrase_button.click()
profile_view.backup_recovery_phrase() profile_view.backup_recovery_phrase()
if sign_in_view.profile_button.counter.is_element_displayed(60): if sign_in_view.profile_button.counter.is_element_displayed(60):
self.errors.append('Profile button counter is shown after recovery phrase backup') self.errors.append('Profile button counter is shown after recovery phrase backup')
@ -197,6 +199,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
profile_view = sign_in_view.profile_button.click() profile_view = sign_in_view.profile_button.click()
profile_view.privacy_and_security_button.click()
profile_view.backup_recovery_phrase_button.click() profile_view.backup_recovery_phrase_button.click()
profile_view.ok_continue_button.click() profile_view.ok_continue_button.click()
recovery_phrase = profile_view.get_recovery_phrase() recovery_phrase = profile_view.get_recovery_phrase()
@ -222,7 +225,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
base_web_view.open_in_webview() base_web_view.open_in_webview()
base_web_view.find_full_text('Frequently Asked Questions') base_web_view.find_full_text('Frequently Asked Questions')
base_web_view.click_system_back_button() base_web_view.click_system_back_button()
profile_view.submit_bug_button.click() profile_view.request_a_feature_button.click()
profile_view.find_full_text('#status') profile_view.find_full_text('#status')
@marks.testrail_id(5382) @marks.testrail_id(5382)
@ -501,9 +504,9 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
device_1_home = device_1.create_user() device_1_home = device_1.create_user()
device_1_home.profile_button.click() device_1_home.profile_button.click()
device_1_profile = device_1_home.get_profile_view() device_1_profile = device_1_home.get_profile_view()
device_1_profile.privacy_and_security_button.click()
device_1_profile.backup_recovery_phrase_button.click() device_1_profile.backup_recovery_phrase_button.click()
device_1_profile.ok_continue_button.click() recovery_phrase = device_1_profile.backup_recovery_phrase()
recovery_phrase = device_1_profile.get_recovery_phrase()
device_1_profile.back_button.click() device_1_profile.back_button.click()
device_1_profile.get_back_to_home_view() device_1_profile.get_back_to_home_view()
device_1_name = 'device_%s' % device_1.driver.number device_1_name = 'device_%s' % device_1.driver.number

View File

@ -126,6 +126,7 @@ class TestWalletManagement(SingleDeviceTestCase):
if not wallet.backup_recovery_phrase_warning_text.is_element_present(): if not wallet.backup_recovery_phrase_warning_text.is_element_present():
pytest.fail("'Back up your recovery phrase' warning is not shown on Wallet") pytest.fail("'Back up your recovery phrase' warning is not shown on Wallet")
wallet.multiaccount_more_options.click_until_presence_of_element(wallet.backup_recovery_phrase) wallet.multiaccount_more_options.click_until_presence_of_element(wallet.backup_recovery_phrase)
wallet.backup_recovery_phrase.click()
profile = wallet.get_profile_view() profile = wallet.get_profile_view()
profile.backup_recovery_phrase() profile.backup_recovery_phrase()

View File

@ -293,6 +293,12 @@ class SubmitBugButton(BaseButton):
self.locator = self.Locator.accessibility_id("submit-bug-button") self.locator = self.Locator.accessibility_id("submit-bug-button")
class RequestFeatureButton(BaseButton):
def __init__(self, driver):
super(RequestFeatureButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("request-a-feature-button")
class FaqButton(BaseButton): class FaqButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
@ -304,12 +310,6 @@ class FaqButton(BaseButton):
return BaseWebView(self.driver) return BaseWebView(self.driver)
class AboutButton(BaseButton):
def __init__(self, driver):
super(AboutButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("about-button")
class VersionText(BaseText): class VersionText(BaseText):
def __init__(self, driver): def __init__(self, driver):
super(VersionText, self).__init__(driver) super(VersionText, self).__init__(driver)
@ -415,7 +415,7 @@ class RemovePictureButton(BaseButton):
class DevicesButton(BaseButton): class DevicesButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super().__init__(driver) super().__init__(driver)
self.locator = self.Locator.accessibility_id('pairing-settings-button') self.locator = self.Locator.xpath_selector('//*[@content-desc="pairing-settings-button"]')
class DeviceNameInput(BaseEditBox): class DeviceNameInput(BaseEditBox):
@ -429,6 +429,10 @@ class ContinueButton(BaseButton):
super(ContinueButton, self).__init__(driver) super(ContinueButton, self).__init__(driver)
self.locator = self.Locator.text_selector('Continue') self.locator = self.Locator.text_selector('Continue')
class SyncSettingsButton(BaseButton):
def __init__(self, driver):
super(SyncSettingsButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@content-desc="sync-settings-button"]')
class GoToPairingSettingsButton(BaseButton): class GoToPairingSettingsButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
@ -539,8 +543,10 @@ class ProfileView(BaseView):
self.help_button = HelpButton(self.driver) self.help_button = HelpButton(self.driver)
self.submit_bug_button = SubmitBugButton(self.driver) self.submit_bug_button = SubmitBugButton(self.driver)
self.request_a_feature_button = RequestFeatureButton(self.driver)
self.faq_button = FaqButton(self.driver) self.faq_button = FaqButton(self.driver)
self.about_button = AboutButton(self.driver) self.about_button = AboutButton(self.driver)
self.sync_settings_button = SyncSettingsButton(self.driver)
# Bootnodes # Bootnodes
self.bootnodes_button = BootnodesButton(self.driver) self.bootnodes_button = BootnodesButton(self.driver)
@ -598,9 +604,8 @@ class ProfileView(BaseView):
text = [i.text for i in self.recovery_phrase_table.find_elements()] text = [i.text for i in self.recovery_phrase_table.find_elements()]
return dict(zip(map(int, text[::2]), text[1::2])) return dict(zip(map(int, text[::2]), text[1::2]))
def backup_recovery_phrase(self): def backup_recovery_phrase(self):
self.privacy_and_security_button.click()
self.backup_recovery_phrase_button.click()
self.ok_continue_button.click() self.ok_continue_button.click()
recovery_phrase = self.get_recovery_phrase() recovery_phrase = self.get_recovery_phrase()
self.next_button.click() self.next_button.click()
@ -647,6 +652,7 @@ class ProfileView(BaseView):
def discover_and_advertise_device(self, device_name): def discover_and_advertise_device(self, device_name):
self.profile_button.click() self.profile_button.click()
self.sync_settings_button.click()
self.devices_button.scroll_to_element() self.devices_button.scroll_to_element()
self.devices_button.click() self.devices_button.click()
self.device_name_input.set_value(device_name) self.device_name_input.set_value(device_name)