Fix e2e update Dapps tp Browser

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-12-19 11:19:01 +02:00
parent 333a82a5b2
commit 1a61ae4b73
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
4 changed files with 15 additions and 8 deletions

View File

@ -299,7 +299,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
home.share_via_messenger()
home.find_text_part("Get Status at http://status.im")
@marks.testrail_id(5431)
@marks.medium
def test_add_custom_network(self):

View File

@ -28,7 +28,7 @@ class TestBrowsing(SingleDeviceTestCase):
browsing_view = daap_view.open_url('invalid.takoe')
browsing_view.find_text_part('Unable to load page')
browsing_view.cross_icon.click()
if home_view.element_by_text('Browser').is_element_displayed():
if home_view.element_by_text('Recent').is_element_displayed():
self.driver.fail('Browser entity is shown for an invalid link')
@marks.testrail_id(6210)

View File

@ -359,10 +359,11 @@ class BaseView(object):
'text': BaseText
}
def accept_agreements(self):
iterations = int()
while iterations <= 2 and (self.ok_button.is_element_displayed(2) or
self.close_native_device_dialog("Messages")
self.close_native_device_dialog("Youtube")
while iterations <= 1 and (self.ok_button.is_element_displayed(2) or
self.continue_button.is_element_displayed(2)):
for button in self.ok_button, self.continue_button:
try:
@ -372,6 +373,16 @@ class BaseView(object):
pass
iterations += 1
def close_native_device_dialog(self, alert_text_part):
element = self.element_by_text_part(alert_text_part)
if element.is_element_present(1):
self.driver.info("Dismissing %s alert" % alert_text_part)
self.dismiss_alert()
def dismiss_alert(self):
self.driver.info("Dismiss alert")
self.driver.switch_to.alert().dismiss()
@property
def logcat(self):
logcat = self.driver.get_log("logcat")
@ -619,9 +630,7 @@ class BaseView(object):
def toggle_airplane_mode(self):
self.airplane_mode_button.click()
mms_service = self.element_by_text_part("MmsService")
if mms_service.is_element_displayed():
self.driver.switch_to.alert().dismiss()
self.close_native_device_dialog("MmsService")
def toggle_mobile_data(self):
self.driver.start_activity(app_package='com.android.settings', app_activity='.Settings')

View File

@ -657,7 +657,6 @@ class ProfileView(BaseView):
def add_custom_network(self):
self.advanced_button.click()
self.debug_mode_toggle.click()
self.network_settings_button.scroll_to_element()
self.network_settings_button.click()
self.plus_button.click_until_presence_of_element(self.ropsten_chain_button)