-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
JsonToMobileElementConverter re-design #532
Conversation
- removal of unusal imports - unused MobileElementToJsonConverter was removed - IOSMobileCommandHelper: methods that hide keyboard were moved to MobileCommand
- constants which describe commands that supposed to be common for all the platforms have package-visibility now. - The argument preparation for the lockDevice command was moved to the MobileCommand.
- JsonToMobileElementConverter is not rhe abstract class now. It generates instances of MobileElement subclasses according to current session parameters - JsonToAndroidElementConverter is deprecated now - JsonToIOSElementConverter is depreacated now - JsonToYouiEngineElementConverter is deprecated now. - MobileElement is the abstract class. - the new automation type `youiengine` was added. - more strict contract beetween AppiumDriver subclasses and MobileElement subclasses was provided: - AppiumDriver stays the generic class - AndroidDriver now generates only AndroidElement - IOSDriver now generates only IOSDriver
...and the additional test for AppiumDriver for Android
it is not correct because we automate tot only native apps. There are mobile browsers and hybrid apps.
@SrinivasanTarget @jlipps could you rewiew this PR? |
.get(1)) | ||
.findElementByIosUIAutomation(".elements().withName(\"Answer\")").getText(), null); | ||
} | ||
|
||
@Test public void setValuerTest() { | ||
IOSElement slider = (IOSElement) driver.findElementByClassName("UIASlider"); | ||
IOSElement slider = driver.findElementByClassName("UIASlider"); | ||
slider.setValue("0%"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setValue
seems to be not working now for slider :(
Tested on iOS 9.3. Server Logs: https://gist.github.com/SrinivasanTarget/7202391e8064b7cf8827380064e27e38
org.junit.ComparisonFailure:
Expected :0%
Actual :51%
at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at io.appium.java_client.ios.IOSElementTest.setValuerTest(IOSElementTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Also io.appium.java_client.android.HasSettings API was improved. Now getSettings returns Map instead of JSONObject IOSDriver implements FindsByIosNSPredicate
Change list
Visibility of command constants was changed. The lock command:
JsonToMobileElementConverter re-design:
MobileElementToJsonConverter
was removedJsonToMobileElementConverter
is not rhe abstract class now. It generates instances of MobileElement subclasses according to current session parametersJsonToAndroidElementConverter
is deprecated nowJsonToIOSElementConverter
is depreacated nowJsonToYouiEngineElementConverter
is deprecated now.Additional changes:
the new automation type
youiengine
was added.IOSDriver
now implementsio.appium.java_client.FindsByIosNSPredicate
.these capabilities were added:
IOSMobileCapabilityType#CUSTOM_SSL_CERT
IOSMobileCapabilityType#TAP_WITH_SHORT_PRESS_DURATION
IOSMobileCapabilityType#SCALE_FACTOR
MobileCapabilityType#CLEAR_SYSTEM_FILES
source and tests code cleaning up.
Types of changes
What types of changes are you proposing/introducing to Java client?
Details
The work on #454 is really completed now.
Motivation:
As
AppiumDriver
should not ne abstract then end user should be able to work with found elements. The type of elements should depend on current platform and automation type.