Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(self, args=sys.argv[1:]):
args = self.parser.parse_args()
host, port = args.address.split(':')
self.marionette = Marionette(host=host, port=int(port))
self.marionette.start_session()
self.apps = gaiatest.GaiaApps(self.marionette)
self.data_layer = gaiatest.GaiaData(self.marionette)
self.device = gaiatest.GaiaDevice(self.marionette)
ret = args.func(args)
if ret is None:
ret = 0
self.marionette.delete_session()
sys.exit(ret)
def install_apps():
mc = get_marionette(args)
device = GaiaDevice(mc)
try:
device.restart_b2g()
print 'Your device is rebooting.'
except Exception:
print ' ** Check to make sure you don\'t have desktop B2G running'
raise
apps = GaiaApps(mc)
apps.kill_all()
lockscreen = LockScreen(mc)
lockscreen.unlock()
if args.wifi_ssid:
print 'Configuring WiFi'
if not args.wifi_key or not args.wifi_pass:
self.device_serial = device_serial
self.marionette = marionette
settings = gaiatest.GaiaData(self.marionette).all_settings
mac_address = self.marionette.execute_script(
'return navigator.mozWifiManager && '
'navigator.mozWifiManager.macAddress;')
self.submit_report = True
self.ancillary_data = {
'generated_by': 'b2gperf %s' % __version__,
'build_url': datazilla_config['build_url']}
dm = mozdevice.DeviceManagerADB(deviceSerial=self.device_serial)
self.device = gaiatest.GaiaDevice(self.marionette, manager=dm)
version = mozversion.get_version(sources=sources, dm_type='adb',
device_serial=self.device_serial)
self.ancillary_data['build_revision'] = version.get('build_changeset')
self.ancillary_data['gaia_revision'] = version.get('gaia_changeset')
self.ancillary_data['gecko_repository'] = version.get('application_repository')
self.ancillary_data['gecko_revision'] = version.get('application_changeset')
self.ancillary_data['ro.build.version.incremental'] = version.get(
'device_firmware_version_incremental')
self.ancillary_data['ro.build.version.release'] = version.get(
'device_firmware_version_release')
self.ancillary_data['ro.build.date.utc'] = version.get(
'device_firmware_date')
self.required = {
'generated_by': self.ancillary_data.get('generated_by'),
def do_login(args):
mc = get_marionette(args)
device = GaiaDevice(mc)
apps = GaiaApps(mc)
data_layer = GaiaData(mc)
_persona_frame_locator = ('css selector', "iframe")
# Trusty UI on home screen
_tui_container_locator = ('id', 'trustedui-frame-container')
# Persona dialog
_waiting_locator = ('css selector', 'body.waiting')
_email_input_locator = ('id', 'authentication_email')
_password_input_locator = ('id', 'authentication_password')
_new_password = ('id', 'password')
_verify_new_password = ('id', 'vpassword')
_next_button_locator = ('css selector', 'button.start')
_verify_start_button = ('css selector', 'button#verify_user')