python-client icon indicating copy to clipboard operation
python-client copied to clipboard

bug: driver.swipe() argument "duration" not working in iOS

Open Ryaningli opened this issue 2 years ago • 1 comments

Do I have the most recent component updates?

  • [X] I use the most recent available driver/plugin and server versions

Is the component officially supported by the Appium team?

  • [X] I have verified the component repository is present under the Appium organization in GitHub

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

When I execute driver.swipe with duration=5, it should swipe slowly for 5 seconds, but it ended immediately, didn't last 5 seconds slowly.

Expected Behavior

Swipe slowly in 5 seconds.

Minimal Reproducible Example

from appium import webdriver
import time


caps = {
    'platformName': 'IOS',
    'app': 'xxx',
    'udid': 'xxx',
    'automationName': 'XCUITest',
    'noReset': True
    }

url = 'http://localhost:4723'
driver = webdriver.Remote('http://localhost:4723', caps)
start = time.time()
driver.swipe(36, 320, 36, 320 - 41, duration=5)
print(time.time() - start)    # << 5s

### Environment

- Operating system: macOS Ventura 13.3.1 (a)
- Appium server version (output of `appium --version`): 2.1.3
- Appium driver(s) and their version(s): [email protected] [installed (npm)]
- Appium plugin(s) and their version(s): 
- Node.js version (output of `node --version`): v18.16.0
- `npm` version (output of `npm --version`): 9.5.1
- Last component(s) version which did _not_ exhibit the problem:
- Platform and version under test: iPhone 11 / iOS 16.3.1
- Real device or emulator/simulator: Real device


### Link to Appium Logs

_No response_

### Further Information

_No response_

Ryaningli avatar Sep 08 '23 08:09 Ryaningli

This can be closed as 'not a bug'. Duration should equal millisecs not secs. 5 secs would need duration=500.

Expected Behavior Swipe slowly in 5 seconds.

The reporter's code sample generates the following result: Swipe quickly in 5 milliseconds.

Sources:

lana-20 avatar Apr 15 '24 06:04 lana-20