コード例 #1
0
manifest(
    id='android',
    name='Android',
    icon='mdi-android-debug-bridge',
    api=[
        # check env
        ('/api/check_env', apis.check_env, ['GET']),
        # 获取设备列表
        ('/api/devices', apis.device_list, ['GET']),
        # 应用详情
        ('/api/package_name', apis.last_package_name, ['GET']),
        # 获取app详情
        ('/api/app/<string:device_id>/<string:package_name>', apis.app_info, ['GET']),
        # 进行截图
        ('/api/screenshot/<string:device_id>', apis.take_screen_shot, ['GET']),
        # 获取截图
        ('/api/src/screenshot/<string:device_id>', apis.get_screenshot_image, ['GET']),
        # 获取设备所有package
        ('/api/packages/<string:device_id>', apis.get_all_package, ['GET']),
        # execute command
        ('/api/command', apis.execute_command, ['POST']),
        # actions of application
        ('/api/device/<string:device_id>/app/<string:package_name>/<string:action>', apis.application_controller, ['PUT']),
        # actions of device
        ('/api/device/<string:device_id>/<string:action>', apis.device_controller, ['PUT']),
        # actions of templates
        ('/api/template/<string:action>', apis.template_options_controller, ['GET']),
        # actions of template
        ('/api/template/<string:action>/<string:template_id>', apis.template_controller, ['GET', 'PUT', 'POST']),
        # download apk
        ('/api/src/apk', apis.download_application, ['PUT']),
        # search app
        ('/api/search/app', apis.search_app, ['POST'])
    ],
    background=[
        ('android_device_service', apis.device_service.run)
    ],
    event=[
        ('android.cmd', apis.get_screenshots)
    ]
)
コード例 #2
0
# 总线消息订阅
event_subscribe()

manifest(
    id='api_coverage',
    name='APICoverage',
    api=[
        # 获取内存里保存的测试结果API
        ('/api/getTest', api.get_test_data),
        # 获取内存里保存的测试覆盖率信息
        ('/api/getCoverage', api.get_coverage),
        # 保存测试数据在本地
        ('/api/saveResult', api.save_result, ['POST']),
        # 续传测试结果
        ('/api/resumeTest', api.resume_test, ['POST']),
        # 清空测试缓存结果
        ('/api/clearResult', api.clear_result),
        # 导入base json文件
        ('/api/importBase', api.import_base, ['POST']),
        # 获取filter的conf文件
        ('/api/getFilterConf', api.get_filter_conf),
        # 覆盖配置filter conf文件
        ('/api/setFilterConf', api.set_filter_conf, ['POST']),
        # overbridge dump 信息用的API
        ('/api/dump', api.dump),
        # baseInfo
        ('/api/baseInfo', api.get_base_info),
    ],
    background=[],
    event=[('flow', interceptor.on_request)])
コード例 #3
0
ファイル: manifest.py プロジェクト: zzzyw-work/lyrebird
from lyrebird.plugins import manifest
from . import handler
from . import status


manifest(
    id='demo',
    name='Demo',
    api=[
        # http://localhost:9090/plugins/demo/api/list
        ('/api/list', handler.request_list, ['GET']),
        # http://localhost:9090/plugins/demo/api/mock
        ('/api/mock', handler.mock, ['POST']),
        # http://localhost:9090/plugins/demo/api/reset
        ('/api/reset', handler.reset, ['PUT'])
    ],
    background=[
    ],
    event=[
        ('flow', handler.on_request)
    ],
    status=[
        status.StatusbarDemoImage,
        status.StatusbarDemoText
    ]
)
コード例 #4
0
from lyrebird.plugins import manifest
from . import apis
from . import event_handler

manifest(id='bugit',
         name='BugIt',
         icon='mdi-bug-outline',
         api=[('/api/template', apis.template, ['GET', 'POST']),
              ('/api/device', apis.device, ['GET']),
              ('/api/issue', apis.issue, ['GET', 'POST']),
              ('/api/take_screenshot/<string:platform>/<string:device_id>',
               apis.take_screenshot, ['GET']),
              ('/api/attachments', apis.attachments, ['GET']),
              ('/api/attachments/<string:attachment_id>', apis.attachments,
               ['GET', 'PUT', 'DELETE']),
              ('/api/cache/<string:template_key>', apis.ui_cache,
               ['GET', 'POST', 'DELETE'])],
         event=[('android.device', event_handler.on_android_device),
                ('ios.device', event_handler.on_ios_device),
                ('android.screenshot', event_handler.on_android_screenshot),
                ('ios.screenshot', event_handler.on_ios_screenshot)])
コード例 #5
0
from lyrebird.plugins import manifest
from . import handler

manifest(
    id='demo',
    name='Demo',
    api=[
        # http://localhost:9090/plugins/demo/api/count
        ('/api/count', handler.request_count, ['GET']),
        # http://localhost:9090/plugins/demo/api/reset
        ('/api/reset', handler.reset_count, ['PUT'])
    ],
    background=[],
    event=[('flow', handler.on_request)])
コード例 #6
0
from lyrebird.plugins import manifest
from . import handler
from . import status


manifest(
    id='demo',
    name='Demo',
    # Pick an icon from https://webmaterialdesignicons.com/
    # Example icon='mdi-video-outline',
    icon='',
    api=[
        # http://localhost:9090/plugins/demo/api/list
        ('/api/list', handler.request_list, ['GET']),
        # http://localhost:9090/plugins/demo/api/mock
        ('/api/mock', handler.mock, ['POST']),
        # http://localhost:9090/plugins/demo/api/reset
        ('/api/reset', handler.reset, ['PUT'])
    ],
    background=[
    ],
    event=[
        ('flow', handler.on_request)
    ],
    status=[
        status.StatusbarDemoImage,
        status.StatusbarDemoText
    ]
)
コード例 #7
0
ファイル: manifest.py プロジェクト: leo-lp/lyrebird-ios
manifest(
    id='ios',
    name='iOS',
    api=[
        # get devices
        ('/api/devices', apis.device_list, ['GET']),
        # get device information
        ('/api/device/<string:device_id>', apis.device_detail, ['GET']),
        # get application information
        ('/api/apps/<string:device_id>/<string:bundle_id>', apis.get_app_info,
         ['GET']),
        # take screenshot
        ('/api/screenshot/<string:device_id>', apis.take_screen_shot, ['GET']),
        # get screenshot
        ('/api/src/screenshot/<string:device_id>', apis.get_screenshot_image,
         ['GET']),
        # start applicaton
        ('/api/start_app/<string:device_id>/<string:bundle_id>',
         apis.start_app, ['GET']),
        # stop application
        ('/api/stop_app/<string:device_id>/<string:bundle_id>', apis.stop_app,
         ['GET']),
        # get application list
        ('/api/apps/<string:device_id>', apis.app_list, ['GET']),
        # environment check
        ('/api/check_env', apis.check_env, ['GET']),
        # get config
        ('/api/conf', apis.conf, ['GET'])
    ],
    background=[('ios_device_service', apis.device_service.run)],
    event=[('ios.cmd', apis.get_screen_shot)])