@midscene/android 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/cli.mjs CHANGED
@@ -1934,7 +1934,7 @@ class AndroidDevice {
1934
1934
  else if ('up' === param.direction) await this.pullUpRaw(startPoint, param.distance, param.duration);
1935
1935
  else throw new Error(`Unknown pull direction: ${param.direction}`);
1936
1936
  }
1937
- async performActionScroll(param) {
1937
+ async performActionScroll(param, opts) {
1938
1938
  const element = param.locate;
1939
1939
  const startingPoint = element ? {
1940
1940
  left: element.center[0],
@@ -1952,7 +1952,7 @@ class AndroidDevice {
1952
1952
  else if ('right' === param.direction) await this.scrollRightRaw(param.distance || void 0, startingPoint);
1953
1953
  else throw new Error(`Unknown scroll direction: ${param.direction}`);
1954
1954
  else await this.scrollDownRaw(param?.distance || void 0, startingPoint);
1955
- await sleep(500);
1955
+ if (!opts?.skipDefaultWait) await sleep(500);
1956
1956
  }
1957
1957
  }
1958
1958
  async runAdbShellRaw(param, context) {
@@ -3119,7 +3119,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
3119
3119
  const adb = await this.getAdb();
3120
3120
  await adb.shell(`app_process -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -pinch ${adjCenterX} ${adjCenterY} ${adjStartDist} ${adjEndDist} ${opts.duration}`);
3121
3121
  },
3122
- actionScroll: (param)=>this.performActionScroll(param),
3122
+ actionScroll: (param, opts)=>this.performActionScroll(param, opts),
3123
3123
  back: ()=>this.backRaw(),
3124
3124
  home: ()=>this.homeRaw(),
3125
3125
  recentApps: ()=>this.recentAppsRaw(),
@@ -3540,7 +3540,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
3540
3540
  const tools = new AndroidMidsceneTools();
3541
3541
  runToolsCLI(tools, 'midscene-android', {
3542
3542
  stripPrefix: 'android_',
3543
- version: "1.14.0",
3543
+ version: "1.15.0",
3544
3544
  extraCommands: createReportCliCommands()
3545
3545
  }).catch((e)=>{
3546
3546
  process.exit(reportCLIError(e));
package/dist/es/index.mjs CHANGED
@@ -1837,7 +1837,7 @@ class AndroidDevice {
1837
1837
  else if ('up' === param.direction) await this.pullUpRaw(startPoint, param.distance, param.duration);
1838
1838
  else throw new Error(`Unknown pull direction: ${param.direction}`);
1839
1839
  }
1840
- async performActionScroll(param) {
1840
+ async performActionScroll(param, opts) {
1841
1841
  const element = param.locate;
1842
1842
  const startingPoint = element ? {
1843
1843
  left: element.center[0],
@@ -1855,7 +1855,7 @@ class AndroidDevice {
1855
1855
  else if ('right' === param.direction) await this.scrollRightRaw(param.distance || void 0, startingPoint);
1856
1856
  else throw new Error(`Unknown scroll direction: ${param.direction}`);
1857
1857
  else await this.scrollDownRaw(param?.distance || void 0, startingPoint);
1858
- await sleep(500);
1858
+ if (!opts?.skipDefaultWait) await sleep(500);
1859
1859
  }
1860
1860
  }
1861
1861
  async runAdbShellRaw(param, context) {
@@ -3022,7 +3022,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
3022
3022
  const adb = await this.getAdb();
3023
3023
  await adb.shell(`app_process -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -pinch ${adjCenterX} ${adjCenterY} ${adjStartDist} ${adjEndDist} ${opts.duration}`);
3024
3024
  },
3025
- actionScroll: (param)=>this.performActionScroll(param),
3025
+ actionScroll: (param, opts)=>this.performActionScroll(param, opts),
3026
3026
  back: ()=>this.backRaw(),
3027
3027
  home: ()=>this.homeRaw(),
3028
3028
  recentApps: ()=>this.recentAppsRaw(),
package/dist/lib/cli.js CHANGED
@@ -2055,7 +2055,7 @@ ${stdout ? truncateAdbShellStream(stdout, 'stdout') : EMPTY_ADB_SHELL_STDOUT}`;
2055
2055
  else if ('up' === param.direction) await this.pullUpRaw(startPoint, param.distance, param.duration);
2056
2056
  else throw new Error(`Unknown pull direction: ${param.direction}`);
2057
2057
  }
2058
- async performActionScroll(param) {
2058
+ async performActionScroll(param, opts) {
2059
2059
  const element = param.locate;
2060
2060
  const startingPoint = element ? {
2061
2061
  left: element.center[0],
@@ -2073,7 +2073,7 @@ ${stdout ? truncateAdbShellStream(stdout, 'stdout') : EMPTY_ADB_SHELL_STDOUT}`;
2073
2073
  else if ('right' === param.direction) await this.scrollRightRaw(param.distance || void 0, startingPoint);
2074
2074
  else throw new Error(`Unknown scroll direction: ${param.direction}`);
2075
2075
  else await this.scrollDownRaw(param?.distance || void 0, startingPoint);
2076
- await (0, core_utils_namespaceObject.sleep)(500);
2076
+ if (!opts?.skipDefaultWait) await (0, core_utils_namespaceObject.sleep)(500);
2077
2077
  }
2078
2078
  }
2079
2079
  async runAdbShellRaw(param, context) {
@@ -3240,7 +3240,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
3240
3240
  const adb = await this.getAdb();
3241
3241
  await adb.shell(`app_process -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -pinch ${adjCenterX} ${adjCenterY} ${adjStartDist} ${adjEndDist} ${opts.duration}`);
3242
3242
  },
3243
- actionScroll: (param)=>this.performActionScroll(param),
3243
+ actionScroll: (param, opts)=>this.performActionScroll(param, opts),
3244
3244
  back: ()=>this.backRaw(),
3245
3245
  home: ()=>this.homeRaw(),
3246
3246
  recentApps: ()=>this.recentAppsRaw(),
@@ -3560,7 +3560,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
3560
3560
  const tools = new AndroidMidsceneTools();
3561
3561
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
3562
3562
  stripPrefix: 'android_',
3563
- version: "1.14.0",
3563
+ version: "1.15.0",
3564
3564
  extraCommands: (0, core_namespaceObject.createReportCliCommands)()
3565
3565
  }).catch((e)=>{
3566
3566
  process.exit((0, cli_namespaceObject.reportCLIError)(e));
package/dist/lib/index.js CHANGED
@@ -1986,7 +1986,7 @@ ${stdout ? truncateAdbShellStream(stdout, 'stdout') : EMPTY_ADB_SHELL_STDOUT}`;
1986
1986
  else if ('up' === param.direction) await this.pullUpRaw(startPoint, param.distance, param.duration);
1987
1987
  else throw new Error(`Unknown pull direction: ${param.direction}`);
1988
1988
  }
1989
- async performActionScroll(param) {
1989
+ async performActionScroll(param, opts) {
1990
1990
  const element = param.locate;
1991
1991
  const startingPoint = element ? {
1992
1992
  left: element.center[0],
@@ -2004,7 +2004,7 @@ ${stdout ? truncateAdbShellStream(stdout, 'stdout') : EMPTY_ADB_SHELL_STDOUT}`;
2004
2004
  else if ('right' === param.direction) await this.scrollRightRaw(param.distance || void 0, startingPoint);
2005
2005
  else throw new Error(`Unknown scroll direction: ${param.direction}`);
2006
2006
  else await this.scrollDownRaw(param?.distance || void 0, startingPoint);
2007
- await (0, utils_namespaceObject.sleep)(500);
2007
+ if (!opts?.skipDefaultWait) await (0, utils_namespaceObject.sleep)(500);
2008
2008
  }
2009
2009
  }
2010
2010
  async runAdbShellRaw(param, context) {
@@ -3171,7 +3171,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
3171
3171
  const adb = await this.getAdb();
3172
3172
  await adb.shell(`app_process -Djava.class.path=/data/local/tmp/yadb /data/local/tmp com.ysbing.yadb.Main -pinch ${adjCenterX} ${adjCenterY} ${adjStartDist} ${adjEndDist} ${opts.duration}`);
3173
3173
  },
3174
- actionScroll: (param)=>this.performActionScroll(param),
3174
+ actionScroll: (param, opts)=>this.performActionScroll(param, opts),
3175
3175
  back: ()=>this.backRaw(),
3176
3176
  home: ()=>this.homeRaw(),
3177
3177
  recentApps: ()=>this.recentAppsRaw(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/midscene.git",
@@ -47,8 +47,8 @@
47
47
  "appium-adb": "12.12.1",
48
48
  "sharp": "^0.34.3",
49
49
  "zod": "^3.25.1",
50
- "@midscene/core": "1.14.0",
51
- "@midscene/shared": "1.14.0"
50
+ "@midscene/core": "1.15.0",
51
+ "@midscene/shared": "1.15.0"
52
52
  },
53
53
  "optionalDependencies": {
54
54
  "@ffmpeg-installer/ffmpeg": "^1.1.0"
@@ -61,7 +61,7 @@
61
61
  "tsx": "^4.19.2",
62
62
  "typescript": "^5.8.3",
63
63
  "undici": "^6.0.0",
64
- "@midscene/playground": "1.14.0"
64
+ "@midscene/playground": "1.15.0"
65
65
  },
66
66
  "license": "MIT",
67
67
  "scripts": {