switching airplane toggle method added
Signed-off-by: Oleksii Lymarenko <alexey.lymarenko@gmail.com>
This commit is contained in:
parent
927038a1d7
commit
96fe193daa
|
@ -57,14 +57,10 @@ class TestSignInOffline(MultipleDeviceTestCase):
|
||||||
@marks.testrail_id(5327)
|
@marks.testrail_id(5327)
|
||||||
@marks.critical
|
@marks.critical
|
||||||
def test_offline_login(self):
|
def test_offline_login(self):
|
||||||
self.create_drivers(1, offline_mode=True)
|
self.create_drivers(1)
|
||||||
sign_in = SignInView(self.drivers[0])
|
sign_in = SignInView(self.drivers[0])
|
||||||
sign_in.create_user()
|
sign_in.create_user()
|
||||||
|
sign_in.toggle_airplane_mode()
|
||||||
sign_in.driver.close_app()
|
|
||||||
sign_in.driver.set_network_connection(1) # airplane mode
|
|
||||||
|
|
||||||
sign_in.driver.launch_app()
|
|
||||||
sign_in.accept_agreements()
|
sign_in.accept_agreements()
|
||||||
home = sign_in.sign_in()
|
home = sign_in.sign_in()
|
||||||
home.home_button.wait_for_visibility_of_element()
|
home.home_button.wait_for_visibility_of_element()
|
||||||
|
|
|
@ -509,3 +509,15 @@ class BaseView(object):
|
||||||
|
|
||||||
def asset_by_name(self, asset_name):
|
def asset_by_name(self, asset_name):
|
||||||
return AssetButton(self.driver, 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')
|
||||||
|
|
Loading…
Reference in New Issue