alibaba / alibaba/macaca

drag 会触发长按

Open
#583 0 comments 0 reactions 0 assignees View on GitHub
Android needs more info
Dominant language
No language data
Stars
3.2k
Forks
418
PR merge metrics
No merged PRs in 30d

Description

* **Macaca Version**:
2.0.0
* **Macaca Doctor Logs**:
macaca-doctor version: 2.0.0

Node.js checklist:

node env: /usr/local/bin/node
node version: v7.10.0

iOS checklist:

Xcode is installed at: `/Library/Developer/CommandLineTools`
Xcode Command Line Tools is ready, version: 2347.
Xcode is uninstalled
iproxy[usbmuxd] is installed at: `/usr/local/bin/iproxy`
ios_webkit_debug_proxy is installed at: `/usr/local/bin/ios_webkit_debug_proxy`
carthage is uninstalled

Android checklist:

JAVA version is `1.8.0_101`
JAVA_HOME is set to `/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home`
ANDROID_HOME is set to `/usr/local/share/android-sdk`
Platforms is set to `/usr/local/share/android-sdk/platforms/android-25`
ADB tool is set to `/usr/local/share/android-sdk/platform-tools/adb`
Command Line Tools: gradle is uninstalled

Installed driver list:

android: 2.0.17
chrome: 1.0.5
electron: 1.1.6
* **Operate System**:
OSX 10.12.5
* **Programming Language**:
JAVA

```
JSONObject drag_arg = new JSONObject();
drag_arg.put("fromX",windowWidth/2);
drag_arg.put("fromY",centerY);
drag_arg.put("toX",0);
drag_arg.put("toY",centerY);
drag_arg.put("duration",0.001);
driver.touch("drag",drag_arg);
```
查看到drag日志为
```
{"actions":[{"duration":"0.001","type":"drag","fromX":"540","toX":"0","fromY":"895","toY":"895"}]}
```
实际在真机上既有拖动,也会触发长按事件。但我的目的仅仅是拖动,不想触发长按,如何解决呢?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the driver.touch("drag") entry point and compare the emitted drag actions with the reported behavior on a real device. Reproduce the gesture using the supplied coordinates and duration; done means dragging no longer also triggers a long-press event.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, ios, java
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.