From 4239ae56862a73e051ccd8b2f1366825b575d363 Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Wed, 25 Sep 2019 14:04:40 +0200 Subject: [PATCH] Mobile popup Signed-off-by: Churikova Tetiana --- .../atomic/account_management/test_profile.py | 10 ++++++++++ test/appium/views/base_view.py | 18 +++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 6d14848b38..830d625534 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -26,6 +26,16 @@ class TestProfileSingleDevice(SingleDeviceTestCase): if not profile_view.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'): self.driver.fail('Profile picture was not updated') + @marks.testrail_id(5741) + @marks.high + def test_mobile_data_usage_popup(self): + sign_in_view = SignInView(self.driver) + sign_in_view.create_user() + 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 + @marks.testrail_id(5454) @marks.critical def test_user_can_remove_profile_picture(self): diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index d91f3fa466..d03c663f44 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -609,12 +609,24 @@ class BaseView(object): network_and_internet = self.element_by_text('Network & Internet') network_and_internet.wait_for_visibility_of_element() network_and_internet.click() - airplane_toggle = self.element_by_xpath('//*[@resource-id="android:id/switch_widget"]') - airplane_toggle.wait_for_visibility_of_element() - airplane_toggle.click() + airplane_mode = self.element_by_xpath('//*[@resource-id="android:id/switch_widget"]') + airplane_mode.wait_for_visibility_of_element() + airplane_mode.click() # opening Status app self.driver.launch_app() + def toggle_mobile_data(self): + self.driver.start_activity(app_package='com.android.settings', app_activity='.Settings') + network_and_internet = self.element_by_text('Network & Internet') + network_and_internet.wait_for_visibility_of_element() + network_and_internet.click() + toggle = self.element_by_accessibility_id('Wi‑Fi') + toggle.wait_for_visibility_of_element() + toggle.click() + self.driver.back() + self.driver.back() + + def open_universal_web_link(self, deep_link): start_web_browser(self.driver) self.send_as_keyevent(deep_link)