Skip to content

Commit 3b34ae6

Browse files
MykaLevdependabot[bot]kobenguyentdyaromanactions-user
authored
fix: updated performSwipe with w3c protocol (#4154)
* updated performSwipe with w3c protocol * chore(deps-dev): bump @wdio/utils from 8.27.2 to 8.28.8 (#4152) * fix: I.say would be added to Test.steps object (#4145) * release 3.5.12 (#4156) * release 3.5.12 * fix(webapi): selectOption method (#4157) trim text content value * DOC: Update contributor faces * fixed typescript parameter inputs count * chore(deps-dev): bump testcafe from 3.3.0 to 3.5.0 (#4160) Bumps [testcafe](https://github.com/DevExpress/testcafe) from 3.3.0 to 3.5.0. - [Release notes](https://github.com/DevExpress/testcafe/releases) - [Changelog](https://github.com/DevExpress/testcafe/blob/master/CHANGELOG.md) - [Commits](DevExpress/testcafe@v3.3.0...v3.5.0) --- updated-dependencies: - dependency-name: testcafe dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * updated performSwipe with w3c protocol * fixed typescript parameter inputs count * chore(deps-dev): bump @wdio/sauce-service from 8.27.0 to 8.29.1 (#4161) * removed elementId parameter * updated performSwipe with w3c protocol * fixed typescript parameter inputs count * removed elementId parameter * run mobile tests * run mobile tests * run mobile tests * tweak ci --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: KobeN <[email protected]> Co-authored-by: Roman Diachenko <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: kobenguyent <[email protected]>
1 parent 5e9c486 commit 3b34ae6

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

Diff for: lib/helper/Appium.js

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

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

67
const Webdriver = require('./WebDriver');
78
const AssertionFailedError = require('../assert/error');
@@ -1088,17 +1089,40 @@ class Appium extends Webdriver {
10881089
* Appium: support Android and iOS
10891090
*/
10901091
async performSwipe(from, to) {
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',
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+
],
11021126
}]);
11031127
await this.browser.pause(1000);
11041128
}
@@ -1128,7 +1152,7 @@ class Appium extends Webdriver {
11281152
yoffset = 100;
11291153
}
11301154

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

11341158
/**

0 commit comments

Comments
 (0)