Open rootsavaris opened 2 years ago
@rootsavaris we are using a custom test runner as well, and it works well via inheritance. Just make something like here in sample project
Hi!
Any progress with this issue?
@soyo2 just inherit from ShotTestRunner
and it will works as expected
But if I use a 2nd runner, say a runner for allure tests aggregate, then I cannot inherit from ShotTestRunner as I don't own the runner from Allure.
@soyo2 sorry for late reply. it's still possible, just copy/paste code from ShotTestRunner
and add dependency for plugin com.facebook.testing.screenshot:plugin
, since ScreenshotRunner
is added by this plugin. After that you don't need ShotTestRunner
and can inherit from AndroidJUnitRunner
. I didn't try this solution, but by a quick lookup it's something that should work.
Hi Alex
No worries. Yeah, we've did something similar but the other way around. We've copied the contents of the other runner and we decorated our runner which is derived from ShotTestRunner with that content and we've solved it that way, but it would be great to have a possibility of making it work without copying the source code and just relying entirely on the dependencies.
Any chance in the future of adding a way to provide another runner to ShotTestRunner for it to use or making ShotTest more flexible and not requiring it to be used as a runner so we can somehow inject it's operation, maybe via @Rule or something?
I have one project running with default UI and E2E tests using Custom TestRunner (working with HILT). I'm trying incorporate shot library on screenshots tests but it does not work.
If I use:
testInstrumentationRunner "com.karumi.shot.ShotTestRunner"
it works very well, but if I use:
When I use custom TestRunner, the screen shots doesn't save. Is it a bug ? Is there another way to wotk with Custom TestRunners ?