Skip to content

Instantly share code, notes, and snippets.

cask_args appdir: "/Applications"
tap "caskroom/cask"
brew "mas"
brew "openssl"
tap "sublime"
tap "chrome"
tap "sourcetree"
mas "Xcode", id: 497799835
stage('ios') {
}
import UIKit
let appDelegateClass: AnyClass? = NSClassFromString("TEST_TARGET.TestingAppDelegate") ? AppDelegate.self
let args = UnsafeMutableRawPointer(CommandLine.unsafeArgv).bindMemory(to: UnsafeMutablePointer<Int8>.self, capacity: Int(CommandLine.argc))
UIApplicationMain(CommandLine.argc, args, nil, NSStringFromClass(appDelegateClass!))
import UIKit
class TestingAppDelegate: NSObject {
var window: UIWindow?
}
import OHHTTPStubs
public func isURL(_ url: URL) -> OHHTTPStubsTestBlock {
return { $0.url == url }
}
extension OHHTTPStubs {
class func setupAuth() {
let response: [String: Any] = ["key": "value"]
stub(condition: isURL("auth.testxyz.com")) { _ in
extension XCUIElement {
func write(string: String) {
guard let stringValue = self.value as? String else {
XCTFail("Tried to clear and enter text into a non string value")
return
}
self.tap()
// clear element before writing new text
class LoginScreen {
var app: XCUIApplication
let identifier = "german-icon"
var usernameTextField: XCUIElement { return app.textFields["usernameTextField"] }
var passwordTextField: XCUIElement { return app.secureTextFields["passwordTextField"] }
var loginButton: XCUIElement { return app.buttons["loginButton"] }
init(app: XCUIApplication) {
import FBSnapshotTestCase
class SnapshotTestingTests: FBSnapshotTestCase {
override func setUp() {
super.setUp()
//recordMode = true
}
func testWelcomeView_WithName() {
let welcomeVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "Test") as! ViewController
_ = welcomeVC.view
let lowerCaseLetters : Gen<Character> = Gen<Character>.fromElements(in: "a"..."z")
let upperCaseLetters : Gen<Character> = Gen<Character>.fromElements(in: "A"..."Z")
let numeric : Gen<Character> = Gen<Character>.fromElements(in: "0"..."9")
let special : Gen<Character> = Gen<Character>.fromElements(of: ["!", "#", "$", "%", "&", "'", "*", "+", "-", "/", "=", "?", "^", "_", "`", "{", "|", "}", "~", "."])
let allowedLocalCharacters : Gen<Character> = Gen<Character>.one(of: [
upperCaseLetters,
lowerCaseLetters,
numeric,
special,
])