diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 737ac673aa6..111ae4de9a3 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -28,13 +28,23 @@ def test_set_profile_picture(self): @marks.testrail_id(5741) @marks.high - def test_mobile_data_usage_popup(self): + def test_mobile_data_usage_popup_continue_syncing(self): sign_in_view = SignInView(self.driver) sign_in_view.create_user() + sign_in_view.just_fyi("Enable mobile network to see popup and enable syncing") sign_in_view.toggle_mobile_data() if not sign_in_view.find_text_part("Sync using Mobile data"): self.driver.fail('No popup about Mobile data is shown') - # TODO: add steps after 8973 fix + sign_in_view.wait_for_element_starts_with_text('Continue syncing').click() + + sign_in_view.just_fyi("Checked that selected option is stored in Profile") + profile_view = sign_in_view.profile_button.click() + profile_view.sync_settings_button.click() + profile_view.element_by_text('Mobile data').click() + if not profile_view.use_mobile_data.attribute_value('checked'): + self.errors.append('"Use mobile data" is disabled') + if not profile_view.ask_me_when_on_mobile_network.attribute_value('checked'): + self.errors.append('"Ask me when on mobile network" toggle is disabled') @marks.testrail_id(5454) @marks.critical diff --git a/test/appium/views/base_element.py b/test/appium/views/base_element.py index 16eaa13c2c1..725db847bb0 100644 --- a/test/appium/views/base_element.py +++ b/test/appium/views/base_element.py @@ -157,6 +157,9 @@ def template(self, value): def image(self): return Image.open(BytesIO(base64.b64decode(self.find_element().screenshot_as_base64))) + def attribute_value(self, value): + return self.find_element().get_attribute(value) + def is_element_image_equals_template(self, file_name: str = ''): if file_name: self.template = file_name diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 62cad8fc4f5..a64e93389c8 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -503,6 +503,19 @@ def __init__(self, driver): self.locator = self.Locator.xpath_selector( "//*[@text='Show my ENS username in chats']/following-sibling::*[1][name()='android.widget.Switch'] ") +class UseMobileDataToggle(BaseButton): + def __init__(self, driver): + super(UseMobileDataToggle, self).__init__(driver) + self.locator = self.Locator.xpath_selector( + "//*[@text='Use mobile data']/../*[name()='android.widget.Switch']") + +class AskMeWhenOnMobileNetworkToggle(BaseButton): + def __init__(self, driver): + super(AskMeWhenOnMobileNetworkToggle, self).__init__(driver) + self.locator = self.Locator.xpath_selector( + "//*[@text='Ask me when on mobile network']/../*[name()='android.widget.Switch']") + + class ProfileView(BaseView): @@ -585,8 +598,13 @@ def __init__(self, driver): self.advertise_device_button = AdvertiseDeviceButton(self.driver) self.sync_all_button = SyncAllButton(self.driver) + # ENS self.show_ens_name_in_chats = ShowENSNameInChatsToggle(self.driver) + # Mobile Data + self.use_mobile_data = UseMobileDataToggle(self.driver) + self.ask_me_when_on_mobile_network = AskMeWhenOnMobileNetworkToggle(self.driver) + def switch_network(self, network): self.advanced_button.click() self.debug_mode_toggle.click()