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
cd /tmp | |
git clone https://github.com/llvm/llvm-project | |
cmake -B /tmp/llvm-project/llvm-build -G Ninja \ | |
-C /tmp/llvm-project/lldb/cmake/caches/Apple-lldb-base.cmake \ | |
-DLLVM_ENABLE_PROJECTS="clang;libcxx" \ | |
-DLIBCXX_ENABLE_STATIC=YES \ | |
llvm-project/llvm | |
ninja -C /tmp/llvm-project/llvm-build |
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 | |
class PushNotificationsUITests: XCTestCase { | |
func testInteractionWithPushNotificationByLooping() { | |
XCUIApplication().launch() | |
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") | |
springboard.activate() | |
let predicate = NSPredicate(format: "label BEGINSWITH %@", "PUSHNOTIFICATION") |
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 UserNotifications | |
func applicationWillResignActive(_ application: UIApplication) { | |
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 2.0, repeats: false) | |
let content = UNMutableNotificationContent() | |
content.title = "title" | |
content.body = "body" | |
let notification = UNNotificationRequest(identifier: "com.company.app.push.test", content: content, trigger: trigger) |
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
final class SBTFavoritesTrackingUITests_AnyDeviceAnyEnvironment: XCTestCase, SBTTestOnAnyDevice, SBTTestOnAnyEnvironment { | |
func testTracking_whenAddingFavoriteFromAdView_shouldTrackTheRightParameters() { | |
// ... | |
} | |
func testTracking_whenRemovingFavoriteFromAdView_shouldTrackTheRightParameters() { | |
// ... | |
} | |
func testTracking_whenAddingFavoriteFromListing_shouldTrackTheRightParameters() { |
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
@objc protocol SBTTestOnAnyEnvironment {} | |
@objc protocol SBTTestOnNotProductionEnvironment {} | |
@objc protocol SBTTestOnRegressEnvironment {} | |
@objc protocol SBTTestOnAdHocEnvironment {} | |
@objc protocol SBTTestOnStageEnvironment {} | |
@objc protocol SBTTestOnProductionEnvironment {} | |
@objc protocol SBTTestOnPreProdEnvironment {} | |
@objc protocol SBTTestOnReleaseEnvironment {} | |
@objc protocol SBTTestOnAnyDevice {} |
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 testSignup_whenSentWithInvalidEmailMx_handlesServerSideFailure() { | |
stubSignUpError("ACCOUNT_SAVE:invalid-mx") | |
openSignUp() | |
enterRequiredFields() | |
sendForm() | |
expectEmailError(.invalidDomain, expectingAlert: 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
func setAutocompleteKeyWhenInListing() { | |
// Scenario | |
// A button (`Go to listing`) takes you to a listing that has a text field (`search_box`) that filters a set of results | |
// Changes to `search_box` are saved to user defaults in a key `listing_search_leyword` | |
app.launchTunnel() | |
// Inject listing's search keyword in user defaults | |
let searchKeyword = "A random keyword" | |
app.userDefaultsSetObject(expectedSearchKeyword, forKey: "listing_search_keyword") | |
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 testLoginShowsWarningOnNetworkError() { | |
// Scenario: at launch a login form is presented to the user. When a network error (503) occurs on login a specific error message is shown to the user | |
app.launchTunnel() // an app property is added to XCTest classes (no need to instantiate one every time | |
// fill the initial login form | |
app.textFields["username"].clearAndEnterText("valid@domain.com") | |
app.secureTextFields["password"].clearAndEnterText("valid_password") | |
// enable stubbing for all requests matching "https://myservice.com/login" | |
app.stubRequests(matching: SBTRequestMatch.url("https://myservice.com/login"), |
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
require 'xcodeproj' | |
require 'digest/md5' | |
project_path = '<path to your project.xcproj>' | |
project_file = "#{project_path}/project.pbxproj" | |
project_file_hash = Digest::MD5.hexdigest(File.read(project_file)) | |
project_lock_path = "/tmp/#{project_path}.lock" | |
# Cache xcode_proj last md5 to avoid unnecessary parsing |
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
//: Playground | |
import Foundation | |
import XCTest | |
DispatchQueue.main.async { | |
// check that you're running playground in Swift 3.0 ;) | |
} | |
let thisIsPerformSelector = #selector(NSObject.perform(_:)) // performSelector |
NewerOlder