Skip to content
This repository has been archived by the owner on Aug 8, 2022. It is now read-only.

ActivityTestRule deprecated #244

Closed
1 of 5 tasks
oradkovsky opened this issue Sep 15, 2021 · 5 comments
Closed
1 of 5 tasks

ActivityTestRule deprecated #244

oradkovsky opened this issue Sep 15, 2021 · 5 comments
Labels
Milestone

Comments

@oradkovsky
Copy link
Contributor

oradkovsky commented Sep 15, 2021

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:

  • The Kotlin library
  • The Gradle plugin
  • The IntelliJ Platform plugin
  • The sample code
  • The documentation

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

@DanielJette
Copy link
Contributor

@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 DanielJette added this to the 2.0.0 milestone Sep 16, 2021
@oradkovsky
Copy link
Contributor Author

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
Copy link
Contributor

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 DanielJette modified the milestones: 2.0.0, 1.2.0 Sep 21, 2021
oradkovsky added a commit to oradkovsky/android-testify that referenced this issue Sep 25, 2021
@allefsousa
Copy link

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

@DanielJette
Copy link
Contributor

Moved to ndtp/android-testify#88

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants