0

I'm currently using Fastlane to capture screenshots of my application to be used in both the iOS and Android app store. My problem is that Fastlane is only able to capture the loading screen and the username/password authentication screen. Is there a way to pass credentials (possibly test creds with limited access) into Fastlane to allow it to capture other screenshots of my application? If not, what other methods could I use?

1 Answer 1

1

Please check in Fastlane docs Launch Arguments under Advanced Snapshot section https://docs.fastlane.tools/getting-started/ios/screenshots/ I think it can help

Launch Arguments

You can provide additional arguments to your app on launch. These strings will be available in your app (eg. not in the testing target) through NSProcessInfo.processInfo().arguments. Alternatively, use user-default syntax (-key value) and they will be available as key-value pairs in NSUserDefaults.standardUserDefaults().

launch_arguments([
  "-firstName Felix -lastName Krause"
])

name.text = NSUserDefaults.standardUserDefaults().stringForKey("firstName")
// name.text = "Felix"

snapshot includes -FASTLANE_SNAPSHOT YES, which will set a temporary user default for the key FASTLANE_SNAPSHOT, you may use this to detect when the app is run by snapshot.

if NSUserDefaults.standardUserDefaults().boolForKey("FASTLANE_SNAPSHOT")

{ // runtime check that we are in snapshot mode }

Specify multiple argument strings and snapshot will generate screenshots for each combination of arguments, devices, and languages. This is useful for comparing the same screenshots with different feature flags, dynamic text sizes, and different data sets.

# Snapfile for A/B Test Comparison
launch_arguments([
  "-secretFeatureEnabled YES",
  "-secretFeatureEnabled NO"
])
1
  • Thanks Sinisa. I was definitely wrong about how Fastlane takes screenshots. It seems that for Android (which I am working on now) Fastlane "piggybacks" off of Android's UI testing to capture screenshots. iOS behaves very similarly as well.
    – Preston Martin
    Commented Feb 13, 2018 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.