nimblehq / jetpack-compose-crypto

This is an sample Crypto market prices app built with Jetpack Compose
https://nimblehq.co/
MIT License
21 stars 5 forks source link

[#74] Create HomeScreenUITest #86

Closed Wadeewee closed 1 year ago

Wadeewee commented 1 year ago

https://github.com/nimblehq/jetpack-compose-crypto/issues/74

What happened 👀

Create HomeScreen as UI Test.

Insight 📝

Proof Of Work 📹

https://user-images.githubusercontent.com/28002315/215425411-e0179896-f9cc-4458-a79a-a528b232631c.mov

github-actions[bot] commented 1 year ago
8 Warnings
:warning: /home/runner/.gradle/caches/transforms-3/fc63d10724654858d2ee5b467b86b5a7/transformed/jetified-dagger-lint-aar-2.43.2/jars/lint.jar#L0 - Lint found an issue registry (dagger.lint.DaggerIssueRegistry) which requires a newer API level. That means that the custom lint checks are intended for a newer lint version; please upgrade.
:warning: app/src/main/AndroidManifest.xml#L10 - On SDK version 23 and up, your app data will be automatically backed up and restored on app install. Consider adding the attribute android:fullBackupContent to specify an @xml resource which configures which files to backup, or just set android:fullBackupOnly=true. More info: https://developer.android.com/guide/topics/data/autobackup
:warning: app/src/main/AndroidManifest.xml#L13 - Attribute networkSecurityConfig is only used in API level 24 and higher (current min is 23)
:warning: app/src/main/java/co/nimblehq/compose/crypto/ui/common/Toaster.kt#L16 - Toast created but not shown: did you forget to call show() ?
:warning: app/src/main/res/drawable/ic_back.xml#L8 - Attribute fillType is only used in API level 24 and higher (current min is 23)
:warning: app/src/main/res/drawable/ic_fire_opal_arrow_down.xml#L8 - Attribute fillType is only used in API level 24 and higher (current min is 23)
:warning: app/src/main/res/drawable/ic_guppie_green_arrow_up.xml#L8 - Attribute fillType is only used in API level 24 and higher (current min is 23)
:warning: app/src/main/res/navigation/nav_graph_main.xml#L2 - The resource R.navigation.nav_graph_main appears to be unused

CoroutineTemplate Jacoco report:

Generated by :no_entry_sign: Danger

Wadeewee commented 1 year ago

Another concern is we need to omit the last two test cases from HomeScreenTest:

@Test
fun `When pulled to refresh and load MyCoins successfully, it render the UI properly`()
@Test
fun `When pulled to refresh and load TrendingCoins successfully, it render the UI properly`()

It seems like the PullRefreshIndicator doesn't show when we perform this action:

 onRoot().performTouchInput { swipeDown() }

That's why we can't test these test cases. Please let me know if you have any insight into this, the problem is similar to my above concern, I guess 🙏

Wadeewee commented 1 year ago

@hoangnguyen92dn @kaungkhantsoe @luongvo @doannimble, Regarding this issue, I think we can investigate it later as It works fine when creating the Unit Test with Robolectric in HomeScreenTest 🙏