This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testNSUserDefaultsAndKeychain() { | |
app.userDefaultsSetObject(0, forKey: "view_count") | |
// interact with UI | |
app.buttons["Button"].tap() | |
let counter = app.userDefaultsObjectForKey("view_count")?.integerValue! | |
XCTAssert(counter == 1) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testStubbing() { | |
// setup your stub | |
let stubId = app.stubRequestsWithRegex("(.*)apple(.*)", returnJsonDictionary: ["key": "value"], returnCode: 200, responseTime: SBTUITunnelStubsDownloadSpeed3G) | |
// execute your test here. Expect requests to `(.*)apple(.*)` to return a JSON | |
... | |
// you can optionally remove the stub | |
app.stubRequestsRemoveWithId(stubId!) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
import SBTUITestTunnel | |
class TestTunnelDemoUITests: XCTestCase { | |
var app: SBTUITunneledApplication! | |
override func setUp() { | |
super.setUp() | |
continueAfterFailure = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_frameworks! | |
target 'APP_TARGET' do | |
pod 'SBTUITestTunnel/Server' | |
end | |
target 'UITESTS_TARGET' do | |
pod 'SBTUITestTunnel/Client' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import SBTUITestTunnel | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
override class func initialize() { | |
SBTUITestTunnelServer.takeOff() | |
super.initialize() |
NewerOlder