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
| fastlane_require 'nokogiri' | |
| @scheme = <YOUR TEST SCHEME NAME> | |
| @test_retries = 2 | |
| lane :test do | |
| scan( | |
| scheme: @scheme, | |
| device: 'iPhone X', | |
| output_types: 'junit', |
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
| lane :my_first_test_lane do | |
| scan( | |
| scheme: <YOUR TEST SCHEME NAME>, | |
| device: 'iPhone X' | |
| ) | |
| 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
| func test_NeverFailure() { | |
| XCTAssert(true) | |
| } | |
| func test_NeverSuccess() { | |
| XCTAssert(false) | |
| } |
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
| +--------------------+---+ | |
| | Test Results | | |
| +--------------------+---+ | |
| | Number of tests | 1 | | |
| | Number of failures | 1 | | |
| +--------------------+---+ | |
| +------+--------+-------------+ | |
| | fastlane summary | | |
| +------+--------+-------------+ |
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
| @max_battery_level = 42 | |
| @charging_file = '/sys/class/power_supply/battery/charging_enabled'.freeze | |
| def devices | |
| `adb devices`.scan(/\n(.*)\t/).flatten | |
| end | |
| def unplug(udid:) | |
| charging = (`adb -s #{udid} shell "su -c 'cat #{@charging_file}'"`.to_i == 1) | |
| puts "🔋 Charging enabled: #{charging}" |
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 isOpen(app: XCUIApplication) -> Bool { | |
| return (app.windows.count > 0) | |
| } |
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
| enum Alert: String { | |
| case left, right, ok | |
| } | |
| func alert(button: Alert) { | |
| let buttonIndex = (.right == button) ? 2 : 1 | |
| let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") | |
| let alertBtn = springboard.buttons.element(boundBy: buttonIndex) | |
| if alertBtn.exists { alertBtn.tap() } | |
| } |
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
| let app = XCUIApplication(bundleIdentifier: "com.my.app") | |
| override func setUp() { | |
| super.setUp() | |
| app.launch() | |
| } |
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
| Name | Value | |
|---|---|---|
| FB_REFERENCE_IMAGE_DIR | $(SOURCE_ROOT)/$(PROJECT_NAME)Tests/Snapshots/ReferenceImages | |
| IMAGE_DIFF_DIR | $(SOURCE_ROOT)/$(PROJECT_NAME)Tests/Snapshots/FailureDiffs |
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
| target "Tests" do | |
| use_frameworks! | |
| pod 'iOSSnapshotTestCase' | |
| end |
OlderNewer