switching airplane toggle method added

Signed-off-by: Oleksii Lymarenko <alexey.lymarenko@gmail.com>
This commit is contained in:
Oleksii Lymarenko 2018-10-22 23:30:32 +03:00
parent 927038a1d7
commit 96fe193daa
No known key found for this signature in database
GPG Key ID: 2007E841ECE4A02C
2 changed files with 14 additions and 6 deletions

View File

@ -57,14 +57,10 @@ class TestSignInOffline(MultipleDeviceTestCase):
@marks.testrail_id(5327)
@marks.critical
def test_offline_login(self):
self.create_drivers(1, offline_mode=True)
self.create_drivers(1)
sign_in = SignInView(self.drivers[0])
sign_in.create_user()
sign_in.driver.close_app()
sign_in.driver.set_network_connection(1) # airplane mode
sign_in.driver.launch_app()
sign_in.toggle_airplane_mode()
sign_in.accept_agreements()
home = sign_in.sign_in()
home.home_button.wait_for_visibility_of_element()

View File

@ -509,3 +509,15 @@ class BaseView(object):
def asset_by_name(self, asset_name):
return AssetButton(self.driver, asset_name)
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()
airplane_toggle = self.element_by_xpath('//*[@resource-id="android:id/switch_widget"]')
airplane_toggle.wait_for_visibility_of_element()
airplane_toggle.click()
# opening Status app
self.driver.start_activity(app_package='im.status.ethereum', app_activity='.MainActivity')