Skip to content
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 swipe #125

Merged
merged 1 commit into from
Aug 26, 2016
Merged

Conversation

minhnguyenphuonghoang
Copy link
Contributor

For using corresponding arguments' name

For using corresponding arguments' name
@serhatbolsu
Copy link
Owner

@minhnguyenphuonghoang btw, I have seen that android works the old way (first point to second point) while ios works like offset.
Please also check if thats the case for you, this might be not working for both platforms.

@minhnguyenphuonghoang
Copy link
Contributor Author

Hi @serhatbolsu
I just reviewed on both iOS and Android. I'm not sure why someone has changed the documentation of this keyword.
Both Android and iOS have received start point and end point location.
I'm testing with vertical swipe from bottom to top (if it is an offset-swipe, it should swipe from top to bottom)

For iOS, vertical swipe seems not to work, I tried to swipe horizontally

  • iOS, using a test app (xCode 6.4 - 8.4) - work as expected. It used start point and end point.
  • iOS, using the same test app (xCode 7.2 - iOS 9.2) doesn't work at all (detailed log below).
    Anyway, I just want to change arguments' name to make this method works.

Log:
2016-08-19 08:22:15:878 - [HTTP] --> POST /wd/hub/session/1782a18f-0c35-43e8-80ae-6f040310e0be/touch/perform {"sessionId":"1782a18f-0c35-43e8-80ae-6f040310e0be","actions":[{"action":"press","options":{"y":"130","x":"150"}},{"action":"wait","options":{"ms":1000}},{"action":"moveTo","options":{"y":"0","x":"50"}},{"action":"release","options":{}}]}
2016-08-19 08:22:15:894 - [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{"action":"press","option...
2016-08-19 08:22:15:895 - [debug] [iOS] Executing iOS command 'performTouch'
2016-08-19 08:22:15:900 - [debug] [UIAuto] Sending command to instruments: target.touch([{"touch":[{"x":"150","y":"130"}],"time":0.2},{"touch":[{"x":"150","y":"130"}],"time":1.2},{"touch":[{"x":"50150","y":"0130"}],"time":1.4}])
2016-08-19 08:22:16:091 - [debug] [Instruments] [INST] 2016-08-19 08:22:16 +0000 Debug: Got new command 3 from instruments: target.touch([{"touch":[{"x":"150","y":"130"}],"time":0.2},{"touch":[{"x":"150","y":"130"}],"time":1.2},{"touch":[{"x":"50150","y":"0130"}],"time":1.4}])
2016-08-19 08:22:16:092 - [debug] [Instruments] [INST] 2016-08-19 08:22:16 +0000 Debug: evaluating target.touch([{"touch":[{"x":"150","y":"130"}],"time":0.2},{"touch":[{"x":"150","y":"130"}],"time":1.2},{"touch":[{"x":"50150","y":"0130"}],"time":1.4}])
2016-08-19 08:22:16:093 - [debug] [Instruments] [INST] 2016-08-19 08:22:16 +0000 Debug: target.touch(__NSCFArray)
2016-08-19 08:22:17:353 - [debug] [Instruments] [INST] 2016-08-19 08:22:17 +0000 Debug: point is not within the bounds of the screen
2016-08-19 08:22:17:543 - [debug] [UIAuto] Socket data received (70 bytes)
2016-08-19 08:22:17:545 - [debug] [UIAuto] Got result from instruments: {"status":17,"value":"point is not within the bounds of the screen"}
2016-08-19 08:22:17:550 - [HTTP] <-- POST /wd/hub/session/1782a18f-0c35-43e8-80ae-6f040310e0be/touch/perform 500 1670 ms - 131
2016-08-19 08:22:17:750 - [debug] [Instruments] [INST] 2016-08-19 08:22:17 +0000 Error: VerboseError: point is not within the bounds of the screen
2016-08-19 08:22:17:835 - [debug] [Instruments] [INST] 2016-08-19 08:22:17 +0000 Error: Error during eval: touch@[native code]
eval code
eval@[native code]
startProcessing@file:///Users/minhshome/279BB2B7-1EBF-4B16-AA5E-185CB1FCD39A/bootstrap-68606feb57f42848.js:2793:30
bootstrap@file:///Users/minhshome/279BB2B7-1EBF-4B16-AA5E-185CB1FCD39A/bootstrap-68606feb57f42848.js:2861:31
global code@file:///Users/minhshome/279BB2B7-1EBF-4B16-AA5E-185CB1FCD39A/bootstrap-68606feb57f42848.js:2870:10
2016-08-19 08:22:17:836 - [debug] [Instruments] [INST] 2016-08-19 08:22:17 +0000 Debug: responding with:
2016-08-19 08:22:17:838 - [debug] [Instruments] [INST] 2016-08-19 08:22:17 +0000 Debug: Running system command #4: /usr/local/Cellar/node/6.3.0/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/hy/1n6hb4pn00qcmndzbd9417_40000gn/T/instruments_sock 2,{"status":17,"value":"point is not within the bounds of the scr...

@serhatbolsu
Copy link
Owner

I am working with Xcode 7.3 ios 9.3 and the new way of : x, y, x-offset, y-offset works for me.
So it seems like there is no fix to cover both platforms right now which is (I believe) will be fixed soon

@serhatbolsu
Copy link
Owner

In order to summarise this issue:

IOS works like:

Swipe  ${x_start}  ${y_start}  ${x_end}  ${y_end}
# ex. swipe up -->
Swipe  ${500}  ${500}  ${0}  ${-300}

ANDROID works like:

Swipe  ${x_start}  ${y_start}  ${x_offset}  ${y_offset}
# ex. swipe up -->
Swipe  ${500}  ${500}  ${500}  ${200}

This looks like a fix for current situation in Appium 1.5.3, it should actually behave like it does in iOS. I believe it will be fixed in later versions of Appium, till then:

@minhnguyenphuonghoang if you can please keep the code as it is but update the documentation, if you can not, I will close this pull request and make a new one

@minhnguyenphuonghoang
Copy link
Contributor Author

minhnguyenphuonghoang commented Aug 26, 2016

Hi @serhatbolsu
Actually, I don't care too much on what is documented since we can concatenate the keyword description of both Android and iOS.

I just want to fix its arguments as mentioned above.

In this keyword, we have 5 arguments: start_x, start_y, offset_x, offset_y, duration
But in the implementation of this keyword, instead of using offset_x, offset_y he used end_x, end_y.
That's why it's always failed.

@serhatbolsu
Copy link
Owner

Lets first fix the obvious mistake. @minhnguyenphuonghoang obviously library need more test cases

Thank you,

@serhatbolsu serhatbolsu merged commit cc6a36f into serhatbolsu:master Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants