Commit be2d6951 authored by Torsten Grote's avatar Torsten Grote

Setup fastlane

This is great for automatically uploading (localized) screenshots
and app metadata to Google Play.
You can even upload the signed APK releases as well.

For now, this is only useful for running the screenshot Espresso tests
and grabbing the screenshots from the device.
parent d0c2c030
...@@ -23,5 +23,12 @@ ...@@ -23,5 +23,12 @@
!.idea/codeStyles !.idea/codeStyles
.gradle .gradle
build/ build/
*.iml *.iml
projectFilesBackup/ projectFilesBackup/
\ No newline at end of file
# Fastlane Non-Google Play Screenshots
\ No newline at end of file
json_key_file("") # Path to the json secret file - Follow to get one
# This file contains the configuration
# You can find the documentation at
# For a list of all available actions, check out
# For a list of all available plugins, check out
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
platform :android do
desc "Takes screenshots for manual and Google Play"
lane :screenshots do
gradle(project_dir: "..", task: "assembleScreenshot assembleAndroidTest")
system './'
# vi:syntax=ruby
#!/usr/bin/env python3
# Author: Torsten Grote
# License: GPLv3 or later
import os
import re
import glob
METADATA_PATH = 'metadata/android'
GLOB = '/*/images/phoneScreenshots/*.png'
REGEX = re.compile(r'(^\w+)_\d{13}\.png$')
REGEX_IN_FILE = re.compile(r'(\w+)_\d{13}\.png', re.MULTILINE)
PATH = os.path.dirname(os.path.realpath(__file__))
def main():
for path in glob.glob("%s%s" % (os.path.join(PATH, METADATA_PATH), GLOB)):
filename = os.path.basename(path)
match = REGEX.match(filename)
if match:
directory = os.path.dirname(path)
new_filename = "%s.png" %
new_path = os.path.join(directory, new_filename)
os.rename(path, new_path)
print("Renaming\n %s\nto\n %s\n" % (path, new_path))
print("Warning: Path did not match %s" % path)
# rename fields also in screenshot overview file
overview = os.path.join(PATH, METADATA_PATH, 'screenshots.html')
with open(overview, 'r') as f:
file_data =
file_data = REGEX_IN_FILE.sub(r'\1.png', file_data)
with open(overview, 'w') as f:
if __name__ == "__main__":
...@@ -56,7 +56,7 @@ public class DarkThemeTest extends ScreenshotTest { ...@@ -56,7 +56,7 @@ public class DarkThemeTest extends ScreenshotTest {
.check(matches(isDisplayed())) .check(matches(isDisplayed()))
.perform(click()); .perform(click());
screenshot("dark_theme_settings"); screenshot("manual_dark_theme_settings");
onView(withText(R.string.pref_theme_title)) onView(withText(R.string.pref_theme_title))
.check(matches(isDisplayed())) .check(matches(isDisplayed()))
...@@ -83,7 +83,7 @@ public class DarkThemeTest extends ScreenshotTest { ...@@ -83,7 +83,7 @@ public class DarkThemeTest extends ScreenshotTest {
.check(matches(isClosed(Gravity.LEFT))) .check(matches(isClosed(Gravity.LEFT)))
.perform(; .perform(;
screenshot("dark_theme_nav_drawer"); screenshot("manual_dark_theme_nav_drawer");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment