def setup_device_group(sb): """ 添加设备分组 """ request = {'name': generate_uuid()} MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') DevicePage.add_group_by_root_group_name(sb, request['name']) yield request sb.save_teardown_screenshot()
def setup_device_group_name_and_delete_group(sb): """ 生成设备分组名并清理该该设备分组 """ request = {'name': generate_uuid()} MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') yield request sb.save_teardown_screenshot() DevicePage.delete_group_by_name(sb, request['name'])
def test_add_face_alert_deployment_task_duplicate_task_name( sb, login, setup_face_alert_deployment_task_name_and_delete_task): """测试任务名重复""" # 先用初始值创建一个任务 task = FaceAccessControlTask(setup_face_alert_deployment_task_name_and_delete_task['name'], setup_face_alert_deployment_task_name_and_delete_task['name'], portraits=[ setup_face_alert_deployment_task_name_and_delete_task['name'] ]) TaskPage.add_face_alert_deployment_task(sb, task) # 再添加一个设备 MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') rtsp_device = RTSP( setup_face_alert_deployment_task_name_and_delete_task['name'] + 'dup', setup_face_alert_deployment_task_name_and_delete_task['name'] + 'dup', setup_face_alert_deployment_task_name_and_delete_task['name'], setup_face_alert_deployment_task_name_and_delete_task['name'], 'rtsp://confidence.119:6554/SchoolAnniversary.264') DevicePage.add_device_by_type( sb, rtsp_device, '网络摄像机') # 用新的设备和原先的任务名称、人像库作为添加规则的准备数据 task2 = FaceAccessControlTask(setup_face_alert_deployment_task_name_and_delete_task['name'], setup_face_alert_deployment_task_name_and_delete_task['name'] + 'dup', portraits=[ setup_face_alert_deployment_task_name_and_delete_task['name'] ]) # 定位到setup中的任务菜单 MenuBar.click_menu_item_by_text(sb, '配置', '任务管理') # 再次添加规则 TaskPage.add_face_alert_deployment_task(sb, task2) # 校验"任务名已存在" TaskPage.assert_alert_message(sb, '任务名已存在') # 关闭新增任务窗口 TaskPage.click_task_cancel_button(sb)
def test_device(self): # 访问设备管理页面 MenuBar.click_menu_item_by_text(self, '配置', '设备管理') # 创建设备分组 DevicePage.add_group_by_root_group_name( self, SmokeTest.SMOKE_DEVICE_GROUP_NAME) # DevicePage.assert_alert_message(self, '创建同级分组成功') # 添加RTSP设备 rtsp_device = RTSP(SmokeTest.SMOKE_DEVICE_RTSP_NAME, SmokeTest.SMOKE_DEVICE_RTSP_NAME, SmokeTest.SMOKE_DEVICE_GROUP_NAME, SmokeTest.SMOKE_MAP_CHILD_FLOOR_NAME, SmokeTest.SMOKE_DEVICE_RTSP_ADDRESS) DevicePage.add_device_by_type(self, rtsp_device, '网络摄像机')
def setup_face_alert_deployment_task_name_with_mul_portrait_and_delete_task( sb): """ 生成人脸通行任务名称并清理该任务 """ request = {'name': generate_uuid(), 'name2': generate_uuid()} MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.add_floor_by_root_floor_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') DevicePage.add_group_by_root_group_name(sb, request['name']) rtsp_device = RTSP(request['name'], request['name'], request['name'], request['name'], 'rtsp://confidence.119:6554/SchoolAnniversary.264') DevicePage.add_device_by_type(sb, rtsp_device, '网络摄像机') MenuBar.click_menu_item_by_text(sb, '配置', '人像库管理') PortraitPage.add_portrait_database_by_name(sb, request['name']) PortraitPage.add_portrait_database_by_name(sb, request['name2']) MenuBar.click_menu_item_by_text(sb, '配置', '任务管理') yield request sb.save_teardown_screenshot() MenuBar.click_menu_item_by_text(sb, '配置', '任务管理') TaskPage.click_task_tab_by_type(sb, type='人脸-布控任务') TaskPage.delete_task_by_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '人像库管理') PortraitPage.delete_portrait_database_by_name(sb, request['name']) PortraitPage.delete_portrait_database_by_name(sb, request['name2']) MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') DevicePage.delete_group_by_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.delete_floor_by_name(sb, request['name'])
def setup_face_access_control_task_name_with_mul_portrait_and_delete_task(sb): """ 生成人脸通行任务名称并清理该任务 """ request = {'name': generate_uuid(), 'name2': generate_uuid()} MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.add_floor_by_root_floor_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') DevicePage.add_group_by_root_group_name(sb, request['name']) frontend_device = Frontend(request['name'], request['name'], request['name'], request['name'], 'SensePass') DevicePage.add_device_by_type(sb, frontend_device, '人脸识别机(前)') MenuBar.click_menu_item_by_text(sb, '配置', '人像库管理') PortraitPage.add_portrait_database_by_name(sb, request['name']) PortraitPage.add_portrait_database_by_name(sb, request['name2']) MenuBar.click_menu_item_by_text(sb, '配置', '任务管理') yield request sb.save_teardown_screenshot() MenuBar.click_menu_item_by_text(sb, '配置', '任务管理') TaskPage.click_task_tab_by_type(sb, type='人脸-通行任务') TaskPage.delete_task_by_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '人像库管理') PortraitPage.delete_portrait_database_by_name(sb, request['name']) PortraitPage.delete_portrait_database_by_name(sb, request['name2']) MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') DevicePage.delete_group_by_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.delete_floor_by_name(sb, request['name'])
def test_add_face_access_control_task_duplicate_task_name( sb, login, setup_face_access_control_task_name_and_delete_task): """测试任务名重复""" # 先用初始值创建一个任务 task = FaceAccessControlTask( setup_face_access_control_task_name_and_delete_task['name'], setup_face_access_control_task_name_and_delete_task['name'], portraits=[ setup_face_access_control_task_name_and_delete_task['name'] ]) TaskPage.add_face_access_control_task(sb, task) # 再添加一个设备 MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') frontend_device = Frontend( setup_face_access_control_task_name_and_delete_task['name'] + 'dup', setup_face_access_control_task_name_and_delete_task['name'] + 'dup', setup_face_access_control_task_name_and_delete_task['name'], setup_face_access_control_task_name_and_delete_task['name'], 'SensePass') DevicePage.add_device_by_type(sb, frontend_device, '人脸识别机(前)') # 用新的设备和原先的任务名称、人像库作为添加规则的准备数据 task2 = FaceAccessControlTask( setup_face_access_control_task_name_and_delete_task['name'], setup_face_access_control_task_name_and_delete_task['name'] + 'dup', portraits=[ setup_face_access_control_task_name_and_delete_task['name'] ]) # 定位到setup中的任务菜单 MenuBar.click_menu_item_by_text(sb, '配置', '任务管理') # 再次添加规则 TaskPage.add_face_access_control_task(sb, task2) # 校验"任务名已存在" TaskPage.assert_alert_message(sb, '任务名已存在') # 关闭新增任务窗口 TaskPage.click_task_cancel_button(sb)
def setup_vehicle_illegally_parking_detection_task_name_and_delete_task(sb): """ 生成车辆违停检测任务名称并清理该任务 """ request = {'name': generate_uuid()} MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.add_floor_by_root_floor_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') DevicePage.add_group_by_root_group_name(sb, request['name']) rtsp_device = RTSP(request['name'], request['name'], request['name'], request['name'], 'rtsp://confidence.119:6554/test.264') DevicePage.add_device_by_type(sb, rtsp_device, '网络摄像机') MenuBar.click_menu_item_by_text(sb, '配置', '人像库管理') PortraitPage.add_portrait_database_by_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '任务管理') yield request sb.save_teardown_screenshot() MenuBar.click_menu_item_by_text(sb, '配置', '任务管理') TaskPage.click_task_tab_by_type(sb, type='车辆-违停检测任务') TaskPage.delete_task_by_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '人像库管理') PortraitPage.delete_portrait_database_by_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '设备管理') DevicePage.delete_group_by_name(sb, request['name']) MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.delete_floor_by_name(sb, request['name'])