SilentRunnerEngine 0.0.9

SilentRunnerEngine 0.0.9

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布2017年6月

House of Pods维护。



 
依赖
JSONRPCom>= 0
SocketRocket>= 0
OCMockito>= 0
 

  • andrewBatutin

SilentRunner

codebeat badge

##简介 Silent Runner是iOS的一个远程触发一些方法调用的测试工具

主意很简单

  1. 远程服务器发送方法调用详情的消息到应用程序
  2. Silent runner在iOS应用程序中调用方法。
  3. 收获

用途

  1. 推送通知测试
  2. 分析系统调用测试

消息示例

  • 调用推送通知代理方法
{
    "jsonrpc": "2.0",
    "method": "execute",
    "params": {
        "commandId": "app",
        "method": "application:didReceiveRemoteNotification:fetchCompletionHandler:",
        "arguments": [{
            "class": "UIApplication",
            "properties": [{
                "name": "delegate",
                "value": "https://github.com/andrewBatutin/SilentRunner"
            }],
            "methods": [{
                "name": "isIgnoringInteractionEvents",
                "returnValue": "YES"
            }]
        }, {
            "value": {
                "opt1": "test"
            }
        },
        {
            "block": {
                "returnValue": "notUsed"
                      }
        }]
    }
}

用法

  1. 使用Cocoapod SilentRunnerEngine将库添加到项目中。
  2. SilentRunnerTestServer启动测试服务器。
  3. 从应用程序连接到服务器
    // register your app delegate to be callable from test server
    [SRClientPool addClient:[UIApplication sharedApplication].delegate forTag:@"app"];
    // create server instance
    self.serv = [SRServer serverWithURL:@"ws://:9000/chat"  withErrorHandler:^(NSError * error) {
        [self.serv sendErrorMessage:error];
    }];
    // run the engine
    [self.serv runServer];
  1. 使用SilentRunnerTestServer管理页面发送消息。

如果您正在测试某些方法,请确保您在应用程序中实现了它。因此对于推送通知,请检查是否已实现application:didReceiveRemoteNotification:fetchCompletionHandler:

演示应用程序

###依赖

###待办事项

  • 正式协议规范
  • 支持批量请求
  • Swift包装器
  • 为块参数模拟参数和返回值
  • 更多测试用例示例