diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 20a1bbc96b..f28dc5ab81 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -52,7 +52,8 @@ class TestProfileSingleDevice(SingleDeviceTestCase): profile_view.share_via_messenger() if not profile_view.element_by_text_part(public_key).is_element_present(): self.errors.append("Can't share public key") - profile_view.click_system_back_button() + for _ in range(2): + profile_view.click_system_back_button() profile_view.cross_icon.click() wallet = profile_view.wallet_button.click() wallet.set_up_wallet() @@ -258,6 +259,48 @@ class TestProfileSingleDevice(SingleDeviceTestCase): if not profile.current_active_network == network_name.upper(): self.driver.fail('Oops! Wrong network selected!') + @marks.testrail_id(5453) + @marks.medium + def test_privacy_policy_is_accessible(self): + signin_view = SignInView(self.driver) + no_link_found_error_msg = 'Could not find privacy policy link at' + no_link_open_error_msg = 'Could not open our privacy policy from' + + if not signin_view.privacy_policy_link.is_element_displayed(): + self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg)) + + base_web_view = signin_view.privacy_policy_link.click() + base_web_view.open_in_webview() + if not base_web_view.policy_summary.is_element_displayed(): + self.errors.append('{} Sign in view!'.format(no_link_open_error_msg)) + + base_web_view.click_system_back_button() + signin_view = SignInView(self.driver) + home_view = signin_view.create_user() + profile = home_view.profile_button.click() + about_view = profile.about_button.click() + base_web_view = about_view.privacy_policy_button.click() + + if not base_web_view.policy_summary.is_element_displayed(): + self.errors.append('{} Profile about view!'.format(no_link_open_error_msg)) + + base_web_view.click_system_back_button() + if about_view.privacy_policy_button.is_element_displayed(): + base_web_view.click_system_back_button() + signin_view = profile.logout() + if signin_view.ok_button.is_element_displayed(): + signin_view.ok_button.click() + signin_view.other_accounts_button.click() + + if not signin_view.privacy_policy_link.is_element_displayed(): + self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg)) + + base_web_view = signin_view.privacy_policy_link.click() + if not base_web_view.policy_summary.is_element_displayed(): + self.errors.append('{} Sign in view!'.format(no_link_open_error_msg)) + + self.verify_no_errors() + @marks.all @marks.account @@ -338,45 +381,3 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): chat_2.chat_message_input.send_keys(message_1) chat_2.send_message_button.click() chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element() - - @marks.testrail_id(5453) - @marks.medium - def test_privacy_policy_is_accessible(self): - signin_view = SignInView(self.driver) - no_link_found_error_msg = 'Could not find privacy policy link at' - no_link_open_error_msg = 'Could not open our privacy policy from' - - if not signin_view.privacy_policy_link.is_element_displayed(): - self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg)) - - base_web_view = signin_view.privacy_policy_link.click() - base_web_view.open_in_webview() - if not base_web_view.policy_summary.is_element_displayed(): - self.errors.append('{} Sign in view!'.format(no_link_open_error_msg)) - - base_web_view.click_system_back_button() - signin_view = SignInView(self.driver) - home_view = signin_view.create_user() - profile = home_view.profile_button.click() - about_view = profile.about_button.click() - base_web_view = about_view.privacy_policy_button.click() - - if not base_web_view.policy_summary.is_element_displayed(): - self.errors.append('{} Profile about view!'.format(no_link_open_error_msg)) - - base_web_view.click_system_back_button() - if about_view.privacy_policy_button.is_element_displayed(): - base_web_view.click_system_back_button() - signin_view = profile.logout() - if signin_view.ok_button.is_element_displayed(): - signin_view.ok_button.click() - signin_view.other_accounts_button.click() - - if not signin_view.privacy_policy_link.is_element_displayed(): - self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg)) - - base_web_view = signin_view.privacy_policy_link.click() - if not base_web_view.policy_summary.is_element_displayed(): - self.errors.append('{} Sign in view!'.format(no_link_open_error_msg)) - - self.verify_no_errors() diff --git a/test/appium/tests/base_test_case.py b/test/appium/tests/base_test_case.py index a018c9d32c..7dd87aa919 100644 --- a/test/appium/tests/base_test_case.py +++ b/test/appium/tests/base_test_case.py @@ -62,7 +62,7 @@ class AbstractTestCase: desired_caps['name'] = test_suite_data.current_test.name desired_caps['platformName'] = 'Android' desired_caps['appiumVersion'] = '1.9.1' - desired_caps['platformVersion'] = '7.1' + desired_caps['platformVersion'] = '8.0' desired_caps['deviceName'] = 'Android GoogleAPI Emulator' desired_caps['deviceOrientation'] = "portrait" desired_caps['commandTimeout'] = 600 diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index f176726208..9ef6a3c307 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -239,6 +239,13 @@ class CrossIcon(BaseButton): self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="icon"])[1]') +class ShowRoots(BaseButton): + + def __init__(self, driver): + super(ShowRoots, self).__init__(driver) + self.locator = self.Locator.accessibility_id('Show roots') + + class AssetButton(BaseButton): def __init__(self, driver, asset_name): super(AssetButton, self).__init__(driver) @@ -279,6 +286,7 @@ class BaseView(object): self.confirm_button = ConfirmButton(self.driver) self.connection_status = ConnectionStatusText(self.driver) self.cross_icon = CrossIcon(self.driver) + self.show_roots_button = ShowRoots(self.driver) self.apps_button = AppsButton(self.driver) self.status_app_icon = StatusAppIcon(self.driver) @@ -489,11 +497,10 @@ class BaseView(object): return public_key def share_via_messenger(self): - self.element_by_text('Messenger').click() + self.element_by_text('Messages').click() self.element_by_text('NEW MESSAGE').click() - self.send_as_keyevent('+0') + self.send_as_keyevent('+0100100101') self.confirm() - self.element_by_accessibility_id('Send Message').click() def reconnect(self): connect_status = self.connection_status @@ -523,9 +530,9 @@ class BaseView(object): def toggle_airplane_mode(self): # opening android settings self.driver.start_activity(app_package='com.android.settings', app_activity='.Settings') - more_button = self.element_by_text('More') - more_button.wait_for_visibility_of_element() - more_button.click() + 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() diff --git a/test/appium/views/elements_templates/sauce_logo.png b/test/appium/views/elements_templates/sauce_logo.png index 2bf971f0bf..2ec8325946 100644 Binary files a/test/appium/views/elements_templates/sauce_logo.png and b/test/appium/views/elements_templates/sauce_logo.png differ diff --git a/test/appium/views/elements_templates/sauce_logo_red.png b/test/appium/views/elements_templates/sauce_logo_red.png index 9936574e27..90b4b90095 100644 Binary files a/test/appium/views/elements_templates/sauce_logo_red.png and b/test/appium/views/elements_templates/sauce_logo_red.png differ diff --git a/test/appium/views/elements_templates/saucelabs_sauce.png b/test/appium/views/elements_templates/saucelabs_sauce.png index b2b9787425..08042143f0 100644 Binary files a/test/appium/views/elements_templates/saucelabs_sauce.png and b/test/appium/views/elements_templates/saucelabs_sauce.png differ diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 3b3f092f65..edc36f3dc8 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -530,10 +530,11 @@ class ProfileView(BaseView): self.edit_picture_button.click() self.profile_picture.template = file_name self.select_from_gallery_button.click() - if self.allow_button.is_element_displayed(sec=10): + if self.allow_button.is_element_displayed(sec=5): self.allow_button.click() picture = self.element_by_text(file_name) if not picture.is_element_displayed(2): + self.show_roots_button.click() for element_text in 'Images', 'DCIM': self.element_by_text(element_text).click() picture.click()