Widget class cannot be in Groovy
aznime opened this issue · 8 comments
Description
When creating a widget, code must be in Java. An illegal access exception is thrown if it is coded in Groovy.
Environment
- java client build version or git revision if you use some shapshot: 3.3.0
- Appium server version or git revision you is use some shapshot: 1.14.16
- Desktop OS/version used to run Appium if necessary: OSX El Capitan (10.11.1)
- Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: 0.12.7
- Mobile platform/version under test: iOS 9.2
- Real device or emulator/simulator: Simulator
Exception stacktraces
@aznime
Could you share a gist with code of this class?
com.jumbo.shared.widgets.PlayWidget
It looks like a bug but I don't know how to reproduce it. Java client widget tests use objects with protected constructors and private/protected fields which are populated and everything is ok.
@aznime
Also.
How should I check it? Have you a Groovy project?
Sorry for the late reply. I was trying to create a demo project for this purpose.
You can find it here: https://github.com/aznime/jumbo-mobile-tests
@aznime
Thank you. I've started to search for the root cause of the error.
@aznime
Ok. It seems I know the root cause. I think that cglib and reflection are not used properly at some cases and I'm going to fix it.
As a workaround I can advice you to change class modifiers to public.
public class UICatalogWidget extends Widget {
...
}
Can you do it and send a message about the result.
@TikhomirovSergey
I got the same exception after explicitly using the public modifier.
@aznime
The fix is going to be included at 3.4.1 very soon!
The fix has been merged and it is going to be published