メインコンテンツにスキップ

ピンチ

画面上の指定された要素でピンチジェスチャーを実行します。

情報

ピンチはネイティブモバイルジェスチャーに基づいて行われます。次のドライバーのみでサポートされています:

このコマンドは、以下の最新コンポーネントでのみ動作します:

  • Appiumサーバー(バージョン2.0.0以上)
  • appium-uiautomator2-driver(Android用)
  • appium-xcuitest-driver(iOS用)

互換性の問題を避けるために、ローカルまたはクラウドベースのAppium環境を定期的に更新してください。

使用法
$(selector).pinch({ duration, scale })
パラメータ
名前詳細
options
オプション
PinchOptionsピンチオプション(オプション)
options.duration
オプション
numberピンチを実行する速さのミリ秒単位の時間。最小は500 ms、最大は10000 msです。デフォルトは1500 ms(1.5秒)です(オプション)
options.scale
オプション
number画面に対してピンチの大きさを表すスケール。有効な値は0..1の範囲の浮動小数点数であり、1.0は100%です(オプション)
pinch.js
it('should demonstrate a pinch on Google maps', async () => {
const mapsElement = $('//*[@resource-id="com.google.android.apps.maps:id/map_frame"]')
// Pinch with the default duration scale
await mapsElement.pinch()
// Pinch with a custom duration and scale
await mapsElement.pinch({ duration: 4000, scale: 0.9 })
})

Welcome! How can I help?

WebdriverIO AI Copilot