ivy-wallet icon indicating copy to clipboard operation
ivy-wallet copied to clipboard

Setup Paparazzi screenshot tests

Open ILIYANGERMANOV opened this issue 1 year ago • 6 comments

Please confirm the following

What would you like to improve?

Setup Paparazzi https://github.com/cashapp/paparazzi

Because...

Protects us from UI regressions like #2903 and also will catch runtime crashes in the Compose UI.

Description

Setup as expected and execute in the CI. Make a new workflow that's called "Paparazzi screenshot tests" https://github.com/cashapp/paparazzi

Success Criteria

  • Git LFS setup
  • Proper Paparazzi setup as described in https://github.com/cashapp/paparazzi
  • Being able to repord and verify Paparazzi
  • CI workflow that run the paparazzi tests

ILIYANGERMANOV avatar Feb 06 '24 18:02 ILIYANGERMANOV

Thank you @ILIYANGERMANOV for raising Issue #2923! 🚀 What's next? Read our Contribution Guidelines 📚.

Tagging @ILIYANGERMANOV for review & approval 👀

ivywallet avatar Feb 06 '24 18:02 ivywallet

I'm on it

Vivekban avatar Feb 08 '24 16:02 Vivekban

Thank you for your interest @Vivekban! 🎉 Issue #2923 is assigned to you. You can work on it! ✅

If you don't want to work on it now, please un-assign yourself so other contributors can take it.

Also, make sure to read our Contribution Guidelines.

ivywallet avatar Feb 08 '24 16:02 ivywallet

@ILIYANGERMANOV I am having trouble integrating paparazzi dependency, below is error log, any idea on fixing issue

Could not resolve all files for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:8.1.1.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/com/android/tools/build/gradle/8.1.1/gradle-8.1.1.pom
     Required by:
         project : > app.cash.paparazzi:app.cash.paparazzi.gradle.plugin:1.3.2 > app.cash.paparazzi:paparazzi-gradle-plugin:1.3.2
   > Could not find com.android.tools:sdk-common:31.1.2.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/com/android/tools/sdk-common/31.1.2/sdk-common-31.1.2.pom
     Required by:
         project : > app.cash.paparazzi:app.cash.paparazzi.gradle.plugin:1.3.2 > app.cash.paparazzi:paparazzi-gradle-plugin:1.3.2`

Vivekban avatar Feb 15 '24 18:02 Vivekban

Hey @Vivekban can you please submit a draft PR? I'll try to help you out when I see the code

ILIYANGERMANOV avatar Feb 15 '24 22:02 ILIYANGERMANOV

@ILIYANGERMANOV Please find the draft PR here https://github.com/Ivy-Apps/ivy-wallet/pull/2978

Thanks

Vivekban avatar Feb 20 '24 15:02 Vivekban

Hey @Vivekban any updates on this one? I commented what might be causing the build errors

ILIYANGERMANOV avatar Feb 24 '24 23:02 ILIYANGERMANOV

@ILIYANGERMANOV Still working on this, will update you shortly.

Vivekban avatar Feb 26 '24 19:02 Vivekban

@ILIYANGERMANOV Hello sorry for the delay! I saw you already did this task here https://github.com/Ivy-Apps/ivy-wallet/pull/3042/files

Just one thing we can run Paparazzi with JUnit-5 by using junit-vintage without downgrading it. Check here for a sample https://github.com/Ivy-Apps/ivy-wallet/pull/3148/files#diff-697f70cdd88ba88fe77eebda60c7e143f6ad1286bca75017421e93ad84fb87df

Let me know If I have to do anything related to this.

Vivekban avatar Apr 18 '24 18:04 Vivekban

@Vivekban no worries, let's keep JUnit4 because it's more stable and integrates better with the IDE and the other testing frameworks. I prefer JUnit4 because:

  • the TestParameterInjector is better
  • you can run specific tests in the IDE w/o bugs
  • most of the Android world doesn't integrate well with JUnit5 and Kotest
  • We already migrated to JUnit4 and it's going well even with property-based tests

Feel free to fix the Paparazzi for legacy screens and add some for Home/Accounts if you're up to

ILIYANGERMANOV avatar Apr 18 '24 19:04 ILIYANGERMANOV

Sure, I will add for the remaining screens.

Vivekban avatar Apr 19 '24 05:04 Vivekban

@ILIYANGERMANOV Check this PR https://github.com/Ivy-Apps/ivy-wallet/pull/3158

I have added changes to an account module, do let me know if everything is right? Is yes I will add for other modules and legacy screens.

Vivekban avatar Apr 24 '24 09:04 Vivekban

@ILIYANGERMANOV Please review this PR I have added tests for 5 more modules.

https://github.com/Ivy-Apps/ivy-wallet/pull/3161

Vivekban avatar Apr 25 '24 13:04 Vivekban