SilentRunnerEngine 0.0.9

SilentRunnerEngine 0.0.9

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jun 2017

Maintained by house of pods.



 
Depends on:
JSONRPCom>= 0
SocketRocket>= 0
OCMockito>= 0
 

  • By
  • andrewBatutin

SilentRunner

codebeat badge

##Intro Silent Runner is a testing tool for iOS to trigger some method calls remotely

Idea is simple:

  1. Remote server sends to the app message with method invocation details
  2. Silent runner invokes the method inside the iOS app.
  3. Profit

Useful for

  1. Push notifications testing
  2. Analytic System calls testing

Samples of messages:

  • Call push notification delegate method
{
    "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"
                      }
        }]
    }
}

Usage

  1. Use Cocoapod SilentRunnerEngine to add lib to project.
  2. Start testing server from SilentRunnerTestServer
  3. Connect to server from the app with:
    // 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://localhost:9000/chat"  withErrorHandler:^(NSError * error) {
        [self.serv sendErrorMessage:error];
    }];
    // run the engine
    [self.serv runServer];
  1. use SilentRunnerTestServer admin page to send messages.

If you'r testing some method make sure you've implemented it in your app. So for push notifications check if you have application:didReceiveRemoteNotification:fetchCompletionHandler: implemented

Demo Apps

###Dependencies

###TODO

  • Formal protocol spec
  • Support for batch requests
  • Swift wrapper
  • Mock params and return values for block arguments
  • more samples of test cases