Skip to content

Automate store screenshots generation with a UI test 🖼 #200

@opatry

Description

@opatry
  • Provide a way to stub initial data (predefined, relevant for screenshots) (and reset when relaunch)
  • Automate screenshot generation with a UI test navigating the app and taking screenshots when relevant
  • Enter demo mode
  • Enforce proper Android version and phone layout (currently Pixel 4a)
  • Enforce english locale from test? (using Locale.setDefault(Locale("en")) or Android equivalent?)

Tried 2 solutions, none worked…

⚠ This one also starts the activity twice.

@Before
fun setup() {
    val locales = LocaleListCompat.forLanguageTags("fr").toLanguageTags()
    AppLocalesStorageHelper.persistLocales(targetContext, locales)
}
private fun switchToLocale(locale: Locale) {
    Locale.setDefault(locale)

    targetContext.resources.apply {
        configuration.locale = locale
        targetContext.resources.updateConfiguration(configuration, targetContext.resources.displayMetrics)
    }
}

@Test
fun fofo() {
    switchToLocale(Locale.FRENCH)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    android app🤖 Related to the Android applicationdocumentation📖 Improvements or additions to documentationidea💡 Idea to iterate

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions