Use weaker interface HasIdentity instead of class RemoteWebElement by asolntsev · Pull Request #432 · appium/java-client
Change list
- io.appium.java_client.TouchAction
- io.appium.java_client.pagefactory_tests.widgets.ios.simple.IOSMovie
Types of changes
- Bugfix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
Details
In java_client code, WebElement parameter is casted to RemoteWebElement.
It makes hard to create proxy object for WebElement (like Selenide and probably some other frameworks do).
Actually only method getId() is used. This method is declared in interface HasIdentity.
This pull request changes few places where WebElement is casted to RemoteWebElement so that it's not casted to HasIdentity instead of RemoteWebElement.
Old code:
new ActionParameter("press", (RemoteWebElement) el);
new code:
new ActionParameter("press", (HasIdentity) el);