Skip to content

Commit a91e7bc

Browse files
committed
Revert "fix: updated performSwipe with w3c protocol (#4154)"
This reverts commit 3b34ae6.
1 parent 3b34ae6 commit a91e7bc

File tree

1 file changed

+12
-36
lines changed

1 file changed

+12
-36
lines changed

Diff for: lib/helper/Appium.js

+12-36
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ let webdriverio;
22

33
const fs = require('fs');
44
const axios = require('axios').default;
5-
const { v4: uuidv4 } = require('uuid');
65

76
const Webdriver = require('./WebDriver');
87
const AssertionFailedError = require('../assert/error');
@@ -1089,40 +1088,17 @@ class Appium extends Webdriver {
10891088
* Appium: support Android and iOS
10901089
*/
10911090
async performSwipe(from, to) {
1092-
await this.browser.performActions([{
1093-
id: uuidv4(),
1094-
type: 'pointer',
1095-
parameters: {
1096-
pointerType: 'touch',
1097-
},
1098-
actions: [
1099-
{
1100-
duration: 0,
1101-
x: from.x,
1102-
y: from.y,
1103-
type: 'pointerMove',
1104-
origin: 'viewport',
1105-
},
1106-
{
1107-
button: 1,
1108-
type: 'pointerDown',
1109-
},
1110-
{
1111-
duration: 600,
1112-
type: 'pause',
1113-
},
1114-
{
1115-
duration: 600,
1116-
x: to.x,
1117-
y: to.y,
1118-
type: 'pointerMove',
1119-
origin: 'viewport',
1120-
},
1121-
{
1122-
button: 1,
1123-
type: 'pointerUp',
1124-
},
1125-
],
1091+
await this.browser.touchPerform([{
1092+
action: 'press',
1093+
options: from,
1094+
}, {
1095+
action: 'wait',
1096+
options: { ms: 1000 },
1097+
}, {
1098+
action: 'moveTo',
1099+
options: to,
1100+
}, {
1101+
action: 'release',
11261102
}]);
11271103
await this.browser.pause(1000);
11281104
}
@@ -1152,7 +1128,7 @@ class Appium extends Webdriver {
11521128
yoffset = 100;
11531129
}
11541130

1155-
return this.swipe(parseLocator.call(this, locator), 0, yoffset, speed);
1131+
return this.swipe(locator, 0, yoffset, speed);
11561132
}
11571133

11581134
/**

0 commit comments

Comments
 (0)