• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License,Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *   http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing,software
10 * distributed under the License is distributed on an "ASIS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit ArkUI
19 */
20
21/**
22 * Enumerates the value TestCaseType.
23 *
24 * @enum {number}
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @atomicservice
27 * @since 11
28 */
29declare enum TestCaseType {
30  /**
31   * FUNCTION.
32   *
33   * @syscap SystemCapability.ArkUI.ArkUI.Full
34   * @atomicservice
35   * @since 11
36   */
37  FUNCTION = 0,
38  /**
39   * PERFORMANCE.
40   *
41   * @syscap SystemCapability.ArkUI.ArkUI.Full
42   * @atomicservice
43   * @since 11
44   */
45  PERFORMANCE = 1,
46  /**
47   * POWER.
48   *
49   * @syscap SystemCapability.ArkUI.ArkUI.Full
50   * @atomicservice
51   * @since 11
52   */
53  POWER = 2,
54  /**
55   * RELIABILITY.
56   *
57   * @syscap SystemCapability.ArkUI.ArkUI.Full
58   * @atomicservice
59   * @since 11
60   */
61  RELIABILITY = 3,
62  /**
63   * SECURITY.
64   *
65   * @syscap SystemCapability.ArkUI.ArkUI.Full
66   * @atomicservice
67   * @since 11
68   */
69  SECURITY = 4,
70  /**
71   * GLOBAL.
72   *
73   * @syscap SystemCapability.ArkUI.ArkUI.Full
74   * @atomicservice
75   * @since 11
76   */
77  GLOBAL = 5,
78  /**
79   * COMPATIBILITY.
80   *
81   * @syscap SystemCapability.ArkUI.ArkUI.Full
82   * @atomicservice
83   * @since 11
84   */
85  COMPATIBILITY = 6,
86  /**
87   * USER.
88   *
89   * @syscap SystemCapability.ArkUI.ArkUI.Full
90   * @atomicservice
91   * @since 11
92   */
93  USER = 7,
94  /**
95   * STANDARD.
96   *
97   * @syscap SystemCapability.ArkUI.ArkUI.Full
98   * @atomicservice
99   * @since 11
100   */
101  STANDARD = 8,
102  /**
103   * SAFETY.
104   *
105   * @syscap SystemCapability.ArkUI.ArkUI.Full
106   * @atomicservice
107   * @since 11
108   */
109  SAFETY = 9,
110  /**
111   * RESILIENCE.
112   *
113   * @syscap SystemCapability.ArkUI.ArkUI.Full
114   * @atomicservice
115   * @since 11
116   */
117  RESILIENCE = 10
118}
119
120/**
121 * Enumerates the value TestCaseSize.
122 *
123 * @enum {number}
124 * @syscap SystemCapability.ArkUI.ArkUI.Full
125 * @atomicservice
126 * @since 11
127 */
128declare enum TestCaseSize {
129  /**
130   * SMALLTEST.
131   *
132   * @syscap SystemCapability.ArkUI.ArkUI.Full
133   * @atomicservice
134   * @since 11
135   */
136  SMALLTEST = 0,
137  /**
138   * MEDIUMTEST.
139   *
140   * @syscap SystemCapability.ArkUI.ArkUI.Full
141   * @atomicservice
142   * @since 11
143   */
144  MEDIUMTEST = 1,
145  /**
146   * LARGETEST.
147   *
148   * @syscap SystemCapability.ArkUI.ArkUI.Full
149   * @atomicservice
150   * @since 11
151   */
152  LARGETEST = 2
153}
154
155/**
156 * Enumerates the value TestCaseLevel.
157 *
158 * @enum {number}
159 * @syscap SystemCapability.ArkUI.ArkUI.Full
160 * @atomicservice
161 * @since 11
162 */
163declare enum TestCaseLevel {
164  /**
165   * LEVEL0.
166   *
167   * @syscap SystemCapability.ArkUI.ArkUI.Full
168   * @atomicservice
169   * @since 11
170   */
171  LEVEL0 = 0,
172  /**
173   * LEVEL1.
174   *
175   * @syscap SystemCapability.ArkUI.ArkUI.Full
176   * @atomicservice
177   * @since 11
178   */
179  LEVEL1 = 1,
180  /**
181   * LEVEL2.
182   *
183   * @syscap SystemCapability.ArkUI.ArkUI.Full
184   * @atomicservice
185   * @since 11
186   */
187  LEVEL2 = 2,
188  /**
189   * LEVEL3.
190   *
191   * @syscap SystemCapability.ArkUI.ArkUI.Full
192   * @atomicservice
193   * @since 11
194   */
195  LEVEL3 = 3,
196  /**
197   * LEVEL4.
198   *
199   * @syscap SystemCapability.ArkUI.ArkUI.Full
200   * @atomicservice
201   * @since 11
202   */
203  LEVEL4 = 4
204}
205
206/**
207 * Represents the attribute of the test case.
208 *
209 * @typedef TestCaseAttribute
210 * @syscap SystemCapability.ArkUI.ArkUI.Full
211 * @atomicservice
212 * @since 11
213 */
214declare interface TestCaseAttribute {
215  /**
216   * test case type.
217   *
218   * @type {TestCaseType}
219   * @syscap SystemCapability.ArkUI.ArkUI.Full
220   * @atomicservice
221   * @since 11
222   */
223  type?: TestCaseType;
224  /**
225   * test case size.
226   *
227   * @type {TestCaseSize}
228   * @syscap SystemCapability.ArkUI.ArkUI.Full
229   * @atomicservice
230   * @since 11
231   */
232  size?: TestCaseSize;
233  /**
234   * test case level.
235   *
236   * @type {TestCaseLevel}
237   * @syscap SystemCapability.ArkUI.ArkUI.Full
238   * @atomicservice
239   * @since 11
240   */
241  level: TestCaseLevel;
242}
243
244/**
245 * Enumerates the string value match type.
246 *
247 * @enum {number}
248 * @syscap SystemCapability.ArkUI.ArkUI.Full
249 * @atomicservice
250 * @since 11
251 */
252declare enum MatchType {
253  /**
254   * Equals to a string.
255   *
256   * @syscap SystemCapability.ArkUI.ArkUI.Full
257   * @atomicservice
258   * @since 11
259   */
260  EQUALS = 0,
261  /**
262   * Contains a substring.
263   *
264   * @syscap SystemCapability.ArkUI.ArkUI.Full
265   * @atomicservice
266   * @since 11
267   */
268  CONTAINS = 1,
269  /**
270   * StartsWith a substring.
271   *
272   * @syscap SystemCapability.ArkUI.ArkUI.Full
273   * @atomicservice
274   * @since 11
275   */
276  STARTS_WITH = 2,
277  /**
278   * EndsWith a substring.
279   *
280   * @syscap SystemCapability.ArkUI.ArkUI.Full
281   * @atomicservice
282   * @since 11
283   */
284  ENDS_WITH = 3
285}
286
287/**
288 * Represents the point on the device screen.
289 *
290 * @typedef Point
291 * @syscap SystemCapability.ArkUI.ArkUI.Full
292 * @atomicservice
293 * @since 11
294 */
295declare interface Point {
296  /**
297   * The x-coordinate of the coordinate point.
298   *
299   * @type { number }
300   * @syscap SystemCapability.ArkUI.ArkUI.Full
301   * @atomicservice
302   * @since 11
303   */
304  readonly x: number;
305  /**
306   * The y-coordinate of the coordinate point.
307   *
308   * @type { number }
309   * @syscap SystemCapability.ArkUI.ArkUI.Full
310   * @atomicservice
311   * @since 11
312   */
313  readonly y: number;
314}
315
316/**
317 * Represents the rectangle area on the device screen.
318 *
319 * @typedef Rect
320 * @syscap SystemCapability.ArkUI.ArkUI.Full
321 * @atomicservice
322 * @since 11
323 */
324declare interface Rect {
325  /**
326   * The x-coordinate of the top left corner of the rectangle.
327   *
328   * @type { number }
329   * @syscap SystemCapability.ArkUI.ArkUI.Full
330   * @atomicservice
331   * @since 11
332   */
333  readonly left: number;
334  /**
335   * The y-coordinate of the top left corner of the rectangle.
336   *
337   * @type { number }
338   * @syscap SystemCapability.ArkUI.ArkUI.Full
339   * @atomicservice
340   * @since 11
341   */
342  readonly top: number;
343  /**
344   * The x-coordinate at the bottom right corner of the rectangle.
345   *
346   * @type { number }
347   * @syscap SystemCapability.ArkUI.ArkUI.Full
348   * @atomicservice
349   * @since 11
350   */
351  readonly right: number;
352  /**
353   * The y-coordinate at the bottom right corner of the rectangle.
354   *
355   * @type { number }
356   * @syscap SystemCapability.ArkUI.ArkUI.Full
357   * @atomicservice
358   * @since 11
359   */
360  readonly bottom: number;
361}
362
363/**
364 * Enumerates the direction for the UI operation .
365 *
366 * @enum { number }
367 * @syscap SystemCapability.ArkUI.ArkUI.Full
368 * @atomicservice
369 * @since 11
370 */
371declare enum UiDirection {
372  /**
373   * Left.
374   *
375   * @syscap SystemCapability.ArkUI.ArkUI.Full
376   * @atomicservice
377   * @since 11
378   */
379  LEFT = 0,
380  /**
381   * Right.
382   *
383   * @syscap SystemCapability.ArkUI.ArkUI.Full
384   * @atomicservice
385   * @since 11
386   */
387  RIGHT = 1,
388  /**
389   * Up.
390   *
391   * @syscap SystemCapability.ArkUI.ArkUI.Full
392   * @atomicservice
393   * @since 11
394   */
395  UP = 2,
396  /**
397   * Down.
398   *
399   * @syscap SystemCapability.ArkUI.ArkUI.Full
400   * @atomicservice
401   * @since 11
402   */
403  DOWN = 3
404}
405
406/**
407 * Describes the attribute requirements for the target Components.
408 *
409 * @syscap SystemCapability.ArkUI.ArkUI.Full
410 * @atomicservice
411 * @since 11
412 */
413declare class Matcher {
414  /**
415   * Create an {@link Matcher} object.
416   *
417   * @returns { Matcher } the {@link Matcher} object.
418   * @throws { BusinessError } 17000001 - if the test framework failed to initialize.
419   * @syscap SystemCapability.ArkUI.ArkUI.Full
420   * @atomicservice
421   * @since 11
422   */
423  static create(): Matcher;
424  /**
425   * Specifies the text for the target Component.
426   *
427   * @param { string } text - the text value.
428   * @param { MatchType } [matchType] - the {@link MatchType} of the text value,Set it default {@link MatchType.EQUALS} if null or undefined.
429   * @returns { Matcher } this {@link Matcher} object.
430   * @throws { BusinessError } 401 - if the input parameters are invalid.
431   * @syscap SystemCapability.ArkUI.ArkUI.Full
432   * @atomicservice
433   * @since 11
434   */
435  text(text: string, matchType?: MatchType): Matcher;
436  /**
437   * Specifies the id of the target Component.
438   *
439   * @param { string } id - the id value.
440   * @returns { Matcher } this {@link Matcher} object.
441   * @throws { BusinessError } 401 - if the input parameters are invalid.
442   * @syscap SystemCapability.ArkUI.ArkUI.Full
443   * @atomicservice
444   * @since 11
445   */
446  id(id: string): Matcher;
447  /**
448   * Specifies the type of the target Component.
449   *
450   * @param { string } type - the type value.
451   * @returns { Matcher } this {@link Matcher} object.
452   * @throws { BusinessError } 401 - if the input parameters are invalid.
453   * @syscap SystemCapability.ArkUI.ArkUI.Full
454   * @atomicservice
455   * @since 11
456   */
457  type(type: string): Matcher;
458  /**
459   * Specifies the clickable of the target Component.
460   *
461   * @param { boolean } b - the clickable status,default to true.Set it default if null or undefined.
462   * @returns { Matcher } this {@link Matcher} object.
463   * @throws { BusinessError } 401 - if the input parameters are invalid.
464   * @syscap SystemCapability.ArkUI.ArkUI.Full
465   * @atomicservice
466   * @since 11
467   */
468  clickable(b?: boolean): Matcher;
469  /**
470   * Specifies the longPressable of the target Component.
471   *
472   * @param { boolean } b - the longPressable status,default to true.Set it default if null or undefined.
473   * @returns { Matcher } this {@link Matcher} object.
474   * @throws { BusinessError } 401 - if the input parameters are invalid.
475   * @syscap SystemCapability.ArkUI.ArkUI.Full
476   * @atomicservice
477   * @since 11
478   */
479  longPressable(b?: boolean): Matcher;
480  /**
481   * Specifies the scrollable of the target Component.
482   *
483   * @param { boolean } b - the scrollable status,default to true.Set it default if null or undefined.
484   * @returns { Matcher } this {@link Matcher} object.
485   * @throws { BusinessError } 401 - if the input parameters are invalid.
486   * @syscap SystemCapability.ArkUI.ArkUI.Full
487   * @atomicservice
488   * @since 11
489   */
490  scrollable(b?: boolean): Matcher;
491  /**
492   * Specifies the enabled of the target Component.
493   *
494   * @param { boolean } b - the enabled status,default to true.Set it default if null or undefined.
495   * @returns { Matcher } this {@link Matcher} object.
496   * @throws { BusinessError } 401 - if the input parameters are invalid.
497   * @syscap SystemCapability.ArkUI.ArkUI.Full
498   * @atomicservice
499   * @since 11
500   */
501  enabled(b?: boolean): Matcher;
502  /**
503   * Specifies the focused of the target Component.
504   *
505   * @param { boolean } b - the focused status,default to true.Set it default if null or undefined.
506   * @returns { Matcher } this {@link Matcher} object.
507   * @throws { BusinessError } 401 - if the input parameters are invalid.
508   * @syscap SystemCapability.ArkUI.ArkUI.Full
509   * @atomicservice
510   * @since 11
511   */
512  focused(b?: boolean): Matcher;
513  /**
514   * Specifies the selected of the target Component.
515   *
516   * @param { boolean } b - the selected status,default to true.Set it default if null or undefined.
517   * @returns { Matcher } this {@link Matcher} object.
518   * @throws { BusinessError } 401 - if the input parameters are invalid.
519   * @syscap SystemCapability.ArkUI.ArkUI.Full
520   * @atomicservice
521   * @since 11
522   */
523  selected(b?: boolean): Matcher;
524  /**
525   * Specifies the checked of the target Component.
526   *
527   * @param { boolean } b - the checked status,default to false.Set it default if null or undefined.
528   * @returns { Matcher } this {@link Matcher} object.
529   * @throws { BusinessError } 401 - if the input parameters are invalid.
530   * @syscap SystemCapability.ArkUI.ArkUI.Full
531   * @atomicservice
532   * @since 11
533   */
534  checked(b?: boolean): Matcher;
535  /**
536   * Specifies the checkable of the target Component.
537   *
538   * @param { boolean } b - the checkable status,default to false.Set it default if null or undefined.
539   * @returns { Matcher } this {@link Matcher} object.
540   * @throws { BusinessError } 401 - if the input parameters are invalid.
541   * @syscap SystemCapability.ArkUI.ArkUI.Full
542   * @atomicservice
543   * @since 11
544   */
545  checkable(b?: boolean): Matcher;
546}
547
548/**
549 * Represents an Component of the ohos application,user can perform operations or query attributes on it.
550 *
551 * @syscap SystemCapability.ArkUI.ArkUI.Full
552 * @atomicservice
553 * @since 11
554 * @test
555 */
556declare class Component {
557  /**
558   * Tap this {@link Component}.
559   *
560   * @returns { Promise<void> }
561   * @throws { BusinessError } 17000002 - if the async function was not called with await.
562   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
563   * @syscap SystemCapability.ArkUI.ArkUI.Full
564   * @atomicservice
565   * @since 11
566   */
567  tap(): Promise<void>;
568  /**
569   * Double tap this {@link Component}.
570   *
571   * @returns { Promise<void> }
572   * @throws { BusinessError } 17000002 - if the async function was not called with await.
573   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
574   * @syscap SystemCapability.ArkUI.ArkUI.Full
575   * @atomicservice
576   * @since 11
577   */
578  doubleTap(): Promise<void>;
579  /**
580   * Press this {@link Component}.
581   *
582   * @returns { Promise<void> }
583   * @throws { BusinessError } 17000002 - if the async function was not called with await.
584   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
585   * @syscap SystemCapability.ArkUI.ArkUI.Full
586   * @atomicservice
587   * @since 11
588   */
589  press(duration?: number): Promise<void>;
590  /**
591   * Pinch enlarge this {@link Component} to the target scale.
592   *
593   * @param { number } scale - the scale of the pinch enlarge this {@link Component}'s size.
594   * @returns { Promise<void> }
595   * @throws { BusinessError } 401 - if the input parameters are invalid.
596   * @throws { BusinessError } 17000002 - if the async function was not called with await.
597   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
598   * @syscap SystemCapability.ArkUI.ArkUI.Full
599   * @atomicservice
600   * @since 11
601   */
602  pinchOut(scale: number): Promise<void>;
603  /**
604   * Pinch shrink this {@link Component} to the target scale.
605   *
606   * @param { number } scale - the scale of the pinch shrink this {@link Component}'s size.
607   * @returns { Promise<void> }
608   * @throws { BusinessError } 401 - if the input parameters are invalid.
609   * @throws { BusinessError } 17000002 - if the async function was not called with await.
610   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
611   * @syscap SystemCapability.ArkUI.ArkUI.Full
612   * @atomicservice
613   * @since 11
614   */
615  pinchIn(scale: number): Promise<void>;
616  /**
617   * Inject text to this {@link Component}, applicable to TextInput.
618   *
619   * @param { string } text - the text to inject.
620   * @returns { Promise<void> }
621   * @throws { BusinessError } 401 - if the input parameters are invalid.
622   * @throws { BusinessError } 17000002 - if the async function was not called with await.
623   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
624   * @syscap SystemCapability.ArkUI.ArkUI.Full
625   * @atomicservice
626   * @since 11
627   */
628  inputText(text: string): Promise<void>;
629  /**
630   * Clear text to this {@link Component}, applicable to TextInput.
631   *
632   * @returns { Promise<void> }
633   * @throws { BusinessError } 401 - if the input parameters are invalid.
634   * @throws { BusinessError } 17000002 - if the async function was not called with await.
635   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
636   * @syscap SystemCapability.ArkUI.ArkUI.Full
637   * @atomicservice
638   * @since 11
639   */
640  clearText(): Promise<void>;
641  /**
642   * Scroll on this {@link Component} to the top,applicable to scrollable one.
643   *
644   * @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000.Set it default 600 if out of range or null or undefined.
645   * @returns { Promise<void> }
646   * @throws { BusinessError } 401 - if the input parameters are invalid.
647   * @throws { BusinessError } 17000002 - if the async function was not called with await.
648   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
649   * @syscap SystemCapability.ArkUI.ArkUI.Full
650   * @atomicservice
651   * @since 11
652   */
653  scrollToTop(speed?: number): Promise<void>;
654  /**
655   * Scroll on this {@link Component} to the bottom,applicable to scrollable one.
656   *
657   * @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined.
658   * @returns { Promise<void> }
659   * @throws { BusinessError } 401 - if the input parameters are invalid.
660   * @throws { BusinessError } 17000002 - if the async function was not called with await.
661   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
662   * @syscap SystemCapability.ArkUI.ArkUI.Full
663   * @atomicservice
664   * @since 11
665   */
666  scrollToBottom(speed?: number): Promise<void>;
667  /**
668   * Get the id attribute value.
669   *
670   * @returns { Promise<string> } the id value.
671   * @throws { BusinessError } 17000002 - if the async function was not called with await.
672   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
673   * @syscap SystemCapability.ArkUI.ArkUI.Full
674   * @atomicservice
675   * @since 11
676   */
677  getId(): Promise<string>;
678  /**
679   * Get the text attribute value.
680   *
681   * @returns { Promise<string> } the text value.
682   * @throws { BusinessError } 17000002 - if the async function was not called with await.
683   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
684   * @syscap SystemCapability.ArkUI.ArkUI.Full
685   * @atomicservice
686   * @since 11
687   */
688  getText(): Promise<string>;
689  /**
690   * Get the type attribute value.
691   *
692   * @returns { Promise<string> } the type value.
693   * @throws { BusinessError } 17000002 - if the async function was not called with await.
694   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
695   * @syscap SystemCapability.ArkUI.ArkUI.Full
696   * @atomicservice
697   * @since 11
698   */
699  getType(): Promise<string>;
700  /**
701   * Get the clickable status of this {@link Component}.
702   *
703   * @returns { Promise<boolean> } the clickable status.
704   * @throws { BusinessError } 17000002 - if the async function was not called with await.
705   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
706   * @syscap SystemCapability.ArkUI.ArkUI.Full
707   * @atomicservice
708   * @since 11
709   */
710  isClickable(): Promise<boolean>;
711  /**
712   * Get the long pressable status of this {@link Component}.
713   *
714   * @returns { Promise<boolean> } the long pressable status.
715   * @throws { BusinessError } 17000002 - if the async function was not called with await.
716   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
717   * @syscap SystemCapability.ArkUI.ArkUI.Full
718   * @atomicservice
719   * @since 11
720   */
721  isLongPressable(): Promise<boolean>;
722  /**
723   * Get the isScrollable status of this {@link Component}.
724   *
725   * @returns { Promise<boolean> } the isScrollable status.
726   * @throws { BusinessError } 17000002 - if the async function was not called with await.
727   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
728   * @syscap SystemCapability.ArkUI.ArkUI.Full
729   * @atomicservice
730   * @since 11
731   */
732  isScrollable(): Promise<boolean>;
733  /**
734   * Get the isEnabled status of this {@link Component}.
735   *
736   * @returns { Promise<boolean> } the isEnabled status.
737   * @throws { BusinessError } 17000002 - if the async function was not called with await.
738   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
739   * @syscap SystemCapability.ArkUI.ArkUI.Full
740   * @atomicservice
741   * @since 11
742   */
743  isEnabled(): Promise<boolean>;
744  /**
745   * Get the isFocused status of this {@link Component}.
746   *
747   * @returns { Promise<boolean> } the isFocused status.
748   * @throws { BusinessError } 17000002 - if the async function was not called with await.
749   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
750   * @syscap SystemCapability.ArkUI.ArkUI.Full
751   * @atomicservice
752   * @since 11
753   */
754  isFocused(): Promise<boolean>;
755  /**
756   * Get the isSelected status of this {@link Component}.
757   *
758   * @returns { Promise<boolean> } the isSelected status.
759   * @throws { BusinessError } 17000002 - if the async function was not called with await.
760   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
761   * @syscap SystemCapability.ArkUI.ArkUI.Full
762   * @atomicservice
763   * @since 11
764   */
765  isSelected(): Promise<boolean>;
766  /**
767   * Get the isChecked status of this {@link Component}.
768   *
769   * @returns { Promise<boolean> } the isChecked status.
770   * @throws { BusinessError } 17000002 - if the async function was not called with await.
771   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
772   * @syscap SystemCapability.ArkUI.ArkUI.Full
773   * @atomicservice
774   * @since 11
775   */
776  isChecked(): Promise<boolean>;
777  /**
778   * Get the isCheckable status of this {@link Component}.
779   *
780   * @returns { Promise<boolean> } the isCheckable status.
781   * @throws { BusinessError } 17000002 - if the async function was not called with await.
782   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
783   * @syscap SystemCapability.ArkUI.ArkUI.Full
784   * @atomicservice
785   * @since 11
786   */
787  isCheckable(): Promise<boolean>;
788  /**
789   * Get the inspector info of this {@link Component}.
790   *
791   * @returns { Promise<string> } the inspector info value.
792   * @throws { BusinessError } 17000002 - if the async function was not called with await.
793   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
794   * @syscap SystemCapability.ArkUI.ArkUI.Full
795   * @atomicservice
796   * @since 11
797   */
798  getInspectorInfo(): Promise<string>;
799  /**
800   * Get the inspector tree of this {@link Component}.
801   *
802   * @returns { Promise<string> } the inspector tree value.
803   * @throws { BusinessError } 17000002 - if the async function was not called with await.
804   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
805   * @syscap SystemCapability.ArkUI.ArkUI.Full
806   * @atomicservice
807   * @since 11
808   */
809  getInspectorTree(): Promise<string>;
810  /**
811   * Get the child count of this {@link Component}.
812   *
813   * @returns { Promise<string> } the child count value.
814   * @throws { BusinessError } 17000002 - if the async function was not called with await.
815   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
816   * @syscap SystemCapability.ArkUI.ArkUI.Full
817   * @atomicservice
818   * @since 11
819   */
820  getChildCount(): Promise<number>;
821  /**
822   * Get the bounds rect of this {@link Component}.
823   *
824   * @returns { Promise<Rect> } the bounds rect object.
825   * @throws { BusinessError } 17000002 - if the async function was not called with await.
826   * @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
827   * @syscap SystemCapability.ArkUI.ArkUI.Full
828   * @atomicservice
829   * @since 11
830   */
831  getBounds(): Promise<Rect>;
832}
833
834/**
835 * The unified facade of UiTest framework,can be used to find {@link Component},trigger keyEvents,perform
836 * coordinates-based UI actions,capture screen and so on.
837 *
838 * @syscap SystemCapability.ArkUI.ArkUI.Full
839 * @atomicservice
840 * @since 11
841 * @test
842 */
843declare class Tester {
844  /**
845   * Create an {@link Tester} object.
846   *
847   * @returns { Tester } the {@link Tester} object.
848   * @throws { BusinessError } 17000001 - if the test framework failed to initialize.
849   * @syscap SystemCapability.ArkUI.ArkUI.Full
850   * @atomicservice
851   * @since 11
852   */
853  static create(): Tester;
854  /**
855   * Delay with specified duration.
856   *
857   * @param { number } duration - the delay duration in milliseconds.
858   * @returns { Promise<void> }
859   * @throws { BusinessError } 401 - if the input parameters are invalid.
860   * @throws { BusinessError } 17000002 - if the async function was not called with await.
861   * @syscap SystemCapability.ArkUI.ArkUI.Full
862   * @atomicservice
863   * @since 11
864   */
865  pump(delayMs?: number): Promise<void>;
866  /**
867   * Find the first matched {@link Component} on current UI.
868   *
869   * @param { Matcher } pattern The attribute requirements of the target {@link Component}.
870   * @returns { Promise<Component> } the first matched {@link Component} or undefined.
871   * @throws { BusinessError } 401 - if the input parameters are invalid.
872   * @throws { BusinessError } 17000002 - if the async function was not called with await.
873   * @syscap SystemCapability.ArkUI.ArkUI.Full
874   * @atomicservice
875   * @since 11
876   */
877  findComponent(pattern: Matcher): Promise<Component>;
878  /**
879   * Find all the matched {@link Component}s on current UI.
880   *
881   * @param { Matcher } pattern The attribute requirements of the target {@link Component}.
882   * @returns { Promise<Array<Component>> } the matched {@link Component}s list.
883   * @throws { BusinessError } 401 - if the input parameters are invalid.
884   * @throws { BusinessError } 17000002 - if the async function was not called with await.
885   * @syscap SystemCapability.ArkUI.ArkUI.Full
886   * @atomicservice
887   * @since 11
888   */
889  findComponents(pattern: Matcher): Promise<Array<Component>>;
890  /**
891   * Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised.
892   *
893   * @param { Matcher } pattern The attribute requirements of the target {@link Component}.
894   * @returns { Promise<void> }
895   * @throws { BusinessError } 401 - if the input parameters are invalid.
896   * @throws { BusinessError } 17000002 - if the async function was not called with await.
897   * @throws { BusinessError } 17000003 - if the assertion failed.
898   * @syscap SystemCapability.ArkUI.ArkUI.Full
899   * @atomicservice
900   * @since 11
901   */
902  assertComponentExist(pattern: Matcher): Promise<void>;
903  /**
904   * TODO
905   *
906   * @param pattern
907   */
908  scrollUntilExist(pattern: Matcher): Promise<Component>;
909  /**
910   * Press the specified key.
911   *
912   * @param { number } keyCode - the target keyCode.
913   * @returns { Promise<void> }
914   * @throws { BusinessError } 401 - if the input parameters are invalid.
915   * @throws { BusinessError } 17000002 - if the async function was not called with await.
916   * @syscap SystemCapability.ArkUI.ArkUI.Full
917   * @atomicservice
918   * @since 11
919   */
920  triggerkey(keyCode: number): Promise<void>;
921  /**
922   * Press two or three key combinations
923   *
924   * @param { Array<number> } [keys] - the target keyCodes.
925   * @returns { Promise<void> }
926   * @throws { BusinessError } 401 - if the input parameters are invalid.
927   * @throws { BusinessError } 17000002 - if the async function was not called with await.
928   * @syscap SystemCapability.ArkUI.ArkUI.Full
929   * @atomicservice
930   * @since 11
931   */
932  triggerCombineKeys(keys: Array<number>): Promise<void>;
933  /**
934   * Tap on the specified location on the screen.
935   *
936   * @param { number } x The x-coordinate.
937   * @param { number } y The y-coordinate.
938   * @returns { Promise<void> }
939   * @syscap SystemCapability.ArkUI.ArkUI.Full
940   * @since 11
941   */
942  tap(x: number, y: number): Promise<void>;
943  /**
944   * DoubleTap on the specified location on the screen.
945   *
946   * @param { number } x The x-coordinate.
947   * @param { number } y The y-coordinate.
948   * @returns { Promise<void> }
949   * @syscap SystemCapability.ArkUI.ArkUI.Full
950   * @since 11
951   */
952  doubleTap(x: number, y: number): Promise<void>;
953  /**
954   * Press on the specified location on the screen.
955   *
956   * @param { number } x The x-coordinate.
957   * @param { number } y The y-coordinate.
958   * @param { number } duration The press duration.
959   * @returns { Promise<void> }
960   * @syscap SystemCapability.ArkUI.ArkUI.Full
961   * @since 11
962   */
963  press(x: number, y: number, duration?: number): Promise<void>;
964  /**
965   * TODO
966   *
967   * @param deltax
968   * @param deltaY
969   */
970  scroll(deltax: number, deltaY: number): Promise<void>;
971  /**
972   * Drag on the screen between the specified points.
973   *
974   * @param { number } startx - the x-coordinate of the starting point.
975   * @param { number } starty - the y-coordinate of the starting point.
976   * @param { number } endx - the x-coordinate of the ending point.
977   * @param { number } endy - the y-coordinate of the ending point.
978   * @param { number } [speed] the speed of drag(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined.
979   * @returns { Promise<void> }
980   * @throws { BusinessError } 401 - if the input parameters are invalid.
981   * @throws { BusinessError } 17000002 - if the async function was not called with await.
982   * @syscap SystemCapability.ArkUI.ArkUI.Full
983   * @atomicservice
984   * @since 11
985   */
986  drag(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise<void>;
987  /**
988   * Inject fling on the device display.
989   *
990   * @param { Point } from - the coordinate point where the finger touches the screen.
991   * @param { Point } to - the coordinate point where the finger leaves the screen.
992   * @param { number } stepLen - the length of each step, in pixels.
993   * @param { number } [speed] - the speed of fling(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined.
994   * @returns { Promise<void> }
995   * @throws { BusinessError } 401 - if the input parameters are invalid.
996   * @throws { BusinessError } 17000002 - if the async function was not called with await.
997   * @syscap SystemCapability.ArkUI.ArkUI.Full
998   * @atomicservice
999   * @since 11
1000   */
1001  fling(from: Point, to: Point, steplen: number, speed: number): Promise<void>;
1002  /**
1003   * Inject fling on the device display.
1004   *
1005   * @param { UiDirection } direction - the direction of this action.
1006   * @param { number } speed - the speed of fling (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
1007   * @returns { Promise<void> }
1008   * @throws { BusinessError } 401 - if the input parameters are invalid.
1009   * @throws { BusinessError } 17000002 - if the async function was not called with await.
1010   * @syscap SystemCapability.ArkUI.ArkUI.Full
1011   * @atomicservice
1012   * @since 11
1013   */
1014  fling(direction: UiDirection, speed: number): Promise<void>;
1015}
1016
1017type allExpectType = Object | undefined | null;
1018type allActualType = Object | undefined | null;
1019
1020// global functions
1021declare function loadComponentTestEntry(entry: () => void): void;
1022
1023declare function defineTest(testName: string, attr: TestCaseAttribute, testBody: () => void, delayMs?: number): void;
1024declare function assertContain(expectValue: allExpectType, actualValue: allActualType): void;
1025declare function assertEqual(expectValue: allExpectType, actualValue: allActualType): void;
1026declare function assertFalse(actualValue: allExpectType): void;
1027declare function assertTrue(actualValue: allExpectType): void;
1028
1029export {
1030  TestCaseType,
1031  TestCaseSize,
1032  TestCaseLevel,
1033  TestCaseAttribute,
1034  MatchType,
1035  Point,
1036  Rect,
1037  UiDirection,
1038  Matcher,
1039  Component,
1040  Tester,
1041  loadComponentTestEntry,
1042  defineTest,
1043  assertContain,
1044  assertEqual,
1045  assertFalse,
1046  assertTrue
1047};
1048