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 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_subordinate_floor_name_and_delete_floor(sb): """ 生成下一级楼层名称并清理该下一级楼层 """ request = {'name': generate_uuid()} MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') yield request sb.save_teardown_screenshot() MapPage.delete_floor_by_name(sb, request['name'])
def setup_peer_floor_and_delete_floor(sb): """ 添加同级楼层并清理该楼层 """ request = {'name': generate_uuid()} MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.add_floor_by_root_floor_name(sb, request['name']) yield request sb.save_teardown_screenshot() MapPage.delete_floor_by_name(sb, request['name'])
def test_delete_existing_subordinate_floor(sb, login, setup_peer_floor_and_delete_floor): subordinate_name = f"{setup_peer_floor_and_delete_floor['name']}S" MapPage.add_floor_by_parent_name( sb, subordinate_name, parent_name=setup_peer_floor_and_delete_floor['name'], is_peer=False) MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.delete_floor_by_name(sb, subordinate_name) MapPage.assert_alert_message(sb, '删除分组成功!')
def test_rename_subordinate_floor(sb, login, setup_peer_floor_and_delete_floor): old_name = f"{setup_peer_floor_and_delete_floor['name']}O" new_name = f"{setup_peer_floor_and_delete_floor['name']}N" MapPage.add_floor_by_parent_name( sb, old_name, parent_name=setup_peer_floor_and_delete_floor['name'], is_peer=False) MapPage.rename_floor_by_parent_name( sb, old_name, new_name, parent_name=setup_peer_floor_and_delete_floor['name']) MapPage.assert_alert_message(sb, '重命名成功!') MapPage.delete_floor_by_name(sb, new_name)
def test_rename_same_subordinate_floor(sb, login, setup_peer_floor_and_delete_floor): subordinate_name = f"{setup_peer_floor_and_delete_floor['name']}S" MapPage.add_floor_by_parent_name( sb, subordinate_name, parent_name=setup_peer_floor_and_delete_floor['name'], is_peer=False) MapPage.rename_floor_by_parent_name( sb, subordinate_name, 'Default', parent_name=setup_peer_floor_and_delete_floor['name']) MapPage.assert_alert_message(sb, '地图名已存在') MapPage.click_cancel_in_dialog(sb) MapPage.delete_floor_by_name(sb, subordinate_name)
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'])
def test_rename_peer_floor(sb, login, setup_peer_floor): new_name = f"{setup_peer_floor['name']}N" MapPage.rename_floor_by_root_floor_name(sb, setup_peer_floor['name'], new_name) MapPage.assert_alert_message(sb, '重命名成功!') MapPage.delete_floor_by_name(sb, new_name)
def test_delete_existing_peer_floor(sb, login, setup_peer_floor): MenuBar.click_menu_item_by_text(sb, '配置', '地图管理') MapPage.delete_floor_by_name(sb, setup_peer_floor['name']) MapPage.assert_alert_message(sb, '删除分组成功!')