ndtp / android-testify

Add screenshots to your Android tests
Other
98 stars 5 forks source link

ActivityTestRule deprecated #88

Closed DanielJette closed 1 month ago

DanielJette commented 1 year ago

Is your feature request related to a problem? Please describe. Please share any plans regarding moving away from using https://developer.android.com/reference/androidx/test/rule/ActivityTestRule.html due to deprecation.

This feedback relates to:

Describe the solution you'd like The plugin heavily relies on https://developer.android.com/reference/androidx/test/rule/ActivityTestRule.html, while latter being deprecated.

Describe alternatives you've considered Using whatever coming instead of https://developer.android.com/reference/androidx/test/rule/ActivityTestRule.html

Additional context NA


Copied from @oradkovsky https://github.com/Shopify/android-testify/issues/244

DanielJette commented 1 year ago

@oradkovsky Thank you for the feedback

My expectation is that we will migrate the existing ScreenshotRule to either leverage ActivityScenario or possibly ActivityScenarioRule. I'm not anticipating that ActivityTestRule will be removed from the Android SDK for some time, so I expect that there will be time to develop a quality solution for Testify.

However, this will likely introduce a significant change to the API and "lifecycle" of Testify, so my plan would be to introduce an alternative non-ActivityTestRule-based solution side-by-side with the existing mechanism, to allow users to transition over without making a big, breaking change all at once. We did something like this with the transition from JUnit3 to JUnit4.

As for specific plans, I would hope we could get something added to a 1.2 release, but that really depends on how different/breaking a scenario-based Testify is.

Are there any specific problems or blockers you're running into right now with the current implementation? Maybe there's something quicker we can do to help rather than waiting on this specific fix.

DanielJette commented 1 year ago

Copied from @oradkovsky https://github.com/Shopify/android-testify/issues/244#issuecomment-922844969

All of the statements above fully make sense to me (not that it matters though :) . My problem is that we already have set of UI tests working on top of ActivityScenario. So far I do not see easy way of using existing Testify solution for this (by easy - I mean with slight code modifications of Testify).

DanielJette commented 1 year ago

Yeah, OK, I underhand how that would be a blocker for you. I've been very interested in splitting out the core Testify functionality into a more modular architecture so that it could be plugged into multiple testing patterns. Like, reusing the same core login from either a Rule or a Scenario. Now that 1.1.0 is in RC, we're going to start working on the 1.2.0 backlog tickets very soon. Hopefully it won't be too long until we can cut an alpha build with ActivityScenario support.

@oradkovsky If you're interested, you could open a PR against the Sample app where you add a test using ActivityScenario that looks like what you're using on your own project. I'm thinking something like that could demonstrate the kind of testing you're doing currently and then we can develop a Testify solution that would work well with that kind of test specifically.

DanielJette commented 1 year ago

oradkovsky added a commit to oradkovsky/android-testify that referenced this issue on Sep 25, 2021

impl: 244: sample for https://github.com/Shopify/android-testify/issues/244 0fab088

DanielJette commented 1 year ago

Copied @allefsousa from https://github.com/Shopify/android-testify/issues/244#issuecomment-1019339869

@DanielJette first of all congratulations for the amazing work. Any predictions about the integration with ActivityScenario? that will be fantastic

DanielJette commented 1 year ago

Hi @allefsousa, I just noticed this question while porting this issue to the new repository. My apologies for not replying for all these months.

We should have an alternative published in the 2.0 library in Q3 2022.

DanielJette commented 6 months ago

ISSUE-88-ScreenshotScenarioRule