Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with RobolectricTestRunner #5

Open
AlanChiou opened this issue Apr 23, 2021 · 1 comment
Open

Integrate with RobolectricTestRunner #5

AlanChiou opened this issue Apr 23, 2021 · 1 comment

Comments

@AlanChiou
Copy link

If we test an Android component(Activity, Fragment, Service...) with Robolectric, we will use RobolectricTestRunner as the test runner.

And a test class only have a test runner.
I also find a way to run a test class within multiple test runners, but I have no idea if it works with TestParameterInjector.
https://bekce.github.io/junit-multiple-runwith-dependent-tests/

Could you have a look about this topic?
Is possible that using TestParameterInjector as a Rule?

@nymanjens nymanjens changed the title How to integrate with Robolectric Integrate with RobolectricTestRunner Apr 24, 2021
@nymanjens
Copy link
Collaborator

Is possible that using TestParameterInjector as a Rule?

AFAIK, that's not possible in JUnit4, unfortunately. The only solution I think is to make a test runner that combines RobolectricTestRunner and TestParameterInjector or modify RobolectricTestRunner to support TestParameterInjector annotations.

We have an internal feature request to do this second option (RobolectricTestRunner to support the TestParameterInjector annotations). However, I'm being told this might either be a lot of work or practically impossible. I'll update this thread if we make any progress here.

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

No branches or pull requests

2 participants