# generate test data data.json 准备测试数据 generate_test_data(devices)
print('Starting Run test >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>') # devices_list = [] # for i in range(len(devices)): # devices_list.append(RunCases(devices[i])) run_devices_list = [RunCases(device) for device in devices]
# run on every device 开始执行测试 pool = Pool(processes=len(run_devices_list)) for run_device in run_devices_list: pool.apply_async(self._run_cases, args=(run_device, cases,)) print('Waiting for all runs done........ ') pool.close() pool.join() print('All runs done........ ') # ChromeDriver.kill()
elif method == 'UDID': print('Get available UDID devices %s from atxserver2...' % ReadConfig().get_server_udid()) devices = get_atxserver2_online_devices(Atxserver2(ReadConfig().get_server_url()).present_udid_devices()) print('\nThere has %s available udid devices in atxserver2' % len(devices))
elif method == 'IP': # get devices from config devices list print('Get available IP devices %s from config... ' % ReadConfig().get_devices_ip()) devices = get_local_devices() print('\nThere has %s devices alive in config IP list' % len(devices))
elif method == 'USB': # get devices connected PC with USB print('Get available USB devices connected on PC... ') devices = get_usb_devices() print('\nThere has %s USB devices alive ' % len(devices))