zulip / zulip-flutter

Upcoming Zulip mobile apps for Android and iOS, using Flutter
Apache License 2.0
189 stars 177 forks source link

☂️ Integration tests to run on-device #757

Open gnprice opened 4 months ago

gnprice commented 4 months ago

For most of the app, we have no need for integration tests that run on an actual Android or iOS device. Flutter provides excellent support for widget testing, and that already allows us to test our UIs far more thoroughly than our practice was in the legacy zulip-mobile RN app.

But there are some places where it'd be good for us to have some integration tests.

Flutter upstream's support for integration tests is evolving; see chat discussion. So one thing I'm hoping is that by the time we turn to investing in integration tests, some of those improvements will have come to fruition and it'll be smoother than it would be today.

Examples of where integration tests would be desired:

This is an umbrella issue; we'll file issues for specific areas of tests on the way toward implementing them.

gnprice commented 4 months ago

As @rajveermalviya points out at https://github.com/zulip/zulip-flutter/pull/755#issuecomment-2178714363, we might not want to include these in every CI run (i.e. on every revision of every PR, and every push to main), because they'll be slow and will require firing up a battery of different devices.

We might instead have some scheme where they run periodically on main, and where we can explicitly choose to run them on a given PR or a specific commit from main. And we'll definitely want a straightforward way to run them locally on a device (physical or emulated) that you have lying around; that'll be essential for writing these tests, as well as debugging.