-
-
Notifications
You must be signed in to change notification settings - Fork 762
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
Update runAppInBackground method implementation for XCUITest #593
Update runAppInBackground method implementation for XCUITest #593
Conversation
ping @SrinivasanTarget |
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.
@mykola-mokhnach Hi
There are errors of generated javadoc.
Also. Could you provide some test?
|
|
added unit tests. Please let me know if anything else is missing. |
@SrinivasanTarget loks ok. |
937cc91
to
1e2c86e
Compare
@mykola-mokhnach Can you please rebase it with master? |
bc78740
to
0e9b641
Compare
Squashed into single commit. There is nothing new in master so far |
Cool @mykola-mokhnach Thanks. Branch looks clean now. Will review and merge this once #594 is fixed. @TikhomirovSergey is working on fix already. |
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.
PR logically LGTM. But unfortunately it doesn't work for me.Can you look into it?
https://gist.github.com/SrinivasanTarget/e3b06763e17603e15a7e9cfa7407517d
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.
/session/CEF9E752-32C3-4F1B-A5A0-7A33D464D307/wda/homescreen Do we have this endpoint handled in Appium?
Thanks for verification. Seems like there was some change in WDA API. I'll update this in Appium and let you know |
Sure buddy |
This PR should make it working |
@SrinivasanTarget The fix has been merged to xcuitest driver and the stuff should work as expected now. Please make sure the xcuitest driver version is 2.21.0 or greater |
Sure will close this soon.
…On Fri 17 Mar, 2017, 2:03 PM Mykola Mokhnach, ***@***.***> wrote:
@SrinivasanTarget <https://github.com/SrinivasanTarget> The fix has been
merged to xcuitest driver and the stuff should work as expected now. Please
make sure the xcuitest driver version is 2.21.0 or greater
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#593 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIfAJdh2jktnrUgAoigMtISjVQQxvhS9ks5rmkVTgaJpZM4MVX-7>
.
|
@Test public void testPutIntoBackgroundWithoutRestore() { | ||
final long msStarted = System.currentTimeMillis(); | ||
driver.runAppInBackground(-1); | ||
assertThat(System.currentTimeMillis() - msStarted, lessThan(1000L)); |
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.
Functionality worked as expected it didn't restore the app but i think it should also assert for greater than 1000ms. see below
java.lang.AssertionError:
Expected: a value less than <1000L>
but: <1080L> was greater than <1000L>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.junit.Assert.assertThat(Assert.java:956)
at org.junit.Assert.assertThat(Assert.java:923)
at io.appium.java_client.ios.XCUIAutomationTest.testPutIntoBackgroundWithoutRestore(XCUIAutomationTest.java:64)
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:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
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)
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.
Sure, this value, actually, depends on how fast the machine under test is. And Travis, as far as we can see, is quite slow :(
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.
Yeah let's make it greater than for ideal situation.
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.
Or is there anything else that we can assert apart form time?
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.
We could assert some of application elements are not visible
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.
yup sounds good to me
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.
done
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.
cool thanks
0e9b641
to
7cdaa59
Compare
@mykola-mokhnach Will merge this once travis and codacy are happy. Will review other PR later today. |
Change list
See details.
Types of changes
Details
This change is based on appium/appium-xcuitest-driver#381, which makes possible to minimize the application under test and then return to iOS springboard (emulates clicking Home button). The change is breaking since the format of input parameters has been changed for background API call (the old format is still supported, but shows deprecation warning).