This file contains 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
default_platform(:android) | |
platform :android do | |
desc "Runs all the tests" | |
lane :test do | |
gradle(task: "test") | |
end | |
desc "Submit a new Beta Build to Crashlytics Beta" | |
lane :beta do |
This file contains 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
<!-- Allows unlocking your device and activating its screen so UI tests can succeed --> | |
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> | |
<uses-permission android:name="android.permission.WAKE_LOCK"/> | |
<!-- Allows for storing and retrieving screenshots --> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<!-- Allows changing locales --> | |
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /> | |
This file contains 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
@RunWith(JUnit4::class) | |
class AutomateScreenshotsTest { | |
@Before | |
fun setUp() { | |
ActivityScenario.launch(MainActivity::class.java) | |
Screengrab.setDefaultScreenshotStrategry(UiAutomatorScreenshotStrategy()) | |
} | |
@Test |
This file contains 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
@Before | |
fun setUp() { | |
ActivityScenario.launch(MainActivity::class.java) | |
Screengrab.setDefaultScreenshotStrategy(UiAutomatorScreenshotStrategy()) | |
} |
This file contains 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 | |
fun captureScreen() { | |
// Delay 500 millis for app launch to main screen | |
Thread.sleep(500) | |
Screengrab.screenshot("main_screen") | |
} |
This file contains 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
desc "Capture Screen" | |
lane :capture_screen do | |
gradle(task: "clean assembleDebug assembleAndroidTest") | |
screengrab | |
end |
This file contains 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
locales ['en-US'] | |
clear_previous_screenshots true | |
tests_apk_path 'app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk' | |
app_apk_path 'app/build/outputs/apk/debug/app-debug.apk' | |
test_instrumentation_runner 'androidx.test.runner.AndroidJUnitRunner' |
This file contains 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
desc "Beta Deployment" | |
lane :beta do | |
# Adjust the `build_type` and `flavor` params as needed to build the right APK for your setup | |
gradle( | |
task: 'assemble', | |
build_type: 'Release' | |
) | |
crashlytics( | |
apk_path: ['insert_apk_path'], | |
api_token: ['insert_key_here'], |
This file contains 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
json_key_file "/path/to/your/downloaded/key.json" |
This file contains 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
desc "Deploy app to play store" | |
lane :deploy do | |
gradle( | |
task: 'assemble', | |
build_type: 'Release' | |
) | |
upload_to_play_store(track:'beta') | |
end |
OlderNewer