Latest 0.0.9
Homepage https://github.com/HouseOfRisingSun/SilentRunner
License MIT
Platforms ios 9.0, requires ARC
Dependencies JSONRPCom, SocketRocket, OCMockito
Frameworks Foundation
Authors

SilentRunnerEngineSilentRunner

Build Status

codecov

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

0. Use Cocoapod **SilentRunnerEngine** to add lib to project.
1. Start testing server from **SilentRunnerTestServer**
2. Connect to server from the app with:
```objective-c
    // 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

Latest podspec

{
    "name": "SilentRunnerEngine",
    "version": "0.0.9",
    "summary": "SilentRunnerEngine",
    "homepage": "https://github.com/HouseOfRisingSun/SilentRunner",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "andrewBatutin": "[email protected]"
    },
    "source": {
        "git": "https://github.com/HouseOfRisingSun/SilentRunner.git",
        "tag": "0.0.9"
    },
    "source_files": "SilentRunner/SilentRunnerEngine/**/*",
    "frameworks": "Foundation",
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "dependencies": {
        "JSONRPCom": [],
        "SocketRocket": [],
        "OCMockito": []
    }
}

Pin It on Pinterest

Share This