为什么滑动不适用于 Android[React-Native] 上的 appium?

Why swipe doesn't work with appium on Android[React-Native]?

我正在尝试按坐标滑动 (x/y) 我在 appium webite 上找到了这个方法,但它对我不起作用并显示此错误:TypeError: Cannot read property 'performTouchAction' of undefined

这是我的测试代码:

jasmine.DEFAULT_TIMEOUT_INTERVAL = 80000;
const driver = wd.promiseChainRemote('localhost', appiumPORT);

beforeAll(async () => {
    await driver.init(appiumConfigAndroidNoReset);
    await driver.setImplicitWaitTimeout(timeToWaitForElement);
});

test('TCWSF3-uitwoering', async () => {
    try {
        await driver.sleep(15000);

        let action = new wd.TouchAction();
        action.press({x: 600, y: 500});
        action.wait({ms: 500});
        action.moveTo({x: 600, y: 1900});
        action.release();
        await action.perform();
        
    } catch(err) {
        console.log(err);
    }
}); 

这是我的 appium 配置:

platformName: 'Android',
deviceName: 'Pixel 3a',
app: '/Users/test/Desktop/APP/mobile/android/app/build/outputs/apk/app-debug.apk',
platformVersion: '11.0',
appActivity: 'fb.test.MainActivity',
appPackage: 'fb.test.test',
noReset: true, 
fullReset: false,
clearSystemFiles: true,
automationName: 'uiautomator2',
newCommandTimeout: 500,

我找到了这样的解决方案:

      let action = new wd.TouchAction(driver);
      action.press({x: 300, y: 1600})
            .wait(500)
            .moveTo({x: 300, y: 300})
            .release()
            .perform()