assistsx-js 0.0.2004 → 0.0.2010

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.
@@ -14,7 +14,7 @@ export interface AccessibilityEventData {
14
14
  eventType: number;
15
15
  action: number;
16
16
  texts: string[];
17
- node: Node;
17
+ node: Node | null;
18
18
  }
19
19
  /**
20
20
  * 无障碍事件完整结构
package/dist/Node.d.ts CHANGED
@@ -41,6 +41,46 @@ export declare class Node {
41
41
  * 所属步骤ID
42
42
  */
43
43
  stepId: string | undefined;
44
+ /**
45
+ * 提示文本
46
+ */
47
+ hintText: string;
48
+ /**
49
+ * 是否可选择
50
+ */
51
+ isCheckable: boolean;
52
+ /**
53
+ * 是否已选中
54
+ */
55
+ isChecked: boolean;
56
+ /**
57
+ * 是否可聚焦
58
+ */
59
+ isFocusable: boolean;
60
+ /**
61
+ * 是否已聚焦
62
+ */
63
+ isFocused: boolean;
64
+ /**
65
+ * 是否可长按
66
+ */
67
+ isLongClickable: boolean;
68
+ /**
69
+ * 是否为密码字段
70
+ */
71
+ isPassword: boolean;
72
+ /**
73
+ * 是否已选中
74
+ */
75
+ isSelected: boolean;
76
+ /**
77
+ * 是否对用户可见
78
+ */
79
+ isVisibleToUser: boolean;
80
+ /**
81
+ * 绘制顺序
82
+ */
83
+ drawingOrder: number;
44
84
  /**
45
85
  * 构造函数
46
86
  * @param params 节点参数对象
@@ -55,6 +95,16 @@ export declare class Node {
55
95
  isClickable: boolean;
56
96
  isEnabled: boolean;
57
97
  stepId: string | undefined;
98
+ hintText: string;
99
+ isCheckable: boolean;
100
+ isChecked: boolean;
101
+ isFocusable: boolean;
102
+ isFocused: boolean;
103
+ isLongClickable: boolean;
104
+ isPassword: boolean;
105
+ isSelected: boolean;
106
+ isVisibleToUser: boolean;
107
+ drawingOrder: number;
58
108
  });
59
109
  get async(): NodeAsync;
60
110
  /**
@@ -236,6 +286,16 @@ export declare class Node {
236
286
  isClickable: boolean;
237
287
  isEnabled: boolean;
238
288
  stepId: string | undefined;
289
+ hintText: string;
290
+ isCheckable: boolean;
291
+ isChecked: boolean;
292
+ isFocusable: boolean;
293
+ isFocused: boolean;
294
+ isLongClickable: boolean;
295
+ isPassword: boolean;
296
+ isSelected: boolean;
297
+ isVisibleToUser: boolean;
298
+ drawingOrder: number;
239
299
  }): Node;
240
300
  /**
241
301
  * 从JSON数组创建节点数组
package/dist/Node.js CHANGED
@@ -17,6 +17,16 @@ export class Node {
17
17
  this.isClickable = params.isClickable;
18
18
  this.isEnabled = params.isEnabled;
19
19
  this.stepId = params.stepId;
20
+ this.hintText = params.hintText;
21
+ this.isCheckable = params.isCheckable;
22
+ this.isChecked = params.isChecked;
23
+ this.isFocusable = params.isFocusable;
24
+ this.isFocused = params.isFocused;
25
+ this.isLongClickable = params.isLongClickable;
26
+ this.isPassword = params.isPassword;
27
+ this.isSelected = params.isSelected;
28
+ this.isVisibleToUser = params.isVisibleToUser;
29
+ this.drawingOrder = params.drawingOrder;
20
30
  }
21
31
  get async() {
22
32
  return new NodeAsync(this);
@@ -190,6 +190,16 @@ export declare class NodeAsync {
190
190
  isClickable: boolean;
191
191
  isEnabled: boolean;
192
192
  stepId: string | undefined;
193
+ hintText: string;
194
+ isCheckable: boolean;
195
+ isChecked: boolean;
196
+ isFocusable: boolean;
197
+ isFocused: boolean;
198
+ isLongClickable: boolean;
199
+ isPassword: boolean;
200
+ isSelected: boolean;
201
+ isVisibleToUser: boolean;
202
+ drawingOrder: number;
193
203
  }): Node;
194
204
  /**
195
205
  * 从JSON数组创建节点数组
package/dist/Step.js CHANGED
@@ -262,19 +262,15 @@ export class Step {
262
262
  * @param ms 延迟时间(毫秒)
263
263
  * @returns Promise
264
264
  */
265
- delay(ms) {
266
- Step.assert(this.stepId);
267
- return new Promise((resolve, reject) => {
268
- setTimeout(() => {
269
- try {
270
- Step.assert(this.stepId);
271
- resolve();
272
- }
273
- catch (e) {
274
- reject(e);
275
- }
276
- }, ms);
277
- });
265
+ async delay(ms) {
266
+ while (true) {
267
+ ms -= 100;
268
+ if (ms <= 0) {
269
+ break;
270
+ }
271
+ await new Promise((resolve) => setTimeout(resolve, 100));
272
+ Step.assert(this.stepId);
273
+ }
278
274
  }
279
275
  /**
280
276
  * 等待异步方法执行完成
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.2004",
3
+ "version": "0.0.2010",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/src/AssistsX.ts CHANGED
@@ -17,7 +17,7 @@ export interface AccessibilityEventData {
17
17
  eventType: number;
18
18
  action: number;
19
19
  texts: string[];
20
- node: Node;
20
+ node: Node | null;
21
21
  }
22
22
 
23
23
  /**
package/src/Node.ts CHANGED
@@ -54,6 +54,56 @@ export class Node {
54
54
  */
55
55
  stepId: string | undefined;
56
56
 
57
+ /**
58
+ * 提示文本
59
+ */
60
+ hintText: string;
61
+
62
+ /**
63
+ * 是否可选择
64
+ */
65
+ isCheckable: boolean;
66
+
67
+ /**
68
+ * 是否已选中
69
+ */
70
+ isChecked: boolean;
71
+
72
+ /**
73
+ * 是否可聚焦
74
+ */
75
+ isFocusable: boolean;
76
+
77
+ /**
78
+ * 是否已聚焦
79
+ */
80
+ isFocused: boolean;
81
+
82
+ /**
83
+ * 是否可长按
84
+ */
85
+ isLongClickable: boolean;
86
+
87
+ /**
88
+ * 是否为密码字段
89
+ */
90
+ isPassword: boolean;
91
+
92
+ /**
93
+ * 是否已选中
94
+ */
95
+ isSelected: boolean;
96
+
97
+ /**
98
+ * 是否对用户可见
99
+ */
100
+ isVisibleToUser: boolean;
101
+
102
+ /**
103
+ * 绘制顺序
104
+ */
105
+ drawingOrder: number;
106
+
57
107
  /**
58
108
  * 构造函数
59
109
  * @param params 节点参数对象
@@ -68,6 +118,16 @@ export class Node {
68
118
  isClickable: boolean;
69
119
  isEnabled: boolean;
70
120
  stepId: string | undefined;
121
+ hintText: string;
122
+ isCheckable: boolean;
123
+ isChecked: boolean;
124
+ isFocusable: boolean;
125
+ isFocused: boolean;
126
+ isLongClickable: boolean;
127
+ isPassword: boolean;
128
+ isSelected: boolean;
129
+ isVisibleToUser: boolean;
130
+ drawingOrder: number;
71
131
  }) {
72
132
  this.nodeId = params.nodeId;
73
133
  this.text = params.text;
@@ -78,6 +138,16 @@ export class Node {
78
138
  this.isClickable = params.isClickable;
79
139
  this.isEnabled = params.isEnabled;
80
140
  this.stepId = params.stepId;
141
+ this.hintText = params.hintText;
142
+ this.isCheckable = params.isCheckable;
143
+ this.isChecked = params.isChecked;
144
+ this.isFocusable = params.isFocusable;
145
+ this.isFocused = params.isFocused;
146
+ this.isLongClickable = params.isLongClickable;
147
+ this.isPassword = params.isPassword;
148
+ this.isSelected = params.isSelected;
149
+ this.isVisibleToUser = params.isVisibleToUser;
150
+ this.drawingOrder = params.drawingOrder;
81
151
  }
82
152
 
83
153
  public get async(): NodeAsync {
@@ -453,6 +523,16 @@ export class Node {
453
523
  isClickable: boolean;
454
524
  isEnabled: boolean;
455
525
  stepId: string | undefined;
526
+ hintText: string;
527
+ isCheckable: boolean;
528
+ isChecked: boolean;
529
+ isFocusable: boolean;
530
+ isFocused: boolean;
531
+ isLongClickable: boolean;
532
+ isPassword: boolean;
533
+ isSelected: boolean;
534
+ isVisibleToUser: boolean;
535
+ drawingOrder: number;
456
536
  }): Node {
457
537
  return new Node(params);
458
538
  }
package/src/NodeAsync.ts CHANGED
@@ -396,6 +396,16 @@ export class NodeAsync {
396
396
  isClickable: boolean;
397
397
  isEnabled: boolean;
398
398
  stepId: string | undefined;
399
+ hintText: string;
400
+ isCheckable: boolean;
401
+ isChecked: boolean;
402
+ isFocusable: boolean;
403
+ isFocused: boolean;
404
+ isLongClickable: boolean;
405
+ isPassword: boolean;
406
+ isSelected: boolean;
407
+ isVisibleToUser: boolean;
408
+ drawingOrder: number;
399
409
  }): Node {
400
410
  return new Node(params);
401
411
  }
package/src/Step.ts CHANGED
@@ -387,18 +387,15 @@ export class Step {
387
387
  * @param ms 延迟时间(毫秒)
388
388
  * @returns Promise
389
389
  */
390
- delay(ms: number): Promise<void> {
391
- Step.assert(this.stepId);
392
- return new Promise((resolve, reject) => {
393
- setTimeout(() => {
394
- try {
395
- Step.assert(this.stepId);
396
- resolve();
397
- } catch (e) {
398
- reject(e);
399
- }
400
- }, ms);
401
- });
390
+ async delay(ms: number): Promise<void> {
391
+ while (true) {
392
+ ms -= 100;
393
+ if (ms <= 0) {
394
+ break;
395
+ }
396
+ await new Promise((resolve) => setTimeout(resolve, 100));
397
+ Step.assert(this.stepId);
398
+ }
402
399
  }
403
400
 
404
401
  /**