Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pseudolocalization tests throwing exception when recording a custom Android View #1276

Open
sergio-sastre opened this issue Jan 31, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sergio-sastre
Copy link

sergio-sastre commented Jan 31, 2024

Description
When running a test with locale = "en-rXA", in an Android View containing a custom View, the test throws app.cash.paparazzi.internal.PaparazziLogger$MultipleFailuresException: There were 3 errors:

  1. java.lang.IllegalArgumentException: Float format error when parsing: Ḿ23,7Ĥ9Ç7.9,7,7,7.9,7,9[ is not a valid verb. Failure occurred at position 0 of path: [Ḿ23,7Ĥ9Ç7.9,7,7,7.9,7,9V14ç0,1.1,0.9,2,2,2ĥ14ç1.1,0,2-0.9,2-2ν9Ç25,7.9,24.1,7,23,7ž Ḿ23,23Ĥ9ν9ĥ14ν23ž one two three four five six seven eight nine ten eleven]...

  2. android.content.res.Resources$NotFoundException: Could not find drawable resource matching value 0x7F0800B1 (resolved name: mtrl_ic_checkbox_checked) in current configuration...

  3. android.view.InflateException: Binary XML file line # 20: Error inflating class com.example.road.to.effective.snapshot.testing.recyclerviewscreen.ui.views.LanguageRadioButton...

Steps to Reproduce
The example to reproduce the bug can be found here
Repo: https://github.com/sergio-sastre/Android-screenshot-testing-playground
Branch: bug/pseudolocale_exception
Module: recyclerviewscreen:paparazzi
The test class is this one

Expected behavior
The test would execute normally as it does with non-pseudolocales

Additional information:

  • Paparazzi Version: 1.3.2
  • OS: MacOS
  • Compile SDK: 34
  • Gradle Version: 8.5
  • Android Gradle Plugin Version: 8.1.1

And...

  • It only happens with pseudolocales "en-rXA" and "ar-rXB". it works perfectly with non-pseudolocales

  • I've successfully run pseudolocalization tests with other Views. Therefore, I believe the error has to do with the CustomView "LanguageRadioButton".

  • I've also found no issues with Jetpack Compose.

  • I've been able to run the very same pseudolocalization test with Roborazzi, Shot, Dropshots without issues.

@sergio-sastre sergio-sastre added the bug Something isn't working label Jan 31, 2024
@kevinzheng-ap kevinzheng-ap self-assigned this Apr 10, 2024
@kevinzheng-ap
Copy link
Collaborator

@sergio-sastre The reason is today Paparazzi does not support translatable attribute for string resource, as per comment here.

In your case, it is using <string name="mtrl_checkbox_button_path_unchecked" translatable="false">M23,7H9C7.9,7,7,7.9,7,9v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V9C25,7.9,24.1,7,23,7z M23,23H9V9h14V23z</string> from Material Components library. The actual path actually gets pseudo localised, which makes it a invalid format.

cc @jrodbx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants