Latest 1.2.2
Homepage https://github.com/ConfusedVorlon/HSTestingBackchannel
License MIT
Platforms ios 7.0
Dependencies GCDWebServer
Authors

Backchannel for UITesting.

Snapshot is awesome.

Now it uses UI Testing.

UI Testing is massively better than UI Automation – but sometimes, you just want to cheat.

HSTestingBackchannel gives you a simple method to send messages from your UITesting tests directly to your running app in the form of notifications.

Installation

Install with CocoaPods

pod 'HSTestingBackchannel', :configuration => ['Debug']

Usage

  1. use a prefix file and

    #define SNAPSHOT true

    (We’re still hoping that snapshot will re-introduce custom build arguments)

  2. In your App Delegate, install the
    helper

    #ifdef SNAPSHOT
        #import <HSTestingBackchannel/HSTestingBackchannel.h>
    #endif
    
    (and then in application:didFinishLaunchingWithOptions:)
    
    #ifdef SNAPSHOT
        [HSTestingBackchannel installReceiver];
    #endif
  3. Send notifications from your UITesting class

    [HSTestingBackchannel sendNotification:@"SnapshotTest"];

or

[HSTestingBackchannel sendNotification:@"SnapshotTest"
                        withDictionary:@{@"key":@"value"}];
  1. Respond to notifications within your app

    #ifdef SNAPSHOT
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(doSomething:)
                                                     name:@"SnapshotTest" 
                                                   object:nil];    
    #endif

Bonus – Copy dummy files to the Simulator

Within a test method (or in setUp), call something like

[HSTestingBackchannel installFilesFrom:@"..pathTo/fastlane/DummyImages" 
                                    to:HSTestingResources];

This will install the contents of DummyImages in the resources folder of your running app.
You can also install directly to the Documents directory in the app.

How it works

HSTestingBackchannel installs a webserver in your main app (GCDWebServer).

You simply send requests directly to that – and it recognises them and broadcasts NSNotifications

Latest podspec

{
    "name": "HSTestingBackchannel",
    "version": "1.2.2",
    "summary": "Send notifications directly from your UITesting classes to your running app.",
    "description": "Sometimes you want to cheat in your UITesting.nnHSTestingBackchannel provides an easy way for you to send notifications to your running app. You can use these to set things up for tests, screenshots, etc",
    "homepage": "https://github.com/ConfusedVorlon/HSTestingBackchannel",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Rob": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/ConfusedVorlon/HSTestingBackchannel.git",
        "tag": "1.2.2"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "dependencies": {
        "GCDWebServer": []
    }
}

Pin It on Pinterest

Share This