-
Notifications
You must be signed in to change notification settings - Fork 475
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
Spoon fails to capture a screenshot due to a difference between the actual class hierarchy, and the expected class hierarchy #80
Comments
We use a custom instrumentation test class as well and haven't seen problems. I think your problem is more the fact that we currently don't support taking screenshots in the I'm working on getting the computer to take screenshots which should allow for this case. It's not far enough along that I'm able to test whether or not it actually will work. |
Can't the method junit.framework.TestCase.getName() be used to determine the test case currently run? It is available during setUp() |
Currently the screenshot method doesn't take in the TestCase object so it wouldn't have any way of calling that method. We could switch to passing in the TestCase but we also need access to the current Activity and I'd hate to make the method signature uglier by requiring both. |
I think advancing #4 is the best approach to this since it will render this issue moot. The runner knows what test you are in since they execute synchronously. |
In 1.1.4 we added the ability to specify the test/class name. Closing this out. |
We are using Spoon as part of our automated tests for an Android application.
We have code similar to:
where OurOwnInstrumentationClass extends the ActivityInstrumentationTestCase2 of Android.
When running the test, Spoon fails to capture a screenshot, throwing an IllegalArgumentException stating that it cannot find the test class.
From debugging the tests, it seems to be a case that findTestClassTraceElement in Spoon.java expects to find android.test.InstrumentationTestCase on the stack, however due to where we are capturing the screenshot, we have junit.framework.TestCase on the stack instead, thus the exception is thrown.
Is there a way to adjust the code so that findTestClassTraceElement is not dependent on the hardcoded "android.test.InstrumentationTestCase" string?
The text was updated successfully, but these errors were encountered: