run all tests on android 8

Signed-off-by: Anton Danchenko <ant.danchenko@gmail.com>
This commit is contained in:
Anton Danchenko 2019-01-28 11:00:55 +02:00
parent 48291247b2
commit fd46113ab3
No known key found for this signature in database
GPG Key ID: C2D4819B698627E4
7 changed files with 60 additions and 51 deletions

View File

@ -52,6 +52,7 @@ 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")
for _ in range(2):
profile_view.click_system_back_button()
profile_view.cross_icon.click()
wallet = profile_view.wallet_button.click()
@ -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()

View File

@ -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

View File

@ -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()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -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()