1/* 2 * Copyright (C) 2022 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 TestKit 19 */ 20 21import { Callback } from './@ohos.base'; 22 23/** 24 * Enumerates the string value match pattern. 25 * 26 * @enum {number} 27 * @syscap SystemCapability.Test.UiTest 28 * @since 8 29 */ 30/** 31 * Enumerates the string value match pattern. 32 * 33 * @enum {number} 34 * @syscap SystemCapability.Test.UiTest 35 * @crossplatform 36 * @since 10 37 */ 38/** 39 * Enumerates the string value match pattern. 40 * 41 * @enum {number} 42 * @syscap SystemCapability.Test.UiTest 43 * @crossplatform 44 * @atomicservice 45 * @since 11 46 */ 47declare enum MatchPattern { 48 /** 49 * Equals to a string. 50 * 51 * @syscap SystemCapability.Test.UiTest 52 * @since 8 53 * @test 54 */ 55 /** 56 * Equals to a string. 57 * 58 * @syscap SystemCapability.Test.UiTest 59 * @crossplatform 60 * @since 10 61 * @test 62 */ 63 /** 64 * Equals to a string. 65 * 66 * @syscap SystemCapability.Test.UiTest 67 * @crossplatform 68 * @atomicservice 69 * @since 11 70 * @test 71 */ 72 EQUALS = 0, 73 /** 74 * Contains a substring. 75 * 76 * @syscap SystemCapability.Test.UiTest 77 * @since 8 78 * @test 79 */ 80 /** 81 * Contains a substring. 82 * 83 * @syscap SystemCapability.Test.UiTest 84 * @crossplatform 85 * @since 10 86 * @test 87 */ 88 /** 89 * Contains a substring. 90 * 91 * @syscap SystemCapability.Test.UiTest 92 * @crossplatform 93 * @atomicservice 94 * @since 11 95 * @test 96 */ 97 CONTAINS = 1, 98 /** 99 * StartsWith a substring. 100 * 101 * @syscap SystemCapability.Test.UiTest 102 * @since 8 103 * @test 104 */ 105 /** 106 * StartsWith a substring. 107 * 108 * @syscap SystemCapability.Test.UiTest 109 * @crossplatform 110 * @since 10 111 * @test 112 */ 113 /** 114 * StartsWith a substring. 115 * 116 * @syscap SystemCapability.Test.UiTest 117 * @crossplatform 118 * @atomicservice 119 * @since 11 120 * @test 121 */ 122 STARTS_WITH = 2, 123 /** 124 * EndsWith a substring. 125 * 126 * @syscap SystemCapability.Test.UiTest 127 * @since 8 128 * @test 129 */ 130 /** 131 * EndsWith a substring. 132 * 133 * @syscap SystemCapability.Test.UiTest 134 * @crossplatform 135 * @since 10 136 * @test 137 */ 138 /** 139 * EndsWith a substring. 140 * 141 * @syscap SystemCapability.Test.UiTest 142 * @crossplatform 143 * @atomicservice 144 * @since 11 145 * @test 146 */ 147 ENDS_WITH = 3, 148 /** 149 * Matches the given value using a regular expression, which is case sensitive. 150 * 151 * @syscap SystemCapability.Test.UiTest 152 * @atomicservice 153 * @since 18 154 */ 155 REG_EXP = 4, 156 /** 157 * Matches the given value using a regular expression, which is case insensitive. 158 * 159 * @syscap SystemCapability.Test.UiTest 160 * @atomicservice 161 * @since 18 162 */ 163 REG_EXP_ICASE = 5, 164} 165 166/** 167 * Describes the attribute requirements for the target UiComponents. 168 * 169 * @syscap SystemCapability.Test.UiTest 170 * @since 8 171 * @deprecated since 9 172 * @useinstead ohos.UiTest.On 173 */ 174declare class By { 175 /** 176 * Specifies the text for the target UiComponent. 177 * 178 * @param { string } txt The text value. 179 * @param { MatchPattern } pattern The {@link MatchPattern} of the text value,default to {@link MatchPattern.EQUALS} 180 * @returns { By } this {@link By} object. 181 * @syscap SystemCapability.Test.UiTest 182 * @since 8 183 * @deprecated since 9 184 * @useinstead ohos.UiTest.On#text 185 * @test 186 */ 187 text(txt: string, pattern?: MatchPattern): By; 188 189 /** 190 * Specifies the inspector key of the target UiComponent. 191 * 192 * @param { string } key The inspectorKey value. 193 * @returns { By } this {@link By} object. 194 * @syscap SystemCapability.Test.UiTest 195 * @since 8 196 * @deprecated since 9 197 * @useinstead ohos.UiTest.On#id 198 * @test 199 */ 200 key(key: string): By; 201 202 /** 203 * Specifies the id of the target UiComponent. 204 * 205 * @param { number } id The id value. 206 * @returns { By } this {@link By} object. 207 * @syscap SystemCapability.Test.UiTest 208 * @since 8 209 * @deprecated since 9 210 * @test 211 */ 212 id(id: number): By; 213 214 /** 215 * Specifies the type of the target UiComponent. 216 * 217 * @param { string } tp The type value. 218 * @returns { By } this {@link By} object. 219 * @syscap SystemCapability.Test.UiTest 220 * @since 8 221 * @deprecated since 9 222 * @useinstead ohos.UiTest.On#type 223 * @test 224 */ 225 type(tp: string): By; 226 227 /** 228 * Specifies the clickable status of the target UiComponent. 229 * 230 * @param { boolean } b The clickable status,default to true. 231 * @returns { By } this {@link By} object. 232 * @syscap SystemCapability.Test.UiTest 233 * @since 8 234 * @deprecated since 9 235 * @useinstead ohos.UiTest.On#clickable 236 * @test 237 */ 238 clickable(b?: boolean): By; 239 240 /** 241 * Specifies the scrollable status of the target UiComponent. 242 * 243 * @param { boolean } b The scrollable status,default to true. 244 * @returns { By } this {@link By} object. 245 * @syscap SystemCapability.Test.UiTest 246 * @since 8 247 * @deprecated since 9 248 * @useinstead ohos.UiTest.On#scrollable 249 * @test 250 */ 251 scrollable(b?: boolean): By; 252 253 /** 254 * Specifies the enabled status of the target UiComponent. 255 * 256 * @param { boolean } b The enabled status,default to true. 257 * @returns { By } this {@link By} object. 258 * @syscap SystemCapability.Test.UiTest 259 * @since 8 260 * @deprecated since 9 261 * @useinstead ohos.UiTest.On#enabled 262 * @test 263 */ 264 enabled(b?: boolean): By; 265 266 /** 267 * Specifies the focused status of the target UiComponent. 268 * 269 * @param { boolean } b The focused status,default to true. 270 * @returns { By } this {@link By} object. 271 * @syscap SystemCapability.Test.UiTest 272 * @since 8 273 * @deprecated since 9 274 * @useinstead ohos.UiTest.On#focused 275 * @test 276 */ 277 focused(b?: boolean): By; 278 279 /** 280 * Specifies the selected status of the target UiComponent. 281 * 282 * @param { boolean } b The selected status,default to true. 283 * @returns { By } this {@link By} object. 284 * @syscap SystemCapability.Test.UiTest 285 * @since 8 286 * @deprecated since 9 287 * @useinstead ohos.UiTest.On#selected 288 * @test 289 */ 290 selected(b?: boolean): By; 291 292 /** 293 * Requires the target UiComponent which is before another UiComponent that specified by the given {@link By} 294 * object,used to locate UiComponent relatively. 295 * 296 * @param { By } by Describes the attribute requirements of UiComponent which the target one is in front of. 297 * @returns { By } this {@link By} object. 298 * @syscap SystemCapability.Test.UiTest 299 * @since 8 300 * @deprecated since 9 301 * @useinstead ohos.UiTest.On#isBefore 302 * @test 303 */ 304 isBefore(by: By): By; 305 306 /** 307 * Requires the target UiComponent which is after another UiComponent that specified by the given {@link By} 308 * object,used to locate UiComponent relatively. 309 * 310 * @param { By } by Describes the attribute requirements of UiComponent which the target one is in back of. 311 * @returns { By } this {@link By} object. 312 * @syscap SystemCapability.Test.UiTest 313 * @since 8 314 * @deprecated since 9 315 * @useinstead ohos.UiTest.On#isAfter 316 * @test 317 */ 318 isAfter(by: By): By; 319} 320 321/** 322 * Represents a UiComponent of the ohos application,user can perform operations or query attributes on it. 323 * 324 * @syscap SystemCapability.Test.UiTest 325 * @since 8 326 * @deprecated since 9 327 * @useinstead ohos.uitest.Component 328 * @test 329 */ 330declare class UiComponent { 331 /** 332 * Click this {@link UiComponent}. 333 * 334 * @returns { Promise<void> } 335 * @syscap SystemCapability.Test.UiTest 336 * @since 8 337 * @deprecated since 9 338 * @useinstead ohos.UiTest.Component#click 339 * @test 340 */ 341 click(): Promise<void>; 342 343 /** 344 * Double click this {@link UiComponent}. 345 * 346 * @returns { Promise<void> } 347 * @syscap SystemCapability.Test.UiTest 348 * @since 8 349 * @deprecated since 9 350 * @useinstead ohos.UiTest.Component#doubleClick 351 * @test 352 */ 353 doubleClick(): Promise<void>; 354 355 /** 356 * Long click this {@link UiComponent}. 357 * 358 * @returns { Promise<void> } 359 * @syscap SystemCapability.Test.UiTest 360 * @since 8 361 * @deprecated since 9 362 * @useinstead ohos.UiTest.Component#longClick 363 * @test 364 */ 365 longClick(): Promise<void>; 366 367 /** 368 * Get the id attribute value. 369 * 370 * @returns { Promise<number> } the id value. 371 * @syscap SystemCapability.Test.UiTest 372 * @since 8 373 * @deprecated since 9 374 * @test 375 */ 376 getId(): Promise<number>; 377 378 /** 379 * Get the inspectorKey attribute value. 380 * 381 * @returns { Promise<string> } the inspectorKey value. 382 * @syscap SystemCapability.Test.UiTest 383 * @since 8 384 * @deprecated since 9 385 * @useinstead ohos.UiTest.Component#getId 386 * @test 387 */ 388 getKey(): Promise<string>; 389 390 /** 391 * Get the text attribute value. 392 * 393 * @returns { Promise<string> } the text value. 394 * @syscap SystemCapability.Test.UiTest 395 * @since 8 396 * @deprecated since 9 397 * @useinstead ohos.UiTest.Component#getText 398 * @test 399 */ 400 getText(): Promise<string>; 401 402 /** 403 * Get the type name. 404 * 405 * @returns { Promise<string> } the type name. 406 * @syscap SystemCapability.Test.UiTest 407 * @since 8 408 * @deprecated since 9 409 * @useinstead ohos.UiTest.Component#getType 410 * @test 411 */ 412 getType(): Promise<string>; 413 414 /** 415 * Get the clickable status of this {@link UiComponent}. 416 * 417 * @returns { Promise<boolean> } the clickable status. 418 * @syscap SystemCapability.Test.UiTest 419 * @since 8 420 * @deprecated since 9 421 * @useinstead ohos.UiTest.Component#isClickable 422 * @test 423 */ 424 isClickable(): Promise<boolean>; 425 426 /** 427 * Get the scrollable status of this {@link UiComponent}. 428 * 429 * @returns { Promise<boolean> } the scrollable status. 430 * @syscap SystemCapability.Test.UiTest 431 * @since 8 432 * @deprecated since 9 433 * @useinstead ohos.UiTest.Component#isScrollable 434 * @test 435 */ 436 isScrollable(): Promise<boolean>; 437 438 /** 439 * Get the enabled status of this {@link UiComponent}. 440 * 441 * @returns { Promise<boolean> } the enabled status. 442 * @syscap SystemCapability.Test.UiTest 443 * @since 8 444 * @deprecated since 9 445 * @useinstead ohos.UiTest.Component#isEnabled 446 * @test 447 */ 448 isEnabled(): Promise<boolean>; 449 450 /** 451 * Get the focused status of this {@link UiComponent}. 452 * 453 * @returns { Promise<boolean> } the focused status. 454 * @syscap SystemCapability.Test.UiTest 455 * @since 8 456 * @deprecated since 9 457 * @useinstead ohos.UiTest.Component#isFocused 458 * @test 459 */ 460 isFocused(): Promise<boolean>; 461 462 /** 463 * Get the selected status of this {@link UiComponent}. 464 * 465 * @returns { Promise<boolean> } the selected status. 466 * @syscap SystemCapability.Test.UiTest 467 * @since 8 468 * @deprecated since 9 469 * @useinstead ohos.UiTest.Component#isSelected 470 * @test 471 */ 472 isSelected(): Promise<boolean>; 473 474 /** 475 * Inject text to this {@link UiComponent},applicable to TextInput. 476 * 477 * @param { string } text The text to inject. 478 * @returns { Promise<void> } 479 * @syscap SystemCapability.Test.UiTest 480 * @since 8 481 * @deprecated since 9 482 * @useinstead ohos.UiTest.Component#inputText 483 * @test 484 */ 485 inputText(text: string): Promise<void>; 486 487 /** 488 * Scroll on this {@link UiComponent}to find matched {@link UiComponent},applicable to scrollable one. 489 * 490 * @param { By } by The attribute requirements of the target {@link UiComponent}. 491 * @returns { Promise<UiComponent> } the found result,or undefined if not found. 492 * @syscap SystemCapability.Test.UiTest 493 * @since 8 494 * @deprecated since 9 495 * @useinstead ohos.UiTest.Component#scrollSearch 496 * @test 497 */ 498 scrollSearch(by: By): Promise<UiComponent>; 499} 500 501/** 502 * The unified facade of UiTest framework,can be used to find {@link UiComponent},trigger keyEvents,perform 503 * coordinates-based UI actions,capture screen and so on. 504 * 505 * @syscap SystemCapability.Test.UiTest 506 * @since 8 507 * @deprecated since 9 508 * @useinstead ohos.uitest.Driver 509 * @test 510 */ 511declare class UiDriver { 512 /** 513 * Create an {@link UiDriver} object. 514 * 515 * @returns { UiDriver } the {@link UiDriver} object. 516 * @syscap SystemCapability.Test.UiTest 517 * @since 8 518 * @deprecated since 9 519 * @useinstead ohos.UiTest.Driver#create 520 * @test 521 */ 522 static create(): UiDriver; 523 524 /** 525 * Delay with specified duration. 526 * 527 * @param { number } duration The delay duration in milliseconds. 528 * @returns { Promise<void> } 529 * @syscap SystemCapability.Test.UiTest 530 * @since 8 531 * @deprecated since 9 532 * @useinstead ohos.UiTest.Driver#delayMs 533 * @test 534 */ 535 delayMs(duration: number): Promise<void>; 536 537 /** 538 * Find the first matched {@link UiComponent} on current UI. 539 * 540 * @param { By } by The attribute requirements of the target {@link UiComponent}. 541 * @returns { Promise<UiComponent> } the first matched {@link UiComponent} or undefined. 542 * @syscap SystemCapability.Test.UiTest 543 * @since 8 544 * @deprecated since 9 545 * @useinstead ohos.UiTest.Driver#findComponent 546 * @test 547 */ 548 findComponent(by: By): Promise<UiComponent>; 549 550 /** 551 * Find all the matched {@link UiComponent}s on current UI. 552 * 553 * @param { By } by The attribute requirements of the target {@link UiComponent}. 554 * @returns { Promise<Array<UiComponent>> } the matched {@link UiComponent}s list. 555 * @syscap SystemCapability.Test.UiTest 556 * @since 8 557 * @deprecated since 9 558 * @useinstead ohos.UiTest.Driver#findComponents 559 * @test 560 */ 561 findComponents(by: By): Promise<Array<UiComponent>>; 562 563 /** 564 * Assert the matched {@link UiComponent}s exists on current UI;if not,assertError will be raised. 565 * 566 * @param { By } by The attribute requirements of the target {@link UiComponent}. 567 * @returns { Promise<void> } 568 * @throws {BusinessError} 401 - if the input parameters are invalid. 569 * @throws {BusinessError} 17000002 - if the async function was not called with await. 570 * @throws {BusinessError} 17000003 - if the assertion failed. 571 * @syscap SystemCapability.Test.UiTest 572 * @since 8 573 * @deprecated since 9 574 * @useinstead ohos.UiTest.Driver#assertComponentExist 575 * @test 576 */ 577 assertComponentExist(by: By): Promise<void>; 578 579 /** 580 * Press the BACK key. 581 * 582 * @returns { Promise<void> } 583 * @syscap SystemCapability.Test.UiTest 584 * @since 8 585 * @deprecated since 9 586 * @useinstead ohos.UiTest.Driver#pressBack 587 * @test 588 */ 589 pressBack(): Promise<void>; 590 591 /** 592 * Press the specified key. 593 * 594 * @param { number } keyCode the target keyCode. 595 * @returns { Promise<void> } 596 * @syscap SystemCapability.Test.UiTest 597 * @since 8 598 * @deprecated since 9 599 * @useinstead ohos.UiTest.Driver#triggerKey 600 * @test 601 */ 602 triggerKey(keyCode: number): Promise<void>; 603 604 /** 605 * Click on the specified location on the screen. 606 * 607 * @param { number } x The x-coordinate. 608 * @param { number } y The y-coordinate. 609 * @returns { Promise<void> } 610 * @syscap SystemCapability.Test.UiTest 611 * @since 8 612 * @deprecated since 9 613 * @useinstead ohos.UiTest.Driver#click 614 * @test 615 */ 616 click(x: number, y: number): Promise<void>; 617 618 /** 619 * DoubleClick on the specified location on the screen. 620 * 621 * @param { number } x The x-coordinate. 622 * @param { number } y The y-coordinate. 623 * @returns { Promise<void> } 624 * @syscap SystemCapability.Test.UiTest 625 * @since 8 626 * @deprecated since 9 627 * @useinstead ohos.UiTest.Driver#doubleClick 628 * @test 629 */ 630 doubleClick(x: number, y: number): Promise<void>; 631 632 /** 633 * LongClick on the specified location on the screen. 634 * 635 * @param { number } x The x-coordinate. 636 * @param { number } y The y-coordinate. 637 * @returns { Promise<void> } 638 * @syscap SystemCapability.Test.UiTest 639 * @since 8 640 * @deprecated since 9 641 * @useinstead ohos.UiTest.Driver#longClick 642 * @test 643 */ 644 longClick(x: number, y: number): Promise<void>; 645 646 /** 647 * Swipe on the screen between the specified points. 648 * 649 * @param { number } startx The x-coordinate of the starting point. 650 * @param { number } starty The y-coordinate of the starting point. 651 * @param { number } endx The x-coordinate of the ending point. 652 * @param { number } endy The y-coordinate of the ending point. 653 * @returns { Promise<void> } 654 * @syscap SystemCapability.Test.UiTest 655 * @since 8 656 * @deprecated since 9 657 * @useinstead ohos.UiTest.Driver#swipe 658 * @test 659 */ 660 swipe(startx: number, starty: number, endx: number, endy: number): Promise<void>; 661 662 /** 663 * Capture current screen and save as picture which PNG format. 664 * 665 * @param { string } savePath the path where to store the picture. 666 * @returns { Promise<boolean> } true if screen-capturing and file-storing are completed successfully,false otherwise. 667 * @syscap SystemCapability.Test.UiTest 668 * @since 8 669 * @deprecated since 9 670 * @useinstead ohos.uitest.Driver#screenCap 671 * @test 672 */ 673 screenCap(savePath: string): Promise<boolean>; 674} 675 676/** 677 * Enumerates the window mode of the tested window. 678 * 679 * @enum { number } 680 * @syscap SystemCapability.Test.UiTest 681 * @since 9 682 */ 683/** 684 * Enumerates the window mode of the tested window. 685 * 686 * @enum { number } 687 * @syscap SystemCapability.Test.UiTest 688 * @atomicservice 689 * @since 11 690 */ 691declare enum WindowMode { 692 /** 693 * The test window is a full screen window. 694 * 695 * @syscap SystemCapability.Test.UiTest 696 * @since 9 697 * @test 698 */ 699 /** 700 * The test window is a full screen window. 701 * 702 * @syscap SystemCapability.Test.UiTest 703 * @atomicservice 704 * @since 11 705 * @test 706 */ 707 FULLSCREEN = 0, 708 /** 709 * The test window is the first window in the split screen state. 710 * 711 * @syscap SystemCapability.Test.UiTest 712 * @since 9 713 * @test 714 */ 715 /** 716 * The test window is the first window in the split screen state. 717 * 718 * @syscap SystemCapability.Test.UiTest 719 * @atomicservice 720 * @since 11 721 * @test 722 */ 723 PRIMARY = 1, 724 /** 725 * The test window is the second window in the split screen state. 726 * 727 * @syscap SystemCapability.Test.UiTest 728 * @since 9 729 * @test 730 */ 731 /** 732 * The test window is the second window in the split screen state. 733 * 734 * @syscap SystemCapability.Test.UiTest 735 * @atomicservice 736 * @since 11 737 * @test 738 */ 739 SECONDARY = 2, 740 /** 741 * The test window is a floating window. 742 * 743 * @syscap SystemCapability.Test.UiTest 744 * @since 9 745 * @test 746 */ 747 /** 748 * The test window is a floating window. 749 * 750 * @syscap SystemCapability.Test.UiTest 751 * @atomicservice 752 * @since 11 753 * @test 754 */ 755 FLOATING = 3, 756} 757 758/** 759 * Enumerates the resize direction for the window. 760 * 761 * @enum { number } 762 * @syscap SystemCapability.Test.UiTest 763 * @since 9 764 */ 765/** 766 * Enumerates the resize direction for the window. 767 * 768 * @enum { number } 769 * @syscap SystemCapability.Test.UiTest 770 * @atomicservice 771 * @since 11 772 */ 773declare enum ResizeDirection { 774 /** 775 * Left. 776 * 777 * @syscap SystemCapability.Test.UiTest 778 * @since 9 779 * @test 780 */ 781 /** 782 * Left. 783 * 784 * @syscap SystemCapability.Test.UiTest 785 * @atomicservice 786 * @since 11 787 * @test 788 */ 789 LEFT = 0, 790 /** 791 * Right. 792 * 793 * @syscap SystemCapability.Test.UiTest 794 * @since 9 795 * @test 796 */ 797 /** 798 * Right. 799 * 800 * @syscap SystemCapability.Test.UiTest 801 * @atomicservice 802 * @since 11 803 * @test 804 */ 805 RIGHT = 1, 806 /** 807 * Up. 808 * 809 * @syscap SystemCapability.Test.UiTest 810 * @since 9 811 * @test 812 */ 813 /** 814 * Up. 815 * 816 * @syscap SystemCapability.Test.UiTest 817 * @atomicservice 818 * @since 11 819 * @test 820 */ 821 UP = 2, 822 /** 823 * Down. 824 * 825 * @syscap SystemCapability.Test.UiTest 826 * @since 9 827 * @test 828 */ 829 /** 830 * Down. 831 * 832 * @syscap SystemCapability.Test.UiTest 833 * @atomicservice 834 * @since 11 835 * @test 836 */ 837 DOWN = 3, 838 /** 839 * Upper left. 840 * 841 * @syscap SystemCapability.Test.UiTest 842 * @since 9 843 * @test 844 */ 845 /** 846 * Upper left. 847 * 848 * @syscap SystemCapability.Test.UiTest 849 * @atomicservice 850 * @since 11 851 * @test 852 */ 853 LEFT_UP = 4, 854 /** 855 * Lower left. 856 * 857 * @syscap SystemCapability.Test.UiTest 858 * @since 9 859 * @test 860 */ 861 /** 862 * Lower left. 863 * 864 * @syscap SystemCapability.Test.UiTest 865 * @atomicservice 866 * @since 11 867 * @test 868 */ 869 LEFT_DOWN = 5, 870 /** 871 * Upper right. 872 * 873 * @syscap SystemCapability.Test.UiTest 874 * @since 9 875 * @test 876 */ 877 /** 878 * Upper right. 879 * 880 * @syscap SystemCapability.Test.UiTest 881 * @atomicservice 882 * @since 11 883 * @test 884 */ 885 RIGHT_UP = 6, 886 /** 887 * Lower right. 888 * 889 * @syscap SystemCapability.Test.UiTest 890 * @since 9 891 * @test 892 */ 893 /** 894 * Lower right. 895 * 896 * @syscap SystemCapability.Test.UiTest 897 * @atomicservice 898 * @since 11 899 * @test 900 */ 901 RIGHT_DOWN = 7, 902} 903 904/** 905 * Enumerates the rotation of the device display. 906 * 907 * @enum { number } 908 * @syscap SystemCapability.Test.UiTest 909 * @since 9 910 */ 911/** 912 * Enumerates the rotation of the device display. 913 * 914 * @enum { number } 915 * @syscap SystemCapability.Test.UiTest 916 * @atomicservice 917 * @since 11 918 */ 919declare enum DisplayRotation { 920 /** 921 * Device display does not rotate to display vertically. 922 * 923 * @syscap SystemCapability.Test.UiTest 924 * @since 9 925 * @test 926 */ 927 /** 928 * Device display does not rotate to display vertically. 929 * 930 * @syscap SystemCapability.Test.UiTest 931 * @atomicservice 932 * @since 11 933 * @test 934 */ 935 ROTATION_0 = 0, 936 /** 937 * Device display rotates 90 degrees clockwise to display horizontally. 938 * 939 * @syscap SystemCapability.Test.UiTest 940 * @since 9 941 * @test 942 */ 943 /** 944 * Device display rotates 90 degrees clockwise to display horizontally. 945 * 946 * @syscap SystemCapability.Test.UiTest 947 * @atomicservice 948 * @since 11 949 * @test 950 */ 951 ROTATION_90 = 1, 952 /** 953 * Device display rotates clockwise 180 degrees to display vertically in reverse. 954 * 955 * @syscap SystemCapability.Test.UiTest 956 * @since 9 957 * @test 958 */ 959 /** 960 * Device display rotates clockwise 180 degrees to display vertically in reverse. 961 * 962 * @syscap SystemCapability.Test.UiTest 963 * @atomicservice 964 * @since 11 965 * @test 966 */ 967 ROTATION_180 = 2, 968 /** 969 * Device display rotates 270 degrees clockwise to display horizontally in reverse. 970 * 971 * @syscap SystemCapability.Test.UiTest 972 * @since 9 973 * @test 974 */ 975 /** 976 * Device display rotates 270 degrees clockwise to display horizontally in reverse. 977 * 978 * @syscap SystemCapability.Test.UiTest 979 * @atomicservice 980 * @since 11 981 * @test 982 */ 983 ROTATION_270 = 3, 984} 985 986/** 987 * Represents the point on the device screen. 988 * 989 * @typedef Point 990 * @syscap SystemCapability.Test.UiTest 991 * @since 9 992 */ 993/** 994 * Represents the point on the device screen. 995 * 996 * @typedef Point 997 * @syscap SystemCapability.Test.UiTest 998 * @crossplatform 999 * @since 10 1000 */ 1001/** 1002 * Represents the point on the device screen. 1003 * 1004 * @typedef Point 1005 * @syscap SystemCapability.Test.UiTest 1006 * @crossplatform 1007 * @atomicservice 1008 * @since 11 1009 */ 1010declare interface Point { 1011 /** 1012 * The x-coordinate of the coordinate point. 1013 * 1014 * @type { number } 1015 * @readonly 1016 * @syscap SystemCapability.Test.UiTest 1017 * @since 9 1018 */ 1019 /** 1020 * The x-coordinate of the coordinate point. 1021 * 1022 * @type { number } 1023 * @readonly 1024 * @syscap SystemCapability.Test.UiTest 1025 * @crossplatform 1026 * @since 10 1027 */ 1028 /** 1029 * The x-coordinate of the coordinate point. 1030 * 1031 * @type { number } 1032 * @readonly 1033 * @syscap SystemCapability.Test.UiTest 1034 * @crossplatform 1035 * @atomicservice 1036 * @since 11 1037 */ 1038 readonly x: number; 1039 /** 1040 * The y-coordinate of the coordinate point. 1041 * 1042 * @type { number } 1043 * @readonly 1044 * @syscap SystemCapability.Test.UiTest 1045 * @since 9 1046 */ 1047 /** 1048 * The y-coordinate of the coordinate point. 1049 * 1050 * @type { number } 1051 * @readonly 1052 * @syscap SystemCapability.Test.UiTest 1053 * @crossplatform 1054 * @since 10 1055 */ 1056 /** 1057 * The y-coordinate of the coordinate point. 1058 * 1059 * @type { number } 1060 * @readonly 1061 * @syscap SystemCapability.Test.UiTest 1062 * @crossplatform 1063 * @atomicservice 1064 * @since 11 1065 */ 1066 readonly y: number; 1067} 1068 1069/** 1070 * Represents the rectangle area on the device screen. 1071 * 1072 * @typedef Rect 1073 * @syscap SystemCapability.Test.UiTest 1074 * @since 9 1075 */ 1076/** 1077 * Represents the rectangle area on the device screen. 1078 * 1079 * @typedef Rect 1080 * @syscap SystemCapability.Test.UiTest 1081 * @atomicservice 1082 * @since 11 1083 */ 1084/** 1085 * Represents the rectangle area on the device screen. 1086 * 1087 * @typedef Rect 1088 * @syscap SystemCapability.Test.UiTest 1089 * @crossplatform 1090 * @atomicservice 1091 * @since 12 1092 */ 1093declare interface Rect { 1094 /** 1095 * The x-coordinate of the top left corner of the rectangle. 1096 * 1097 * @type { number } 1098 * @readonly 1099 * @syscap SystemCapability.Test.UiTest 1100 * @since 9 1101 */ 1102 /** 1103 * The x-coordinate of the top left corner of the rectangle. 1104 * 1105 * @type { number } 1106 * @readonly 1107 * @syscap SystemCapability.Test.UiTest 1108 * @atomicservice 1109 * @since 11 1110 */ 1111 /** 1112 * The x-coordinate of the top left corner of the rectangle. 1113 * 1114 * @type { number } 1115 * @readonly 1116 * @syscap SystemCapability.Test.UiTest 1117 * @crossplatform 1118 * @atomicservice 1119 * @since 12 1120 */ 1121 readonly left: number; 1122 /** 1123 * The y-coordinate of the top left corner of the rectangle. 1124 * 1125 * @type { number } 1126 * @readonly 1127 * @syscap SystemCapability.Test.UiTest 1128 * @since 9 1129 */ 1130 /** 1131 * The y-coordinate of the top left corner of the rectangle. 1132 * 1133 * @type { number } 1134 * @readonly 1135 * @syscap SystemCapability.Test.UiTest 1136 * @atomicservice 1137 * @since 11 1138 */ 1139 /** 1140 * The y-coordinate of the top left corner of the rectangle. 1141 * 1142 * @type { number } 1143 * @readonly 1144 * @syscap SystemCapability.Test.UiTest 1145 * @crossplatform 1146 * @atomicservice 1147 * @since 12 1148 */ 1149 readonly top: number; 1150 /** 1151 * The x-coordinate at the bottom right corner of the rectangle. 1152 * 1153 * @type { number } 1154 * @readonly 1155 * @syscap SystemCapability.Test.UiTest 1156 * @since 9 1157 */ 1158 /** 1159 * The x-coordinate at the bottom right corner of the rectangle. 1160 * 1161 * @type { number } 1162 * @readonly 1163 * @syscap SystemCapability.Test.UiTest 1164 * @atomicservice 1165 * @since 11 1166 */ 1167 /** 1168 * The x-coordinate at the bottom right corner of the rectangle. 1169 * 1170 * @type { number } 1171 * @readonly 1172 * @syscap SystemCapability.Test.UiTest 1173 * @crossplatform 1174 * @atomicservice 1175 * @since 12 1176 */ 1177 readonly right: number; 1178 /** 1179 * The y-coordinate at the bottom right corner of the rectangle. 1180 * 1181 * @type { number } 1182 * @readonly 1183 * @syscap SystemCapability.Test.UiTest 1184 * @since 9 1185 */ 1186 /** 1187 * The y-coordinate at the bottom right corner of the rectangle. 1188 * 1189 * @type { number } 1190 * @readonly 1191 * @syscap SystemCapability.Test.UiTest 1192 * @atomicservice 1193 * @since 11 1194 */ 1195 /** 1196 * The y-coordinate at the bottom right corner of the rectangle. 1197 * 1198 * @type { number } 1199 * @readonly 1200 * @syscap SystemCapability.Test.UiTest 1201 * @crossplatform 1202 * @atomicservice 1203 * @since 12 1204 */ 1205 readonly bottom: number; 1206} 1207 1208/** 1209 * Represents filer condition to get the window . 1210 * 1211 * @typedef WindowFilter 1212 * @syscap SystemCapability.Test.UiTest 1213 * @since 9 1214 */ 1215/** 1216 * Represents filer condition to get the window . 1217 * 1218 * @typedef WindowFilter 1219 * @syscap SystemCapability.Test.UiTest 1220 * @atomicservice 1221 * @since 11 1222 */ 1223declare interface WindowFilter { 1224 /** 1225 * The package name of the application which the window belongs to. 1226 * 1227 * @type { ?string } 1228 * @syscap SystemCapability.Test.UiTest 1229 * @since 9 1230 */ 1231 /** 1232 * The package name of the application which the window belongs to. 1233 * 1234 * @type { ?string } 1235 * @syscap SystemCapability.Test.UiTest 1236 * @atomicservice 1237 * @since 11 1238 */ 1239 bundleName?: string; 1240 1241 /** 1242 * The title of the window. 1243 * 1244 * @type { ?string } 1245 * @syscap SystemCapability.Test.UiTest 1246 * @since 9 1247 */ 1248 /** 1249 * The title of the window. 1250 * 1251 * @type { ?string } 1252 * @syscap SystemCapability.Test.UiTest 1253 * @atomicservice 1254 * @since 11 1255 */ 1256 title?: string; 1257 1258 /** 1259 * The focal state of the window. 1260 * 1261 * @type { ?boolean } 1262 * @syscap SystemCapability.Test.UiTest 1263 * @since 9 1264 */ 1265 /** 1266 * The focal state of the window. 1267 * 1268 * @type { ?boolean } 1269 * @syscap SystemCapability.Test.UiTest 1270 * @atomicservice 1271 * @since 11 1272 */ 1273 focused?: boolean; 1274 1275 /** 1276 * The active state of the window. 1277 * 1278 * @type { ?boolean } 1279 * @syscap SystemCapability.Test.UiTest 1280 * @since 9 1281 */ 1282 /** 1283 * The active state of the window. 1284 * 1285 * @type { ?boolean } 1286 * @syscap SystemCapability.Test.UiTest 1287 * @since 11 1288 * @deprecated since 11 1289 * @useinstead ohos.UiTest.WindowFilter#active 1290 */ 1291 actived?: boolean; 1292 1293 /** 1294 * The active state of the window. 1295 * 1296 * @type { ?boolean } 1297 * @syscap SystemCapability.Test.UiTest 1298 * @atomicservice 1299 * @since 11 1300 */ 1301 active?: boolean; 1302} 1303 1304/** 1305 * Represents the information of an UI element, can be a component or window. 1306 * 1307 * @typedef UIElementInfo 1308 * @syscap SystemCapability.Test.UiTest 1309 * @since 10 1310 * @test 1311 */ 1312/** 1313 * Represents the information of an UI element, can be a component or window. 1314 * 1315 * @typedef UIElementInfo 1316 * @syscap SystemCapability.Test.UiTest 1317 * @atomicservice 1318 * @since 11 1319 * @test 1320 */ 1321declare interface UIElementInfo { 1322 /** 1323 * The bundle name of the host application. 1324 * @type { string } 1325 * @readonly 1326 * @syscap SystemCapability.Test.UiTest 1327 * @since 10 1328 * @test 1329 */ 1330 /** 1331 * The bundle name of the host application. 1332 * @type { string } 1333 * @readonly 1334 * @syscap SystemCapability.Test.UiTest 1335 * @atomicservice 1336 * @since 11 1337 * @test 1338 */ 1339 readonly bundleName: string; 1340 /** 1341 * The component type, set it as 'window' if it's a window. 1342 * @type { string } 1343 * @readonly 1344 * @syscap SystemCapability.Test.UiTest 1345 * @since 10 1346 * @test 1347 */ 1348 /** 1349 * The component type, set it as 'window' if it's a window. 1350 * @type { string } 1351 * @readonly 1352 * @syscap SystemCapability.Test.UiTest 1353 * @atomicservice 1354 * @since 11 1355 * @test 1356 */ 1357 readonly type: string; 1358 /** 1359 * The text of component, set it as window's title if it's a window. 1360 * @type { string } 1361 * @readonly 1362 * @syscap SystemCapability.Test.UiTest 1363 * @since 10 1364 * @test 1365 */ 1366 /** 1367 * The text of component, set it as window's title if it's a window. 1368 * @type { string } 1369 * @readonly 1370 * @syscap SystemCapability.Test.UiTest 1371 * @atomicservice 1372 * @since 11 1373 * @test 1374 */ 1375 readonly text: string; 1376} 1377 1378/** 1379 * Observer to monitor UI events. 1380 * 1381 * @typedef UIEventObserver 1382 * @syscap SystemCapability.Test.UiTest 1383 * @since 10 1384 * @test 1385 */ 1386/** 1387 * Observer to monitor UI events. 1388 * 1389 * @typedef UIEventObserver 1390 * @syscap SystemCapability.Test.UiTest 1391 * @atomicservice 1392 * @since 11 1393 * @test 1394 */ 1395declare interface UIEventObserver { 1396 /** 1397 * Listen for toast show once 1398 * 1399 * @param { 'toastShow' } type 'toastShow'. 1400 * @param { Callback<UIElementInfo> } callback function, returns the monitored UIElementInfo. 1401 * @throws { BusinessError } 401 - if the input parameters are invalid. 1402 * @syscap SystemCapability.Test.UiTest 1403 * @since 10 1404 * @test 1405 */ 1406 /** 1407 * Listen for toast show once 1408 * 1409 * @param { 'toastShow' } type -'toastShow'. 1410 * @param { Callback<UIElementInfo> } callback - function, returns the monitored UIElementInfo. 1411 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1412 * @syscap SystemCapability.Test.UiTest 1413 * @atomicservice 1414 * @since 11 1415 * @test 1416 */ 1417 once(type: 'toastShow', callback: Callback<UIElementInfo>): void; 1418 1419 /** 1420 * Listen for dialog show once 1421 * 1422 * @param { 'dialogShow' } type 'dialogShow'. 1423 * @param { Callback<UIElementInfo> } callback function, returns the monitored UIElementInfo. 1424 * @throws { BusinessError } 401 - if the input parameters are invalid. 1425 * @syscap SystemCapability.Test.UiTest 1426 * @since 10 1427 * @test 1428 */ 1429 /** 1430 * Listen for dialog show once 1431 * 1432 * @param { 'dialogShow' } type - 'dialogShow'. 1433 * @param { Callback<UIElementInfo> } callback - function, returns the monitored UIElementInfo. 1434 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1435 * @syscap SystemCapability.Test.UiTest 1436 * @atomicservice 1437 * @since 11 1438 * @test 1439 */ 1440 once(type: 'dialogShow', callback: Callback<UIElementInfo>): void; 1441} 1442 1443/** 1444 * Enumerates the direction for the UI operation . 1445 * 1446 * @enum { number } 1447 * @syscap SystemCapability.Test.UiTest 1448 * @since 10 1449 */ 1450/** 1451 * Enumerates the direction for the UI operation . 1452 * 1453 * @enum { number } 1454 * @syscap SystemCapability.Test.UiTest 1455 * @atomicservice 1456 * @since 11 1457 */ 1458/** 1459 * Enumerates the direction for the UI operation . 1460 * 1461 * @enum { number } 1462 * @syscap SystemCapability.Test.UiTest 1463 * @crossplatform 1464 * @atomicservice 1465 * @since 12 1466 */ 1467declare enum UiDirection { 1468 /** 1469 * Left. 1470 * 1471 * @syscap SystemCapability.Test.UiTest 1472 * @since 10 1473 * @test 1474 */ 1475 /** 1476 * Left. 1477 * 1478 * @syscap SystemCapability.Test.UiTest 1479 * @atomicservice 1480 * @since 11 1481 * @test 1482 */ 1483 /** 1484 * Left. 1485 * 1486 * @syscap SystemCapability.Test.UiTest 1487 * @crossplatform 1488 * @atomicservice 1489 * @since 12 1490 * @test 1491 */ 1492 LEFT = 0, 1493 /** 1494 * Right. 1495 * 1496 * @syscap SystemCapability.Test.UiTest 1497 * @since 10 1498 * @test 1499 */ 1500 /** 1501 * Right. 1502 * 1503 * @syscap SystemCapability.Test.UiTest 1504 * @atomicservice 1505 * @since 11 1506 * @test 1507 */ 1508 /** 1509 * Right. 1510 * 1511 * @syscap SystemCapability.Test.UiTest 1512 * @crossplatform 1513 * @atomicservice 1514 * @since 12 1515 * @test 1516 */ 1517 RIGHT = 1, 1518 /** 1519 * Up. 1520 * 1521 * @syscap SystemCapability.Test.UiTest 1522 * @since 10 1523 * @test 1524 */ 1525 /** 1526 * Up. 1527 * 1528 * @syscap SystemCapability.Test.UiTest 1529 * @atomicservice 1530 * @since 11 1531 * @test 1532 */ 1533 /** 1534 * Up. 1535 * 1536 * @syscap SystemCapability.Test.UiTest 1537 * @crossplatform 1538 * @atomicservice 1539 * @since 12 1540 * @test 1541 */ 1542 UP = 2, 1543 /** 1544 * Down. 1545 * 1546 * @syscap SystemCapability.Test.UiTest 1547 * @since 10 1548 * @test 1549 */ 1550 /** 1551 * Down. 1552 * 1553 * @syscap SystemCapability.Test.UiTest 1554 * @atomicservice 1555 * @since 11 1556 * @test 1557 */ 1558 /** 1559 * Down. 1560 * 1561 * @syscap SystemCapability.Test.UiTest 1562 * @crossplatform 1563 * @atomicservice 1564 * @since 12 1565 * @test 1566 */ 1567 DOWN = 3, 1568} 1569 1570/** 1571 * Enumerates the id of the button on the mouse. 1572 * 1573 * @enum { number } 1574 * @syscap SystemCapability.Test.UiTest 1575 * @since 10 1576 */ 1577/** 1578 * Enumerates the id of the button on the mouse. 1579 * 1580 * @enum { number } 1581 * @syscap SystemCapability.Test.UiTest 1582 * @atomicservice 1583 * @since 11 1584 */ 1585declare enum MouseButton { 1586 /** 1587 * Left button of the mouse. 1588 * 1589 * @syscap SystemCapability.Test.UiTest 1590 * @since 10 1591 * @test 1592 */ 1593 /** 1594 * Left button of the mouse. 1595 * 1596 * @syscap SystemCapability.Test.UiTest 1597 * @atomicservice 1598 * @since 11 1599 * @test 1600 */ 1601 MOUSE_BUTTON_LEFT = 0, 1602 /** 1603 * Right button of the mouse.. 1604 * 1605 * @syscap SystemCapability.Test.UiTest 1606 * @since 10 1607 * @test 1608 */ 1609 /** 1610 * Right button of the mouse.. 1611 * 1612 * @syscap SystemCapability.Test.UiTest 1613 * @atomicservice 1614 * @since 11 1615 * @test 1616 */ 1617 MOUSE_BUTTON_RIGHT = 1, 1618 /** 1619 * MIDDLE button of the mouse. 1620 * 1621 * @syscap SystemCapability.Test.UiTest 1622 * @since 10 1623 * @test 1624 */ 1625 /** 1626 * MIDDLE button of the mouse. 1627 * 1628 * @syscap SystemCapability.Test.UiTest 1629 * @atomicservice 1630 * @since 11 1631 * @test 1632 */ 1633 MOUSE_BUTTON_MIDDLE = 2, 1634} 1635 1636/** 1637 * Additional options touchpad multi-finger swipe gestures. 1638 * @interface TouchPadSwipeOptions 1639 * @syscap SystemCapability.Test.UiTest 1640 * @atomicservice 1641 * @since 18 1642 * @test 1643 */ 1644declare interface TouchPadSwipeOptions { 1645 /** 1646 * Whether stay for 1 second and lift up after swipe, default is false. 1647 * @type { ?boolean } 1648 * @syscap SystemCapability.Test.UiTest 1649 * @atomicservice 1650 * @since 18 1651 * @test 1652 */ 1653 stay?: boolean; 1654 1655 /** 1656 * Speed(pixels per second) of touchpad multi-finger swipe, default is 2000, the value ranges from 200 to 40000,set it 2000 if out of range. 1657 * @type { ?number } 1658 * @syscap SystemCapability.Test.UiTest 1659 * @atomicservice 1660 * @since 18 1661 * @test 1662 */ 1663 speed?: number; 1664} 1665 1666/** 1667 * Describes the attribute requirements for the target Components. 1668 * 1669 * @syscap SystemCapability.Test.UiTest 1670 * @since 9 1671 */ 1672/** 1673 * Describes the attribute requirements for the target Components. 1674 * 1675 * @syscap SystemCapability.Test.UiTest 1676 * @atomicservice 1677 * @since 11 1678 */ 1679/** 1680 * Describes the attribute requirements for the target Components. 1681 * 1682 * @syscap SystemCapability.Test.UiTest 1683 * @crossplatform 1684 * @atomicservice 1685 * @since 12 1686 */ 1687declare class On { 1688 /** 1689 * Specifies the text for the target Component. 1690 * 1691 * @param { string } txt The text value. 1692 * @param { MatchPattern } pattern The {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS} 1693 * @returns { On } this {@link On} object. 1694 * @throws { BusinessError } 401 - if the input parameters are invalid. 1695 * @syscap SystemCapability.Test.UiTest 1696 * @since 9 1697 * @test 1698 */ 1699 /** 1700 * Specifies the text for the target Component. 1701 * 1702 * @param { string } txt The text value. 1703 * @param { MatchPattern } pattern The {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS} 1704 * @returns { On } this {@link On} object. 1705 * @throws { BusinessError } 401 - if the input parameters are invalid. 1706 * @syscap SystemCapability.Test.UiTest 1707 * @crossplatform 1708 * @since 10 1709 * @test 1710 */ 1711 /** 1712 * Specifies the text for the target Component. 1713 * 1714 * @param { string } txt - the text value. 1715 * @param { MatchPattern } [pattern] - the {@link MatchPattern} of the text value,Set it default {@link MatchPattern.EQUALS} if null or undefined. 1716 * @returns { On } this {@link On} object. 1717 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1718 * @syscap SystemCapability.Test.UiTest 1719 * @crossplatform 1720 * @atomicservice 1721 * @since 11 1722 * @test 1723 */ 1724 text(txt: string, pattern?: MatchPattern): On; 1725 1726 /** 1727 * Specifies the id of the target Component. 1728 * 1729 * @param { string } id The id value. 1730 * @returns { On } this {@link On} object. 1731 * @throws { BusinessError } 401 - if the input parameters are invalid. 1732 * @syscap SystemCapability.Test.UiTest 1733 * @since 9 1734 * @test 1735 */ 1736 /** 1737 * Specifies the id of the target Component. 1738 * 1739 * @param { string } id The id value. 1740 * @returns { On } this {@link On} object. 1741 * @throws { BusinessError } 401 - if the input parameters are invalid. 1742 * @syscap SystemCapability.Test.UiTest 1743 * @crossplatform 1744 * @since 10 1745 * @test 1746 */ 1747 /** 1748 * Specifies the id of the target Component. 1749 * 1750 * @param { string } id - the id value. 1751 * @returns { On } this {@link On} object. 1752 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1753 * @syscap SystemCapability.Test.UiTest 1754 * @crossplatform 1755 * @atomicservice 1756 * @since 11 1757 * @test 1758 */ 1759 id(id: string): On; 1760 1761 /** 1762 * Specifies the type of the target Component. 1763 * 1764 * @param { string } tp The type value. 1765 * @returns { On } this {@link On} object. 1766 * @throws { BusinessError } 401 - if the input parameters are invalid. 1767 * @syscap SystemCapability.Test.UiTest 1768 * @since 9 1769 * @test 1770 */ 1771 /** 1772 * Specifies the type of the target Component. 1773 * 1774 * @param { string } tp The type value. 1775 * @returns { On } this {@link On} object. 1776 * @throws { BusinessError } 401 - if the input parameters are invalid. 1777 * @syscap SystemCapability.Test.UiTest 1778 * @crossplatform 1779 * @since 10 1780 * @test 1781 */ 1782 /** 1783 * Specifies the type of the target Component. 1784 * 1785 * @param { string } tp - The type value. 1786 * @returns { On } this {@link On} object. 1787 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 1788 * @syscap SystemCapability.Test.UiTest 1789 * @crossplatform 1790 * @atomicservice 1791 * @since 11 1792 * @test 1793 */ 1794 type(tp: string): On; 1795 1796 /** 1797 * Specifies the clickable status of the target Component. 1798 * 1799 * @param { boolean } b The clickable status,default to true. 1800 * @returns { On } this {@link On} object. 1801 * @throws { BusinessError } 401 - if the input parameters are invalid. 1802 * @syscap SystemCapability.Test.UiTest 1803 * @since 9 1804 * @test 1805 */ 1806 /** 1807 * Specifies the clickable status of the target Component. 1808 * 1809 * @param { boolean } b The clickable status,default to true. 1810 * @returns { On } this {@link On} object. 1811 * @throws { BusinessError } 401 - if the input parameters are invalid. 1812 * @syscap SystemCapability.Test.UiTest 1813 * @crossplatform 1814 * @since 10 1815 * @test 1816 */ 1817 /** 1818 * Specifies the clickable status of the target Component. 1819 * 1820 * @param { boolean } [b] - the clickable status.Set it default true if null or undefined. 1821 * @returns { On } this {@link On} object. 1822 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 1823 * @syscap SystemCapability.Test.UiTest 1824 * @crossplatform 1825 * @atomicservice 1826 * @since 11 1827 * @test 1828 */ 1829 clickable(b?: boolean): On; 1830 1831 /** 1832 * Specifies the longClickable status of the target Component. 1833 * 1834 * @param { boolean } b The clickable status,default to true. 1835 * @returns { On } this {@link On} object. 1836 * @throws { BusinessError } 401 - if the input parameters are invalid. 1837 * @syscap SystemCapability.Test.UiTest 1838 * @since 9 1839 * @test 1840 */ 1841 /** 1842 * Specifies the longClickable status of the target Component. 1843 * 1844 * @param { boolean } b The clickable status,default to true. 1845 * @returns { On } this {@link On} object. 1846 * @throws { BusinessError } 401 - if the input parameters are invalid. 1847 * @syscap SystemCapability.Test.UiTest 1848 * @crossplatform 1849 * @since 10 1850 * @test 1851 */ 1852 /** 1853 * Specifies the longClickable status of the target Component. 1854 * 1855 * @param { boolean } [b] - the longClickable status.Set it default true if null or undefined. 1856 * @returns { On } this {@link On} object. 1857 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 1858 * @syscap SystemCapability.Test.UiTest 1859 * @crossplatform 1860 * @atomicservice 1861 * @since 11 1862 * @test 1863 */ 1864 longClickable(b?: boolean): On; 1865 1866 /** 1867 * Specifies the scrollable status of the target Component. 1868 * 1869 * @param { boolean } b The scrollable status,default to true. 1870 * @returns { On } this {@link On} object. 1871 * @throws { BusinessError } 401 - if the input parameters are invalid. 1872 * @syscap SystemCapability.Test.UiTest 1873 * @since 9 1874 * @test 1875 */ 1876 /** 1877 * Specifies the scrollable status of the target Component. 1878 * 1879 * @param { boolean } b The scrollable status,default to true. 1880 * @returns { On } this {@link On} object. 1881 * @throws { BusinessError } 401 - if the input parameters are invalid. 1882 * @syscap SystemCapability.Test.UiTest 1883 * @crossplatform 1884 * @since 10 1885 * @test 1886 */ 1887 /** 1888 * Specifies the scrollable status of the target Component. 1889 * 1890 * @param { boolean } [b] - the scrollable status.Set it default true if null or undefined. 1891 * @returns { On } this {@link On} object. 1892 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 1893 * @syscap SystemCapability.Test.UiTest 1894 * @crossplatform 1895 * @atomicservice 1896 * @since 11 1897 * @test 1898 */ 1899 scrollable(b?: boolean): On; 1900 1901 /** 1902 * Specifies the enabled status of the target Component. 1903 * 1904 * @param { boolean } b The enabled status,default to true. 1905 * @returns { On } this {@link On} object. 1906 * @throws { BusinessError } 401 - if the input parameters are invalid. 1907 * @syscap SystemCapability.Test.UiTest 1908 * @since 9 1909 * @test 1910 */ 1911 /** 1912 * Specifies the enabled status of the target Component. 1913 * 1914 * @param { boolean } b The enabled status,default to true. 1915 * @returns { On } this {@link On} object. 1916 * @throws { BusinessError } 401 - if the input parameters are invalid. 1917 * @syscap SystemCapability.Test.UiTest 1918 * @crossplatform 1919 * @since 10 1920 * @test 1921 */ 1922 /** 1923 * Specifies the enabled status of the target Component. 1924 * 1925 * @param { boolean } [b] - the enabled status.Set it default true if null or undefined. 1926 * @returns { On } this {@link On} object. 1927 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 1928 * @syscap SystemCapability.Test.UiTest 1929 * @crossplatform 1930 * @atomicservice 1931 * @since 11 1932 * @test 1933 */ 1934 enabled(b?: boolean): On; 1935 1936 /** 1937 * Specifies the focused status of the target Component. 1938 * 1939 * @param { boolean } b The focused status,default to true. 1940 * @returns { On } this {@link On} object. 1941 * @throws { BusinessError } 401 - if the input parameters are invalid. 1942 * @syscap SystemCapability.Test.UiTest 1943 * @since 9 1944 * @test 1945 */ 1946 /** 1947 * Specifies the focused status of the target Component. 1948 * 1949 * @param { boolean } b The focused status,default to true. 1950 * @returns { On } this {@link On} object. 1951 * @throws { BusinessError } 401 - if the input parameters are invalid. 1952 * @syscap SystemCapability.Test.UiTest 1953 * @crossplatform 1954 * @since 10 1955 * @test 1956 */ 1957 /** 1958 * Specifies the focused status of the target Component. 1959 * 1960 * @param { boolean } [b] - the focused status.Set it default true if null or undefined. 1961 * @returns { On } this {@link On} object. 1962 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 1963 * @syscap SystemCapability.Test.UiTest 1964 * @crossplatform 1965 * @atomicservice 1966 * @since 11 1967 * @test 1968 */ 1969 focused(b?: boolean): On; 1970 1971 /** 1972 * Specifies the selected status of the target Component. 1973 * 1974 * @param { boolean } b The selected status,default to true. 1975 * @returns { On } this {@link On} object. 1976 * @throws { BusinessError } 401 - if the input parameters are invalid. 1977 * @syscap SystemCapability.Test.UiTest 1978 * @since 9 1979 * @test 1980 */ 1981 /** 1982 * Specifies the selected status of the target Component. 1983 * 1984 * @param { boolean } b The selected status,default to true. 1985 * @returns { On } this {@link On} object. 1986 * @throws { BusinessError } 401 - if the input parameters are invalid. 1987 * @syscap SystemCapability.Test.UiTest 1988 * @crossplatform 1989 * @since 10 1990 * @test 1991 */ 1992 /** 1993 * Specifies the selected status of the target Component. 1994 * 1995 * @param { boolean } [b] the - selected status.Set it default true if null or undefined. 1996 * @returns { On } this {@link On} object. 1997 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 1998 * @syscap SystemCapability.Test.UiTest 1999 * @crossplatform 2000 * @atomicservice 2001 * @since 11 2002 * @test 2003 */ 2004 selected(b?: boolean): On; 2005 2006 /** 2007 * Specifies the checked status of the target Component. 2008 * 2009 * @param { boolean } b The checked status,default to false. 2010 * @returns { On } this {@link On} object. 2011 * @throws { BusinessError } 401 - if the input parameters are invalid. 2012 * @syscap SystemCapability.Test.UiTest 2013 * @since 9 2014 * @test 2015 */ 2016 /** 2017 * Specifies the checked status of the target Component. 2018 * 2019 * @param { boolean } b The checked status,default to false. 2020 * @returns { On } this {@link On} object. 2021 * @throws { BusinessError } 401 - if the input parameters are invalid. 2022 * @syscap SystemCapability.Test.UiTest 2023 * @crossplatform 2024 * @since 10 2025 * @test 2026 */ 2027 /** 2028 * Specifies the checked status of the target Component. 2029 * 2030 * @param { boolean } [b] - the checked status.Set it default false if null or undefined. 2031 * @returns { On } this {@link On} object. 2032 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 2033 * @syscap SystemCapability.Test.UiTest 2034 * @crossplatform 2035 * @atomicservice 2036 * @since 11 2037 * @test 2038 */ 2039 checked(b?: boolean): On; 2040 2041 /** 2042 * Specifies the checkable status of the target Component. 2043 * 2044 * @param { boolean } b The checkable status,default to false. 2045 * @returns { On } this {@link On} object. 2046 * @throws { BusinessError } 401 - if the input parameters are invalid. 2047 * @syscap SystemCapability.Test.UiTest 2048 * @since 9 2049 * @test 2050 */ 2051 /** 2052 * Specifies the checkable status of the target Component. 2053 * 2054 * @param { boolean } b The checkable status,default to false. 2055 * @returns { On } this {@link On} object. 2056 * @throws { BusinessError } 401 - if the input parameters are invalid. 2057 * @syscap SystemCapability.Test.UiTest 2058 * @crossplatform 2059 * @since 10 2060 * @test 2061 */ 2062 /** 2063 * Specifies the checkable status of the target Component. 2064 * 2065 * @param { boolean } [b] - the checkable status.Set it default false if null or undefined. 2066 * @returns { On } this {@link On} object. 2067 * @throws { BusinessError } 401 - Parameter error. 1. Incorrect parameter types; 2. Parameter verification failed. 2068 * @syscap SystemCapability.Test.UiTest 2069 * @crossplatform 2070 * @atomicservice 2071 * @since 11 2072 * @test 2073 */ 2074 checkable(b?: boolean): On; 2075 2076 /** 2077 * Requires that the target Component which is before another Component that specified by the given {@link On} 2078 * object,used to locate Component relatively. 2079 * 2080 * @param { On } on Describes the attribute requirements of Component which the target one is in front of. 2081 * @returns { On } this {@link On} object. 2082 * @throws { BusinessError } 401 - if the input parameters are invalid. 2083 * @syscap SystemCapability.Test.UiTest 2084 * @since 9 2085 * @test 2086 */ 2087 /** 2088 * Requires that the target Component which is before another Component that specified by the given {@link On} 2089 * object,used to locate Component relatively. 2090 * 2091 * @param { On } on - describes the attribute requirements of Component which the target one is in front of. 2092 * @returns { On } this {@link On} object. 2093 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2094 * @syscap SystemCapability.Test.UiTest 2095 * @crossplatform 2096 * @atomicservice 2097 * @since 11 2098 * @test 2099 */ 2100 isBefore(on: On): On; 2101 2102 /** 2103 * Requires that the target Component which is after another Component that specified by the given {@link On} 2104 * object,used to locate Component relatively. 2105 * 2106 * @param { On } on Describes the attribute requirements of Component which the target one is in back of. 2107 * @returns { On } this {@link On} object. 2108 * @throws { BusinessError } 401 - if the input parameters are invalid. 2109 * @syscap SystemCapability.Test.UiTest 2110 * @since 9 2111 * @test 2112 */ 2113 /** 2114 * Requires that the target Component which is after another Component that specified by the given {@link On} 2115 * object,used to locate Component relatively. 2116 * 2117 * @param { On } on - describes the attribute requirements of Component which the target one is in back of. 2118 * @returns { On } this {@link On} object. 2119 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2120 * @syscap SystemCapability.Test.UiTest 2121 * @crossplatform 2122 * @atomicservice 2123 * @since 11 2124 * @test 2125 */ 2126 isAfter(on: On): On; 2127 2128 /** 2129 * Requires that the target Component which is inside of another Component that specified by the given {@link On} 2130 * object,used to locate Component relatively. 2131 * 2132 * @param { On } on Describes the attribute requirements of Component which the target one is inside of. 2133 * @returns { On } this {@link On} object. 2134 * @throws { BusinessError } 401 - if the input parameters are invalid. 2135 * @syscap SystemCapability.Test.UiTest 2136 * @since 10 2137 * @test 2138 */ 2139 /** 2140 * Requires that the target Component which is inside of another Component that specified by the given {@link On} 2141 * object,used to locate Component relatively. 2142 * 2143 * @param { On } on - describes the attribute requirements of Component which the target one is inside of. 2144 * @returns { On } this {@link On} object. 2145 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2146 * @syscap SystemCapability.Test.UiTest 2147 * @crossplatform 2148 * @atomicservice 2149 * @since 11 2150 * @test 2151 */ 2152 within(on: On): On; 2153 2154 /** 2155 * Specifies the bundleName of the application which the window that the target Component is located belongs. 2156 * 2157 * @param { string } bundleName The bundleName of the specified window. 2158 * @returns { On } this {@link On} object. 2159 * @throws { BusinessError } 401 - if the input parameters are invalid. 2160 * @syscap SystemCapability.Test.UiTest 2161 * @since 10 2162 * @test 2163 */ 2164 /** 2165 * Specifies the bundleName of the application which the window that the target Component is located belongs. 2166 * 2167 * @param { string } bundleName - the bundleName of the specified window. 2168 * @returns { On } this {@link On} object. 2169 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2170 * @syscap SystemCapability.Test.UiTest 2171 * @atomicservice 2172 * @since 11 2173 * @test 2174 */ 2175 inWindow(bundleName: string): On; 2176 2177 /** 2178 * Specifies the description for the target Component. 2179 * 2180 * @param { string } val - the description value. 2181 * @param { MatchPattern } [pattern] - the {@link MatchPattern} of description value,set it default {@link MatchPattern.EQUALS} if null or undefined. 2182 * @returns { On } this {@link On} object. 2183 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2184 * @syscap SystemCapability.Test.UiTest 2185 * @atomicservice 2186 * @since 11 2187 * @test 2188 */ 2189 description(val: string, pattern?: MatchPattern): On; 2190 /** 2191 * Specifies the id of the target Component. 2192 * 2193 * @param { string } id - the id value. 2194 * @param { MatchPattern } pattern - the {@link MatchPattern} of the text value,Set it default {@link MatchPattern.EQUALS} if null or undefined. 2195 * @returns { On } this {@link On} object. 2196 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2197 * @syscap SystemCapability.Test.UiTest 2198 * @atomicservice 2199 * @since 18 2200 * @test 2201 */ 2202 id(id: string, pattern: MatchPattern): On; 2203 /** 2204 * Specifies the type of the target Component. 2205 * 2206 * @param { string } tp - The type value. 2207 * @param { MatchPattern } pattern - the {@link MatchPattern} of the text value,Set it default {@link MatchPattern.EQUALS} if null or undefined. 2208 * @returns { On } this {@link On} object. 2209 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2210 * @syscap SystemCapability.Test.UiTest 2211 * @atomicservice 2212 * @since 18 2213 * @test 2214 */ 2215 type(tp: string, pattern: MatchPattern): On; 2216 /** 2217 * Specifies the hint for the target Component. 2218 * 2219 * @param { string } val - the hint value. 2220 * @param { MatchPattern } [pattern] - the {@link MatchPattern} of the text value,Set it default {@link MatchPattern.EQUALS} if null or undefined. 2221 * @returns { On } this {@link On} object. 2222 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2223 * @syscap SystemCapability.Test.UiTest 2224 * @atomicservice 2225 * @since 18 2226 * @test 2227 */ 2228 hint(val: string, pattern?: MatchPattern): On; 2229} 2230 2231/** 2232 * Represents an Component of the ohos application,user can perform operations or query attributes on it. 2233 * 2234 * @syscap SystemCapability.Test.UiTest 2235 * @since 9 2236 * @test 2237 */ 2238/** 2239 * Represents an Component of the ohos application,user can perform operations or query attributes on it. 2240 * 2241 * @syscap SystemCapability.Test.UiTest 2242 * @atomicservice 2243 * @since 11 2244 * @test 2245 */ 2246/** 2247 * Represents an Component of the ohos application,user can perform operations or query attributes on it. 2248 * 2249 * @syscap SystemCapability.Test.UiTest 2250 * @crossplatform 2251 * @atomicservice 2252 * @since 12 2253 * @test 2254 */ 2255declare class Component { 2256 /** 2257 * Click this {@link Component}. 2258 * 2259 * @returns { Promise<void> } 2260 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2261 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2262 * @syscap SystemCapability.Test.UiTest 2263 * @since 9 2264 * @test 2265 */ 2266 /** 2267 * Click this {@link Component}. 2268 * 2269 * @returns { Promise<void> } 2270 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2271 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2272 * @syscap SystemCapability.Test.UiTest 2273 * @crossplatform 2274 * @since 10 2275 * @test 2276 */ 2277 /** 2278 * Click this {@link Component}. 2279 * 2280 * @returns { Promise<void> } 2281 * @throws { BusinessError } 17000002 - The async function is not called with await. 2282 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2283 * @syscap SystemCapability.Test.UiTest 2284 * @crossplatform 2285 * @atomicservice 2286 * @since 11 2287 * @test 2288 */ 2289 click(): Promise<void>; 2290 2291 /** 2292 * Double click this {@link Component}. 2293 * 2294 * @returns { Promise<void> } 2295 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2296 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2297 * @syscap SystemCapability.Test.UiTest 2298 * @since 9 2299 * @test 2300 */ 2301 /** 2302 * Double click this {@link Component}. 2303 * 2304 * @returns { Promise<void> } 2305 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2306 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2307 * @syscap SystemCapability.Test.UiTest 2308 * @crossplatform 2309 * @since 10 2310 * @test 2311 */ 2312 /** 2313 * Double click this {@link Component}. 2314 * 2315 * @returns { Promise<void> } 2316 * @throws { BusinessError } 17000002 - The async function is not called with await. 2317 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2318 * @syscap SystemCapability.Test.UiTest 2319 * @crossplatform 2320 * @atomicservice 2321 * @since 11 2322 * @test 2323 */ 2324 doubleClick(): Promise<void>; 2325 2326 /** 2327 * Long click this {@link Component}. 2328 * 2329 * @returns { Promise<void> } 2330 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2331 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2332 * @syscap SystemCapability.Test.UiTest 2333 * @since 9 2334 * @test 2335 */ 2336 /** 2337 * Long click this {@link Component}. 2338 * 2339 * @returns { Promise<void> } 2340 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2341 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2342 * @syscap SystemCapability.Test.UiTest 2343 * @crossplatform 2344 * @since 10 2345 * @test 2346 */ 2347 /** 2348 * Long click this {@link Component}. 2349 * 2350 * @returns { Promise<void> } 2351 * @throws { BusinessError } 17000002 - The async function is not called with await. 2352 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2353 * @syscap SystemCapability.Test.UiTest 2354 * @crossplatform 2355 * @atomicservice 2356 * @since 11 2357 * @test 2358 */ 2359 longClick(): Promise<void>; 2360 2361 /** 2362 * Get the id attribute value. 2363 * 2364 * @returns { Promise<string> } the id value. 2365 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2366 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2367 * @syscap SystemCapability.Test.UiTest 2368 * @since 9 2369 * @test 2370 */ 2371 /** 2372 * Get the id attribute value. 2373 * 2374 * @returns { Promise<string> } the id value. 2375 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2376 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2377 * @syscap SystemCapability.Test.UiTest 2378 * @crossplatform 2379 * @since 10 2380 * @test 2381 */ 2382 /** 2383 * Get the id attribute value. 2384 * 2385 * @returns { Promise<string> } the id value. 2386 * @throws { BusinessError } 17000002 - The async function is not called with await. 2387 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2388 * @syscap SystemCapability.Test.UiTest 2389 * @crossplatform 2390 * @atomicservice 2391 * @since 11 2392 * @test 2393 */ 2394 getId(): Promise<string>; 2395 2396 /** 2397 * Get the text attribute value. 2398 * 2399 * @returns { Promise<string> } the text value. 2400 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2401 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2402 * @syscap SystemCapability.Test.UiTest 2403 * @since 9 2404 * @test 2405 */ 2406 /** 2407 * Get the text attribute value. 2408 * 2409 * @returns { Promise<string> } the text value. 2410 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2411 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2412 * @syscap SystemCapability.Test.UiTest 2413 * @crossplatform 2414 * @since 10 2415 * @test 2416 */ 2417 /** 2418 * Get the text attribute value. 2419 * 2420 * @returns { Promise<string> } the text value. 2421 * @throws { BusinessError } 17000002 - The async function is not called with await. 2422 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2423 * @syscap SystemCapability.Test.UiTest 2424 * @crossplatform 2425 * @atomicservice 2426 * @since 11 2427 * @test 2428 */ 2429 getText(): Promise<string>; 2430 2431 /** 2432 * Get the type name. 2433 * 2434 * @returns { Promise<string> } the type name. 2435 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2436 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2437 * @syscap SystemCapability.Test.UiTest 2438 * @since 9 2439 * @test 2440 */ 2441 /** 2442 * Get the type name. 2443 * 2444 * @returns { Promise<string> } the type name. 2445 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2446 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2447 * @syscap SystemCapability.Test.UiTest 2448 * @crossplatform 2449 * @since 10 2450 * @test 2451 */ 2452 /** 2453 * Get the type name. 2454 * 2455 * @returns { Promise<string> } the type name. 2456 * @throws { BusinessError } 17000002 - The async function is not called with await. 2457 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2458 * @syscap SystemCapability.Test.UiTest 2459 * @crossplatform 2460 * @atomicservice 2461 * @since 11 2462 * @test 2463 */ 2464 getType(): Promise<string>; 2465 2466 /** 2467 * Get the clickable status of this {@link Component}. 2468 * 2469 * @returns { Promise<boolean> } the clickable status. 2470 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2471 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2472 * @syscap SystemCapability.Test.UiTest 2473 * @since 9 2474 * @test 2475 */ 2476 /** 2477 * Get the clickable status of this {@link Component}. 2478 * 2479 * @returns { Promise<boolean> } the clickable status. 2480 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2481 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2482 * @syscap SystemCapability.Test.UiTest 2483 * @crossplatform 2484 * @since 10 2485 * @test 2486 */ 2487 /** 2488 * Get the clickable status of this {@link Component}. 2489 * 2490 * @returns { Promise<boolean> } the clickable status. 2491 * @throws { BusinessError } 17000002 - The async function is not called with await. 2492 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2493 * @syscap SystemCapability.Test.UiTest 2494 * @crossplatform 2495 * @atomicservice 2496 * @since 11 2497 * @test 2498 */ 2499 isClickable(): Promise<boolean>; 2500 2501 /** 2502 * Get the longClickable status of this {@link Component}. 2503 * 2504 * @returns { Promise<boolean> } the longClickable status. 2505 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2506 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2507 * @syscap SystemCapability.Test.UiTest 2508 * @since 9 2509 * @test 2510 */ 2511 /** 2512 * Get the longClickable status of this {@link Component}. 2513 * 2514 * @returns { Promise<boolean> } the longClickable status. 2515 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2516 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2517 * @syscap SystemCapability.Test.UiTest 2518 * @crossplatform 2519 * @since 10 2520 * @test 2521 */ 2522 /** 2523 * Get the clickable status of this {@link Component}. 2524 * 2525 * @returns { Promise<boolean> } the clickable status. 2526 * @throws { BusinessError } 17000002 - The async function is not called with await. 2527 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2528 * @syscap SystemCapability.Test.UiTest 2529 * @crossplatform 2530 * @atomicservice 2531 * @since 11 2532 * @test 2533 */ 2534 isLongClickable(): Promise<boolean>; 2535 2536 /** 2537 * Get the scrollable status of this {@link Component}. 2538 * 2539 * @returns { Promise<boolean> } the scrollable status. 2540 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2541 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2542 * @syscap SystemCapability.Test.UiTest 2543 * @since 9 2544 * @test 2545 */ 2546 /** 2547 * Get the scrollable status of this {@link Component}. 2548 * 2549 * @returns { Promise<boolean> } the scrollable status. 2550 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2551 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2552 * @syscap SystemCapability.Test.UiTest 2553 * @crossplatform 2554 * @since 10 2555 * @test 2556 */ 2557 /** 2558 * Get the scrollable status of this {@link Component}. 2559 * 2560 * @returns { Promise<boolean> } the scrollable status. 2561 * @throws { BusinessError } 17000002 - The async function is not called with await. 2562 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2563 * @syscap SystemCapability.Test.UiTest 2564 * @crossplatform 2565 * @atomicservice 2566 * @since 11 2567 * @test 2568 */ 2569 isScrollable(): Promise<boolean>; 2570 2571 /** 2572 * Get the enabled status of this {@link Component}. 2573 * 2574 * @returns { Promise<boolean> } the enabled status. 2575 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2576 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2577 * @syscap SystemCapability.Test.UiTest 2578 * @since 9 2579 * @test 2580 */ 2581 /** 2582 * Get the enabled status of this {@link Component}. 2583 * 2584 * @returns { Promise<boolean> } the enabled status. 2585 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2586 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2587 * @syscap SystemCapability.Test.UiTest 2588 * @crossplatform 2589 * @since 10 2590 * @test 2591 */ 2592 /** 2593 * Get the enabled status of this {@link Component}. 2594 * 2595 * @returns { Promise<boolean> } the enabled status. 2596 * @throws { BusinessError } 17000002 - The async function is not called with await. 2597 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2598 * @syscap SystemCapability.Test.UiTest 2599 * @crossplatform 2600 * @atomicservice 2601 * @since 11 2602 * @test 2603 */ 2604 isEnabled(): Promise<boolean>; 2605 2606 /** 2607 * Get the focused status of this {@link Component}. 2608 * 2609 * @returns { Promise<boolean> } the focused status. 2610 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2611 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2612 * @syscap SystemCapability.Test.UiTest 2613 * @since 9 2614 * @test 2615 */ 2616 /** 2617 * Get the focused status of this {@link Component}. 2618 * 2619 * @returns { Promise<boolean> } the focused status. 2620 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2621 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2622 * @syscap SystemCapability.Test.UiTest 2623 * @crossplatform 2624 * @since 10 2625 * @test 2626 */ 2627 /** 2628 * Get the focused status of this {@link Component}. 2629 * 2630 * @returns { Promise<boolean> } the focused status. 2631 * @throws { BusinessError } 17000002 - The async function is not called with await. 2632 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2633 * @syscap SystemCapability.Test.UiTest 2634 * @crossplatform 2635 * @atomicservice 2636 * @since 11 2637 * @test 2638 */ 2639 isFocused(): Promise<boolean>; 2640 2641 /** 2642 * Get the selected status of this {@link Component}. 2643 * 2644 * @returns { Promise<boolean> } the selected status. 2645 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2646 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2647 * @syscap SystemCapability.Test.UiTest 2648 * @since 9 2649 * @test 2650 */ 2651 /** 2652 * Get the selected status of this {@link Component}. 2653 * 2654 * @returns { Promise<boolean> } the selected status. 2655 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2656 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2657 * @syscap SystemCapability.Test.UiTest 2658 * @crossplatform 2659 * @since 10 2660 * @test 2661 */ 2662 /** 2663 * Get the selected status of this {@link Component}. 2664 * 2665 * @returns { Promise<boolean> } the selected status. 2666 * @throws { BusinessError } 17000002 - The async function is not called with await. 2667 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2668 * @syscap SystemCapability.Test.UiTest 2669 * @crossplatform 2670 * @atomicservice 2671 * @since 11 2672 * @test 2673 */ 2674 isSelected(): Promise<boolean>; 2675 2676 /** 2677 * Get the checked status of this {@link Component}. 2678 * 2679 * @returns { Promise<boolean> } the checked status. 2680 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2681 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2682 * @syscap SystemCapability.Test.UiTest 2683 * @since 9 2684 * @test 2685 */ 2686 /** 2687 * Get the checked status of this {@link Component}. 2688 * 2689 * @returns { Promise<boolean> } the checked status. 2690 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2691 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2692 * @syscap SystemCapability.Test.UiTest 2693 * @crossplatform 2694 * @since 10 2695 * @test 2696 */ 2697 /** 2698 * Get the checked status of this {@link Component}. 2699 * 2700 * @returns { Promise<boolean> } the checked status. 2701 * @throws { BusinessError } 17000002 - The async function is not called with await. 2702 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2703 * @syscap SystemCapability.Test.UiTest 2704 * @crossplatform 2705 * @atomicservice 2706 * @since 11 2707 * @test 2708 */ 2709 isChecked(): Promise<boolean>; 2710 2711 /** 2712 * Get the checkable status of this {@link Component}. 2713 * 2714 * @returns { Promise<boolean> } the checkable status. 2715 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2716 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2717 * @syscap SystemCapability.Test.UiTest 2718 * @since 9 2719 * @test 2720 */ 2721 /** 2722 * Get the checkable status of this {@link Component}. 2723 * 2724 * @returns { Promise<boolean> } the checkable status. 2725 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2726 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2727 * @syscap SystemCapability.Test.UiTest 2728 * @crossplatform 2729 * @since 10 2730 * @test 2731 */ 2732 /** 2733 * Get the checkable status of this {@link Component}. 2734 * 2735 * @returns { Promise<boolean> } the checkable status. 2736 * @throws { BusinessError } 17000002 - The async function is not called with await. 2737 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2738 * @syscap SystemCapability.Test.UiTest 2739 * @crossplatform 2740 * @atomicservice 2741 * @since 11 2742 * @test 2743 */ 2744 isCheckable(): Promise<boolean>; 2745 2746 /** 2747 * Inject text to this {@link Component},applicable to TextInput. 2748 * 2749 * @param { string } text The text to inject. 2750 * @returns { Promise<void> } 2751 * @throws { BusinessError } 401 - if the input parameters are invalid. 2752 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2753 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2754 * @syscap SystemCapability.Test.UiTest 2755 * @since 9 2756 * @test 2757 */ 2758 /** 2759 * Inject text to this {@link Component},applicable to TextInput. 2760 * 2761 * @param { string } text The text to inject. 2762 * @returns { Promise<void> } 2763 * @throws { BusinessError } 401 - if the input parameters are invalid. 2764 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2765 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2766 * @syscap SystemCapability.Test.UiTest 2767 * @crossplatform 2768 * @since 10 2769 * @test 2770 */ 2771 /** 2772 * Inject text to this {@link Component},applicable to TextInput. 2773 * 2774 * @param { string } text - the text to inject. 2775 * @returns { Promise<void> } 2776 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2777 * @throws { BusinessError } 17000002 - The async function is not called with await. 2778 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2779 * @syscap SystemCapability.Test.UiTest 2780 * @crossplatform 2781 * @atomicservice 2782 * @since 11 2783 * @test 2784 */ 2785 inputText(text: string): Promise<void>; 2786 2787 /** 2788 * Clear text of this {@link Component},applicable to TextInput. 2789 * 2790 * @returns { Promise<void> } 2791 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2792 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2793 * @syscap SystemCapability.Test.UiTest 2794 * @since 9 2795 * @test 2796 */ 2797 /** 2798 * Clear text of this {@link Component},applicable to TextInput. 2799 * 2800 * @returns { Promise<void> } 2801 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2802 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2803 * @syscap SystemCapability.Test.UiTest 2804 * @crossplatform 2805 * @since 10 2806 * @test 2807 */ 2808 /** 2809 * Clear text of this {@link Component},applicable to TextInput. 2810 * 2811 * @returns { Promise<void> } 2812 * @throws { BusinessError } 17000002 - The async function is not called with await. 2813 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2814 * @syscap SystemCapability.Test.UiTest 2815 * @crossplatform 2816 * @atomicservice 2817 * @since 11 2818 * @test 2819 */ 2820 clearText(): Promise<void>; 2821 2822 /** 2823 * Scroll on this {@link Component} to the top,applicable to scrollable one. 2824 * 2825 * @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 2826 * @returns { Promise<void> } 2827 * @throws { BusinessError } 401 - if the input parameters are invalid. 2828 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2829 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2830 * @syscap SystemCapability.Test.UiTest 2831 * @since 9 2832 * @test 2833 */ 2834 /** 2835 * Scroll on this {@link Component} to the top,applicable to scrollable one. 2836 * 2837 * @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 2838 * @returns { Promise<void> } 2839 * @throws { BusinessError } 401 - if the input parameters are invalid. 2840 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2841 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2842 * @syscap SystemCapability.Test.UiTest 2843 * @crossplatform 2844 * @since 10 2845 * @test 2846 */ 2847 /** 2848 * Scroll on this {@link Component} to the top,applicable to scrollable one. 2849 * 2850 * @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. 2851 * @returns { Promise<void> } 2852 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 2853 * @throws { BusinessError } 17000002 - The async function is not called with await. 2854 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2855 * @syscap SystemCapability.Test.UiTest 2856 * @crossplatform 2857 * @atomicservice 2858 * @since 11 2859 * @test 2860 */ 2861 scrollToTop(speed?: number): Promise<void>; 2862 2863 /** 2864 * Scroll on this {@link Component} to the bottom,applicable to scrollable one. 2865 * 2866 * @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 2867 * @returns { Promise<void> } 2868 * @throws { BusinessError } 401 - if the input parameters are invalid. 2869 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2870 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2871 * @syscap SystemCapability.Test.UiTest 2872 * @since 9 2873 * @test 2874 */ 2875 /** 2876 * Scroll on this {@link Component} to the bottom,applicable to scrollable one. 2877 * 2878 * @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 2879 * @returns { Promise<void> } 2880 * @throws { BusinessError } 401 - if the input parameters are invalid. 2881 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2882 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2883 * @syscap SystemCapability.Test.UiTest 2884 * @crossplatform 2885 * @since 10 2886 * @test 2887 */ 2888 /** 2889 * Scroll on this {@link Component} to the bottom,applicable to scrollable one. 2890 * 2891 * @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. 2892 * @returns { Promise<void> } 2893 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. 2894 * @throws { BusinessError } 17000002 - The async function is not called with await. 2895 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2896 * @syscap SystemCapability.Test.UiTest 2897 * @crossplatform 2898 * @atomicservice 2899 * @since 11 2900 * @test 2901 */ 2902 scrollToBottom(speed?: number): Promise<void>; 2903 2904 /** 2905 * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. 2906 * 2907 * @param { On } on The attribute requirements of the target {@link Component}. 2908 * @returns { Promise<Component> } the found result,or undefined if not found. 2909 * @throws { BusinessError } 401 - if the input parameters are invalid. 2910 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2911 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2912 * @syscap SystemCapability.Test.UiTest 2913 * @since 9 2914 * @test 2915 */ 2916 /** 2917 * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. 2918 * 2919 * @param { On } on The attribute requirements of the target {@link Component}. 2920 * @returns { Promise<Component> } the found result,or undefined if not found. 2921 * @throws { BusinessError } 401 - if the input parameters are invalid. 2922 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2923 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2924 * @syscap SystemCapability.Test.UiTest 2925 * @crossplatform 2926 * @since 10 2927 * @test 2928 */ 2929 /** 2930 * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. 2931 * 2932 * @param { On } on - the attribute requirements of the target {@link Component}. 2933 * @returns { Promise<Component> } the found result,or undefined if not found. 2934 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 2935 * @throws { BusinessError } 17000002 - The async function is not called with await. 2936 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2937 * @syscap SystemCapability.Test.UiTest 2938 * @crossplatform 2939 * @atomicservice 2940 * @since 11 2941 * @test 2942 */ 2943 scrollSearch(on: On): Promise<Component>; 2944 2945 /** 2946 * Get the bounds rect of this {@link Component}. 2947 * 2948 * @returns { Promise<Rect> } the bounds rect object. 2949 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2950 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2951 * @syscap SystemCapability.Test.UiTest 2952 * @since 9 2953 * @test 2954 */ 2955 /** 2956 * Get the bounds rect of this {@link Component}. 2957 * 2958 * @returns { Promise<Rect> } the bounds rect object. 2959 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2960 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2961 * @syscap SystemCapability.Test.UiTest 2962 * @atomicservice 2963 * @since 11 2964 * @test 2965 */ 2966 /** 2967 * Get the bounds rect of this {@link Component}. 2968 * 2969 * @returns { Promise<Rect> } the bounds rect object. 2970 * @throws { BusinessError } 17000002 - The async function is not called with await. 2971 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 2972 * @syscap SystemCapability.Test.UiTest 2973 * @crossplatform 2974 * @atomicservice 2975 * @since 12 2976 * @test 2977 */ 2978 getBounds(): Promise<Rect>; 2979 2980 /** 2981 * Get the boundsCenter of this {@link Component}. 2982 * 2983 * @returns { Promise<Point> } the boundsCenter object. 2984 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2985 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2986 * @syscap SystemCapability.Test.UiTest 2987 * @since 9 2988 * @test 2989 */ 2990 /** 2991 * Get the boundsCenter of this {@link Component}. 2992 * 2993 * @returns { Promise<Point> } the boundsCenter object. 2994 * @throws { BusinessError } 17000002 - if the async function was not called with await. 2995 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 2996 * @syscap SystemCapability.Test.UiTest 2997 * @crossplatform 2998 * @since 10 2999 * @test 3000 */ 3001 /** 3002 * Get the boundsCenter of this {@link Component}. 3003 * 3004 * @returns { Promise<Point> } the boundsCenter object. 3005 * @throws { BusinessError } 17000002 - The async function is not called with await. 3006 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 3007 * @syscap SystemCapability.Test.UiTest 3008 * @crossplatform 3009 * @atomicservice 3010 * @since 11 3011 * @test 3012 */ 3013 getBoundsCenter(): Promise<Point>; 3014 3015 /** 3016 * Drag this {@link Component} to the bounds rect of target Component. 3017 * 3018 * @param { Component } target The target {@link Component}. 3019 * @returns { Promise<void> } 3020 * @throws { BusinessError } 401 - if the input parameters are invalid. 3021 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3022 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 3023 * @syscap SystemCapability.Test.UiTest 3024 * @since 9 3025 * @test 3026 */ 3027 /** 3028 * Drag this {@link Component} to the bounds rect of target Component. 3029 * 3030 * @param { Component } target - the target {@link Component}. 3031 * @returns { Promise<void> } 3032 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3033 * @throws { BusinessError } 17000002 - The async function is not called with await. 3034 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 3035 * @syscap SystemCapability.Test.UiTest 3036 * @atomicservice 3037 * @since 11 3038 * @test 3039 */ 3040 dragTo(target: Component): Promise<void>; 3041 3042 /** 3043 * Pinch enlarge this {@link Component} to the target scale. 3044 * 3045 * @param { number } scale The scale of the pinch enlarge this {@link Component}'s size. 3046 * @returns { Promise<void> } 3047 * @throws { BusinessError } 401 - if the input parameters are invalid. 3048 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3049 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 3050 * @syscap SystemCapability.Test.UiTest 3051 * @since 9 3052 * @test 3053 */ 3054 /** 3055 * Pinch enlarge this {@link Component} to the target scale. 3056 * 3057 * @param { number } scale - the scale of the pinch enlarge this {@link Component}'s size, ranges greater than 1. 3058 * @returns { Promise<void> } 3059 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3060 * @throws { BusinessError } 17000002 - The async function is not called with await. 3061 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 3062 * @syscap SystemCapability.Test.UiTest 3063 * @crossplatform 3064 * @atomicservice 3065 * @since 11 3066 * @test 3067 */ 3068 pinchOut(scale: number): Promise<void>; 3069 3070 /** 3071 * Pinch shrink this {@link Component} to the target scale. 3072 * 3073 * @param { number } scale The scale of the pinch shrink this {@link Component}'s size. 3074 * @returns { Promise<void> } 3075 * @throws { BusinessError } 401 - if the input parameters are invalid. 3076 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3077 * @throws { BusinessError } 17000004 - if the component is invisible or destroyed. 3078 * @syscap SystemCapability.Test.UiTest 3079 * @since 9 3080 * @test 3081 */ 3082 /** 3083 * Pinch shrink this {@link Component} to the target scale. 3084 * 3085 * @param { number } scale - the scale of the pinch shrink this {@link Component}'s size, ranges from 0 to 1. 3086 * @returns { Promise<void> } 3087 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3088 * @throws { BusinessError } 17000002 - The async function is not called with await. 3089 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 3090 * @syscap SystemCapability.Test.UiTest 3091 * @crossplatform 3092 * @atomicservice 3093 * @since 11 3094 * @test 3095 */ 3096 pinchIn(scale: number): Promise<void>; 3097 3098 /** 3099 * Get the description attribute value. 3100 * 3101 * @returns { Promise<string> } the description value. 3102 * @throws { BusinessError } 17000002 - The async function is not called with await. 3103 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 3104 * @syscap SystemCapability.Test.UiTest 3105 * @atomicservice 3106 * @since 11 3107 * @test 3108 */ 3109 getDescription(): Promise<string>; 3110 /** 3111 * Get the hint attribute value. 3112 * 3113 * @returns { Promise<string> } the hint value. 3114 * @throws { BusinessError } 17000002 - The async function is not called with await. 3115 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 3116 * @syscap SystemCapability.Test.UiTest 3117 * @atomicservice 3118 * @since 18 3119 * @test 3120 */ 3121 getHint(): Promise<string>; 3122 /** 3123 * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. 3124 * 3125 * @param { On } on - the attribute requirements of the target {@link Component}. 3126 * @param { boolean } [vertical] - Whether the swipe direction is vertical, default is true. 3127 * @param { number } [offset] - Offset from the swipe start/end point to the component border, default is 80. 3128 * @returns { Promise<Component> } the found result,or undefined if not found. 3129 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3130 * @throws { BusinessError } 17000002 - The async function is not called with await. 3131 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 3132 * @syscap SystemCapability.Test.UiTest 3133 * @atomicservice 3134 * @since 18 3135 * @test 3136 */ 3137 scrollSearch(on: On, vertical?: boolean, offset?: number): Promise<Component>; 3138} 3139 3140/** 3141 * The unified facade of UiTest framework,can be used to find {@link Component},trigger keyEvents,perform 3142 * coordinates-based UI actions,capture screen and so on. 3143 * 3144 * @syscap SystemCapability.Test.UiTest 3145 * @since 9 3146 * @test 3147 */ 3148/** 3149 * The unified facade of UiTest framework,can be used to find {@link Component},trigger keyEvents,perform 3150 * coordinates-based UI actions,capture screen and so on. 3151 * 3152 * @syscap SystemCapability.Test.UiTest 3153 * @atomicservice 3154 * @since 11 3155 * @test 3156 */ 3157/** 3158 * The unified facade of UiTest framework,can be used to find {@link Component},trigger keyEvents,perform 3159 * coordinates-based UI actions,capture screen and so on. 3160 * 3161 * @syscap SystemCapability.Test.UiTest 3162 * @crossplatform 3163 * @atomicservice 3164 * @since 12 3165 * @test 3166 */ 3167declare class Driver { 3168 /** 3169 * Create an {@link Driver} object. 3170 * 3171 * @returns { Driver } the {@link Driver} object. 3172 * @throws { BusinessError } 17000001 - if the test framework failed to initialize. 3173 * @syscap SystemCapability.Test.UiTest 3174 * @since 9 3175 * @test 3176 */ 3177 /** 3178 * Create an {@link Driver} object. 3179 * 3180 * @returns { Driver } the {@link Driver} object. 3181 * @throws { BusinessError } 17000001 - if the test framework failed to initialize. 3182 * @syscap SystemCapability.Test.UiTest 3183 * @crossplatform 3184 * @since 10 3185 * @test 3186 */ 3187 /** 3188 * Create an {@link Driver} object. 3189 * 3190 * @returns { Driver } the {@link Driver} object. 3191 * @throws { BusinessError } 17000001 - Initialization failed. 3192 * @syscap SystemCapability.Test.UiTest 3193 * @crossplatform 3194 * @atomicservice 3195 * @since 11 3196 * @test 3197 */ 3198 static create(): Driver; 3199 3200 /** 3201 * Delay with specified duration. 3202 * 3203 * @param { number } duration The delay duration in milliseconds. 3204 * @returns { Promise<void> } 3205 * @throws { BusinessError } 401 - if the input parameters are invalid. 3206 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3207 * @syscap SystemCapability.Test.UiTest 3208 * @since 9 3209 * @test 3210 */ 3211 /** 3212 * Delay with specified duration. 3213 * 3214 * @param { number } duration The delay duration in milliseconds. 3215 * @returns { Promise<void> } 3216 * @throws { BusinessError } 401 - if the input parameters are invalid. 3217 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3218 * @syscap SystemCapability.Test.UiTest 3219 * @crossplatform 3220 * @since 10 3221 * @test 3222 */ 3223 /** 3224 * Delay with specified duration. 3225 * 3226 * @param { number } duration - the delay duration in milliseconds, not less than 0. 3227 * @returns { Promise<void> } 3228 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3229 * @throws { BusinessError } 17000002 - The async function is not called with await. 3230 * @syscap SystemCapability.Test.UiTest 3231 * @crossplatform 3232 * @atomicservice 3233 * @since 11 3234 * @test 3235 */ 3236 delayMs(duration: number): Promise<void>; 3237 3238 /** 3239 * Find the first matched {@link Component} on current UI. 3240 * 3241 * @param { On } on The attribute requirements of the target {@link Component}. 3242 * @returns { Promise<Component> } the first matched {@link Component} or undefined. 3243 * @throws { BusinessError } 401 - if the input parameters are invalid. 3244 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3245 * @syscap SystemCapability.Test.UiTest 3246 * @since 9 3247 * @test 3248 */ 3249 /** 3250 * Find the first matched {@link Component} on current UI. 3251 * 3252 * @param { On } on The attribute requirements of the target {@link Component}. 3253 * @returns { Promise<Component> } the first matched {@link Component} or undefined. 3254 * @throws { BusinessError } 401 - if the input parameters are invalid. 3255 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3256 * @syscap SystemCapability.Test.UiTest 3257 * @crossplatform 3258 * @since 10 3259 * @test 3260 */ 3261 /** 3262 * Find the first matched {@link Component} on current UI. 3263 * 3264 * @param { On } on - the attribute requirements of the target {@link Component}. 3265 * @returns { Promise<Component> } the first matched {@link Component} or undefined. 3266 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3267 * @throws { BusinessError } 17000002 - The async function is not called with await. 3268 * @syscap SystemCapability.Test.UiTest 3269 * @crossplatform 3270 * @atomicservice 3271 * @since 11 3272 * @test 3273 */ 3274 findComponent(on: On): Promise<Component>; 3275 3276 /** 3277 * Find the first matched {@link UiWindow} window. 3278 * 3279 * @param { WindowFilter } filter The filer condition of the target {@link UiWindow}. 3280 * @returns { Promise<UiWindow> } the first matched {@link UiWindow} or undefined. 3281 * @throws { BusinessError } 401 - if the input parameters are invalid. 3282 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3283 * @syscap SystemCapability.Test.UiTest 3284 * @since 9 3285 * @test 3286 */ 3287 /** 3288 * Find the first matched {@link UiWindow} window. 3289 * 3290 * @param { WindowFilter } filter - the filer condition of the target {@link UiWindow}. 3291 * @returns { Promise<UiWindow> } the first matched {@link UiWindow} or undefined. 3292 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3293 * @throws { BusinessError } 17000002 - The async function is not called with await. 3294 * @syscap SystemCapability.Test.UiTest 3295 * @atomicservice 3296 * @since 11 3297 * @test 3298 */ 3299 findWindow(filter: WindowFilter): Promise<UiWindow>; 3300 3301 /** 3302 * Find the first matched {@link Component} on current UI during the time given. 3303 * 3304 * @param { On } on The attribute requirements of the target {@link Component}. 3305 * @param { number } time Duration of finding in milliseconds 3306 * @returns { Promise<Component> } the first matched {@link Component} or undefined. 3307 * @throws { BusinessError } 401 - if the input parameters are invalid. 3308 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3309 * @syscap SystemCapability.Test.UiTest 3310 * @since 9 3311 * @test 3312 */ 3313 /** 3314 * Find the first matched {@link Component} on current UI during the time given. 3315 * 3316 * @param { On } on - the attribute requirements of the target {@link Component}. 3317 * @param { number } time - duration of finding in milliseconds, not less than 0. 3318 * @returns { Promise<Component> } the first matched {@link Component} or undefined. 3319 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3320 * @throws { BusinessError } 17000002 - The async function is not called with await. 3321 * @syscap SystemCapability.Test.UiTest 3322 * @atomicservice 3323 * @since 11 3324 * @test 3325 */ 3326 waitForComponent(on: On, time: number): Promise<Component>; 3327 3328 /** 3329 * Find all the matched {@link Component}s on current UI. 3330 * 3331 * @param { On } on The attribute requirements of the target {@link Component}. 3332 * @returns { Promise<Array<Component>> } the matched {@link Component}s list. 3333 * @throws { BusinessError } 401 - if the input parameters are invalid. 3334 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3335 * @syscap SystemCapability.Test.UiTest 3336 * @since 9 3337 * @test 3338 */ 3339 /** 3340 * Find all the matched {@link Component}s on current UI. 3341 * 3342 * @param { On } on The attribute requirements of the target {@link Component}. 3343 * @returns { Promise<Array<Component>> } the matched {@link Component}s list. 3344 * @throws { BusinessError } 401 - if the input parameters are invalid. 3345 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3346 * @syscap SystemCapability.Test.UiTest 3347 * @crossplatform 3348 * @since 10 3349 * @test 3350 */ 3351 /** 3352 * Find all the matched {@link Component}s on current UI. 3353 * 3354 * @param { On } on - the attribute requirements of the target {@link Component}. 3355 * @returns { Promise<Array<Component>> } the matched {@link Component}s list. 3356 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3357 * @throws { BusinessError } 17000002 - The async function is not called with await. 3358 * @syscap SystemCapability.Test.UiTest 3359 * @crossplatform 3360 * @atomicservice 3361 * @since 11 3362 * @test 3363 */ 3364 findComponents(on: On): Promise<Array<Component>>; 3365 3366 /** 3367 * Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised. 3368 * 3369 * @param { On } on The attribute requirements of the target {@link Component}. 3370 * @returns { Promise<void> } 3371 * @throws { BusinessError } 401 - if the input parameters are invalid. 3372 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3373 * @throws { BusinessError } 17000003 - if the assertion failed. 3374 * @syscap SystemCapability.Test.UiTest 3375 * @since 9 3376 * @test 3377 */ 3378 /** 3379 * Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised. 3380 * 3381 * @param { On } on The attribute requirements of the target {@link Component}. 3382 * @returns { Promise<void> } 3383 * @throws { BusinessError } 401 - if the input parameters are invalid. 3384 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3385 * @throws { BusinessError } 17000003 - if the assertion failed. 3386 * @syscap SystemCapability.Test.UiTest 3387 * @crossplatform 3388 * @since 10 3389 * @test 3390 */ 3391 /** 3392 * Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised. 3393 * 3394 * @param { On } on - the attribute requirements of the target {@link Component}. 3395 * @returns { Promise<void> } 3396 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3397 * @throws { BusinessError } 17000002 - The async function is not called with await. 3398 * @throws { BusinessError } 17000003 - Assertion failed. 3399 * @syscap SystemCapability.Test.UiTest 3400 * @crossplatform 3401 * @atomicservice 3402 * @since 11 3403 * @test 3404 */ 3405 assertComponentExist(on: On): Promise<void>; 3406 3407 /** 3408 * Press the BACK key. 3409 * 3410 * @returns { Promise<void> } 3411 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3412 * @syscap SystemCapability.Test.UiTest 3413 * @since 9 3414 * @test 3415 */ 3416 /** 3417 * Press the BACK key. 3418 * 3419 * @returns { Promise<void> } 3420 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3421 * @syscap SystemCapability.Test.UiTest 3422 * @crossplatform 3423 * @since 10 3424 * @test 3425 */ 3426 /** 3427 * Press the BACK key. 3428 * 3429 * @returns { Promise<void> } 3430 * @throws { BusinessError } 17000002 - The async function is not called with await. 3431 * @syscap SystemCapability.Test.UiTest 3432 * @crossplatform 3433 * @atomicservice 3434 * @since 11 3435 * @test 3436 */ 3437 pressBack(): Promise<void>; 3438 3439 /** 3440 * Press the specified key. 3441 * 3442 * @param { number } keyCode the target keyCode. 3443 * @returns { Promise<void> } 3444 * @throws { BusinessError } 401 - if the input parameters are invalid. 3445 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3446 * @syscap SystemCapability.Test.UiTest 3447 * @since 9 3448 * @test 3449 */ 3450 /** 3451 * Press the specified key. 3452 * 3453 * @param { number } keyCode - the target keyCode. 3454 * @returns { Promise<void> } 3455 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3456 * @throws { BusinessError } 17000002 - The async function is not called with await. 3457 * @syscap SystemCapability.Test.UiTest 3458 * @crossplatform 3459 * @atomicservice 3460 * @since 11 3461 * @test 3462 */ 3463 triggerKey(keyCode: number): Promise<void>; 3464 3465 /** 3466 * Press two or three key combinations 3467 * 3468 * @param { number } key0 the first keyCode. 3469 * @param { number } key1 the second keyCode. 3470 * @param { number } key2 the third keyCode. 3471 * @returns { Promise<void> } 3472 * @throws { BusinessError } 401 - if the input parameters are invalid. 3473 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3474 * @syscap SystemCapability.Test.UiTest 3475 * @since 9 3476 * @test 3477 */ 3478 /** 3479 * Press two or three key combinations 3480 * 3481 * @param { number } key0 - the first keyCode. 3482 * @param { number } key1 - the second keyCode. 3483 * @param { number } [key2] - the third keyCode,set it default 0 if null or undefined. 3484 * @returns { Promise<void> } 3485 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3486 * @throws { BusinessError } 17000002 - The async function is not called with await. 3487 * @syscap SystemCapability.Test.UiTest 3488 * @crossplatform 3489 * @atomicservice 3490 * @since 11 3491 * @test 3492 */ 3493 triggerCombineKeys(key0: number, key1: number, key2?: number): Promise<void>; 3494 3495 /** 3496 * Click on the specified location on the screen. 3497 * 3498 * @param { number } x The x-coordinate. 3499 * @param { number } y The y-coordinate. 3500 * @returns { Promise<void> } 3501 * @throws { BusinessError } 401 - if the input parameters are invalid. 3502 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3503 * @syscap SystemCapability.Test.UiTest 3504 * @since 9 3505 * @test 3506 */ 3507 /** 3508 * Click on the specified location on the screen. 3509 * 3510 * @param { number } x The x-coordinate. 3511 * @param { number } y The y-coordinate. 3512 * @returns { Promise<void> } 3513 * @throws { BusinessError } 401 - if the input parameters are invalid. 3514 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3515 * @syscap SystemCapability.Test.UiTest 3516 * @crossplatform 3517 * @since 10 3518 * @test 3519 */ 3520 /** 3521 * Click on the specified location on the screen. 3522 * 3523 * @param { number } x - the x-coordinate, not less than 0. 3524 * @param { number } y - the y-coordinate, not less than 0. 3525 * @returns { Promise<void> } 3526 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3527 * @throws { BusinessError } 17000002 - The async function is not called with await. 3528 * @syscap SystemCapability.Test.UiTest 3529 * @crossplatform 3530 * @atomicservice 3531 * @since 11 3532 * @test 3533 */ 3534 click(x: number, y: number): Promise<void>; 3535 3536 /** 3537 * DoubleClick on the specified location on the screen. 3538 * 3539 * @param { number } x The x-coordinate. 3540 * @param { number } y The y-coordinate. 3541 * @returns { Promise<void> } 3542 * @throws { BusinessError } 401 - if the input parameters are invalid. 3543 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3544 * @syscap SystemCapability.Test.UiTest 3545 * @since 9 3546 * @test 3547 */ 3548 /** 3549 * DoubleClick on the specified location on the screen. 3550 * 3551 * @param { number } x The x-coordinate. 3552 * @param { number } y The y-coordinate. 3553 * @returns { Promise<void> } 3554 * @throws { BusinessError } 401 - if the input parameters are invalid. 3555 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3556 * @syscap SystemCapability.Test.UiTest 3557 * @crossplatform 3558 * @since 10 3559 * @test 3560 */ 3561 /** 3562 * DoubleClick on the specified location on the screen. 3563 * 3564 * @param { number } x - the x-coordinate, not less than 0. 3565 * @param { number } y - the y-coordinate, not less than 0. 3566 * @returns { Promise<void> } 3567 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3568 * @throws { BusinessError } 17000002 - The async function is not called with await. 3569 * @syscap SystemCapability.Test.UiTest 3570 * @crossplatform 3571 * @atomicservice 3572 * @since 11 3573 * @test 3574 */ 3575 doubleClick(x: number, y: number): Promise<void>; 3576 3577 /** 3578 * LongClick on the specified location on the screen. 3579 * 3580 * @param { number } x The x-coordinate. 3581 * @param { number } y The y-coordinate. 3582 * @returns { Promise<void> } 3583 * @throws { BusinessError } 401 - if the input parameters are invalid. 3584 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3585 * @syscap SystemCapability.Test.UiTest 3586 * @since 9 3587 * @test 3588 */ 3589 /** 3590 * LongClick on the specified location on the screen. 3591 * 3592 * @param { number } x The x-coordinate. 3593 * @param { number } y The y-coordinate. 3594 * @returns { Promise<void> } 3595 * @throws { BusinessError } 401 - if the input parameters are invalid. 3596 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3597 * @syscap SystemCapability.Test.UiTest 3598 * @crossplatform 3599 * @since 10 3600 * @test 3601 */ 3602 /** 3603 * LongClick on the specified location on the screen. 3604 * 3605 * @param { number } x - the x-coordinate, not less than 0. 3606 * @param { number } y - the y-coordinate, not less than 0. 3607 * @returns { Promise<void> } 3608 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3609 * @throws { BusinessError } 17000002 - The async function is not called with await. 3610 * @syscap SystemCapability.Test.UiTest 3611 * @crossplatform 3612 * @atomicservice 3613 * @since 11 3614 * @test 3615 */ 3616 longClick(x: number, y: number): Promise<void>; 3617 3618 /** 3619 * Swipe on the screen between the specified points. 3620 * 3621 * @param { number } startx The x-coordinate of the starting point. 3622 * @param { number } starty The y-coordinate of the starting point. 3623 * @param { number } endx The x-coordinate of the ending point. 3624 * @param { number } endy The y-coordinate of the ending point. 3625 * @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 3626 * @returns { Promise<void> } 3627 * @throws { BusinessError } 401 - if the input parameters are invalid. 3628 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3629 * @syscap SystemCapability.Test.UiTest 3630 * @since 9 3631 * @test 3632 */ 3633 /** 3634 * Swipe on the screen between the specified points. 3635 * 3636 * @param { number } startx The x-coordinate of the starting point. 3637 * @param { number } starty The y-coordinate of the starting point. 3638 * @param { number } endx The x-coordinate of the ending point. 3639 * @param { number } endy The y-coordinate of the ending point. 3640 * @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 3641 * @returns { Promise<void> } 3642 * @throws { BusinessError } 401 - if the input parameters are invalid. 3643 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3644 * @syscap SystemCapability.Test.UiTest 3645 * @crossplatform 3646 * @since 10 3647 * @test 3648 */ 3649 /** 3650 * Swipe on the screen between the specified points. 3651 * 3652 * @param { number } startx - the x-coordinate of the starting point, not less than 0. 3653 * @param { number } starty - the y-coordinate of the starting point, not less than 0. 3654 * @param { number } endx - the x-coordinate of the ending point, not less than 0. 3655 * @param { number } endy - the y-coordinate of the ending point, not less than 0. 3656 * @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. 3657 * @returns { Promise<void> } 3658 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3659 * @throws { BusinessError } 17000002 - The async function is not called with await. 3660 * @syscap SystemCapability.Test.UiTest 3661 * @crossplatform 3662 * @atomicservice 3663 * @since 11 3664 * @test 3665 */ 3666 swipe(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise<void>; 3667 3668 /** 3669 * Drag on the screen between the specified points. 3670 * 3671 * @param { number } startx The x-coordinate of the starting point. 3672 * @param { number } starty The y-coordinate of the starting point. 3673 * @param { number } endx The x-coordinate of the ending point. 3674 * @param { number } endy The y-coordinate of the ending point. 3675 * @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 3676 * @returns { Promise<void> } 3677 * @throws { BusinessError } 401 - if the input parameters are invalid. 3678 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3679 * @syscap SystemCapability.Test.UiTest 3680 * @since 9 3681 * @test 3682 */ 3683 /** 3684 * Drag on the screen between the specified points. 3685 * 3686 * @param { number } startx - the x-coordinate of the starting point, not less than 0. 3687 * @param { number } starty - the y-coordinate of the starting point, not less than 0. 3688 * @param { number } endx - the x-coordinate of the ending point, not less than 0. 3689 * @param { number } endy - the y-coordinate of the ending point, not less than 0. 3690 * @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. 3691 * @returns { Promise<void> } 3692 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3693 * @throws { BusinessError } 17000002 - The async function is not called with await. 3694 * @syscap SystemCapability.Test.UiTest 3695 * @atomicservice 3696 * @since 11 3697 * @test 3698 */ 3699 drag(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise<void>; 3700 3701 /** 3702 * Capture current screen and save as picture which PNG format. 3703 * 3704 * @param { string } savePath the path where to store the picture. 3705 * @returns { Promise<boolean> } true if screen-capturing and file-storing are completed successfully,false otherwise. 3706 * @throws { BusinessError } 401 - if the input parameters are invalid. 3707 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3708 * @syscap SystemCapability.Test.UiTest 3709 * @since 9 3710 * @test 3711 */ 3712 /** 3713 * Capture current screen and save as picture which PNG format. 3714 * 3715 * @param { string } savePath - the path where to store the picture, must be in the application sandbox directory. 3716 * @returns { Promise<boolean> } true if screen-capturing and file-storing are completed successfully,false otherwise. 3717 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3718 * @throws { BusinessError } 17000002 - The async function is not called with await. 3719 * @syscap SystemCapability.Test.UiTest 3720 * @atomicservice 3721 * @since 11 3722 * @test 3723 */ 3724 screenCap(savePath: string): Promise<boolean>; 3725 3726 /** 3727 * Set the rotation of the device display. 3728 * 3729 * @param { DisplayRotation } rotation The target rotation to set. 3730 * @returns { Promise<void> } 3731 * @throws { BusinessError } 401 - if the input parameters are invalid. 3732 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3733 * @syscap SystemCapability.Test.UiTest 3734 * @since 9 3735 * @test 3736 */ 3737 /** 3738 * Set the rotation of the device display. 3739 * 3740 * @param { DisplayRotation } rotation - the target rotation to set. 3741 * @returns { Promise<void> } 3742 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3743 * @throws { BusinessError } 17000002 - The async function is not called with await. 3744 * @syscap SystemCapability.Test.UiTest 3745 * @atomicservice 3746 * @since 11 3747 * @test 3748 */ 3749 setDisplayRotation(rotation: DisplayRotation): Promise<void>; 3750 3751 /** 3752 * Get the rotation of the device display. 3753 * 3754 * @returns { Promise<DisplayRotation> } the current display rotation. 3755 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3756 * @syscap SystemCapability.Test.UiTest 3757 * @since 9 3758 * @test 3759 */ 3760 /** 3761 * Get the rotation of the device display. 3762 * 3763 * @returns { Promise<DisplayRotation> } the current display rotation. 3764 * @throws { BusinessError } 17000002 - The async function is not called with await. 3765 * @syscap SystemCapability.Test.UiTest 3766 * @atomicservice 3767 * @since 11 3768 * @test 3769 */ 3770 getDisplayRotation(): Promise<DisplayRotation>; 3771 3772 /** 3773 * Enable/disable the rotation of device display. 3774 * 3775 * @param { boolean } enabled Enable the rotation or not. 3776 * @returns { Promise<void> } 3777 * @throws { BusinessError } 401 - if the input parameters are invalid. 3778 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3779 * @syscap SystemCapability.Test.UiTest 3780 * @since 9 3781 * @test 3782 */ 3783 /** 3784 * Enable/disable the rotation of device display. 3785 * 3786 * @param { boolean } enabled - enable the rotation or not. 3787 * @returns { Promise<void> } 3788 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3789 * @throws { BusinessError } 17000002 - The async function is not called with await. 3790 * @syscap SystemCapability.Test.UiTest 3791 * @atomicservice 3792 * @since 11 3793 * @test 3794 */ 3795 setDisplayRotationEnabled(enabled: boolean): Promise<void>; 3796 3797 /** 3798 * Get the size of the device display. 3799 * 3800 * @returns { Promise<Point> } the size of the device display. 3801 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3802 * @syscap SystemCapability.Test.UiTest 3803 * @since 9 3804 * @test 3805 */ 3806 /** 3807 * Get the size of the device display. 3808 * 3809 * @returns { Promise<Point> } the size of the device display. 3810 * @throws { BusinessError } 17000002 - The async function is not called with await. 3811 * @syscap SystemCapability.Test.UiTest 3812 * @atomicservice 3813 * @since 11 3814 * @test 3815 */ 3816 getDisplaySize(): Promise<Point>; 3817 3818 /** 3819 * Get the density of the device display. 3820 * 3821 * @returns { Promise<Point> } the density of the device display. 3822 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3823 * @syscap SystemCapability.Test.UiTest 3824 * @since 9 3825 * @test 3826 */ 3827 /** 3828 * Get the density of the device display. 3829 * 3830 * @returns { Promise<Point> } the density of the device display. 3831 * @throws { BusinessError } 17000002 - The async function is not called with await. 3832 * @syscap SystemCapability.Test.UiTest 3833 * @atomicservice 3834 * @since 11 3835 * @test 3836 */ 3837 getDisplayDensity(): Promise<Point>; 3838 3839 /** 3840 * Wake up the device display. 3841 * 3842 * @returns { Promise<void> } 3843 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3844 * @syscap SystemCapability.Test.UiTest 3845 * @since 9 3846 * @test 3847 */ 3848 /** 3849 * Wake up the device display. 3850 * 3851 * @returns { Promise<void> } 3852 * @throws { BusinessError } 17000002 - The async function is not called with await. 3853 * @syscap SystemCapability.Test.UiTest 3854 * @atomicservice 3855 * @since 11 3856 * @test 3857 */ 3858 wakeUpDisplay(): Promise<void>; 3859 3860 /** 3861 * Press the home key. 3862 * 3863 * @returns { Promise<void> } 3864 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3865 * @syscap SystemCapability.Test.UiTest 3866 * @since 9 3867 * @test 3868 */ 3869 /** 3870 * Press the home key. 3871 * 3872 * @returns { Promise<void> } 3873 * @throws { BusinessError } 17000002 - The async function is not called with await. 3874 * @syscap SystemCapability.Test.UiTest 3875 * @atomicservice 3876 * @since 11 3877 * @test 3878 */ 3879 pressHome(): Promise<void>; 3880 3881 /** 3882 * Wait for the UI become idle. 3883 * 3884 * @param { number } idleTime the threshold of UI idle time, in millisecond. 3885 * @param { number } timeout The maximum time to wait for idle, in millisecond. 3886 * @returns { Promise<boolean> } true if wait for idle succeed in the timeout, false otherwise. 3887 * @throws { BusinessError } 401 - if the input parameters are invalid. 3888 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3889 * @syscap SystemCapability.Test.UiTest 3890 * @since 9 3891 * @test 3892 */ 3893 /** 3894 * Wait for the UI become idle. 3895 * 3896 * @param { number } idleTime - the threshold of UI idle time, in millisecond, not less than 0. 3897 * @param { number } timeout - the maximum time to wait for idle, in millisecond, not less than 0. 3898 * @returns { Promise<boolean> } true if wait for idle succeed in the timeout, false otherwise. 3899 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3900 * @throws { BusinessError } 17000002 - The async function is not called with await. 3901 * @syscap SystemCapability.Test.UiTest 3902 * @atomicservice 3903 * @since 11 3904 * @test 3905 */ 3906 waitForIdle(idleTime: number, timeout: number): Promise<boolean>; 3907 3908 /** 3909 * Inject fling on the device display. 3910 * 3911 * @param { Point } from The coordinate point where the finger touches the screen. 3912 * @param { Point } to The coordinate point where the finger leaves the screen. 3913 * @param { number } stepLen the length of each step, in pixels. 3914 * @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. 3915 * @returns { Promise<void> } 3916 * @throws { BusinessError } 401 - if the input parameters are invalid. 3917 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3918 * @syscap SystemCapability.Test.UiTest 3919 * @since 9 3920 * @test 3921 */ 3922 /** 3923 * Inject fling on the device display. 3924 * 3925 * @param { Point } from The coordinate point where the finger touches the screen. 3926 * @param { Point } to The coordinate point where the finger leaves the screen. 3927 * @param { number } stepLen the length of each step, in pixels. 3928 * @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. 3929 * @returns { Promise<void> } 3930 * @throws { BusinessError } 401 - if the input parameters are invalid. 3931 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3932 * @syscap SystemCapability.Test.UiTest 3933 * @crossplatform 3934 * @since 10 3935 * @test 3936 */ 3937 /** 3938 * Inject fling on the device display. 3939 * 3940 * @param { Point } from - the coordinate point where the finger touches the screen. 3941 * @param { Point } to - the coordinate point where the finger leaves the screen. 3942 * @param { number } stepLen - the length of each step, in pixels. 3943 * @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. 3944 * @returns { Promise<void> } 3945 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3946 * @throws { BusinessError } 17000002 - The async function is not called with await. 3947 * @syscap SystemCapability.Test.UiTest 3948 * @crossplatform 3949 * @atomicservice 3950 * @since 11 3951 * @test 3952 */ 3953 fling(from: Point, to: Point, stepLen: number, speed: number): Promise<void>; 3954 3955 /** 3956 * Inject multi-pointer action on the device display. 3957 * 3958 * @param { PointerMatrix } pointers The two-dimensional array of pointers to inject. 3959 * @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 3960 * @returns { Promise<boolean> } true if the operation finished, false 3961 * @throws { BusinessError } 401 - if the input parameters are invalid. 3962 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3963 * @syscap SystemCapability.Test.UiTest 3964 * @since 9 3965 * @test 3966 */ 3967 /** 3968 * Inject multi-pointer action on the device display. 3969 * 3970 * @param { PointerMatrix } pointers - the two-dimensional array of pointers to inject. 3971 * @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. 3972 * @returns { Promise<boolean> } true if the operation finished, false 3973 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 3974 * @throws { BusinessError } 17000002 - The async function is not called with await. 3975 * @syscap SystemCapability.Test.UiTest 3976 * @crossplatform 3977 * @atomicservice 3978 * @since 11 3979 * @test 3980 */ 3981 injectMultiPointerAction(pointers: PointerMatrix, speed?: number): Promise<boolean>; 3982 3983 /** 3984 * Inject fling on the device display. 3985 * 3986 * @param { UiDirection } direction The direction of this action. 3987 * @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. 3988 * @returns { Promise<void> } 3989 * @throws { BusinessError } 401 - if the input parameters are invalid. 3990 * @throws { BusinessError } 17000002 - if the async function was not called with await. 3991 * @syscap SystemCapability.Test.UiTest 3992 * @since 10 3993 * @test 3994 */ 3995 /** 3996 * Inject fling on the device display. 3997 * 3998 * @param { UiDirection } direction - the direction of this action. 3999 * @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. 4000 * @returns { Promise<void> } 4001 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4002 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4003 * @syscap SystemCapability.Test.UiTest 4004 * @atomicservice 4005 * @since 11 4006 * @test 4007 */ 4008 /** 4009 * Inject fling on the device display. 4010 * 4011 * @param { UiDirection } direction - the direction of this action. 4012 * @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. 4013 * @returns { Promise<void> } 4014 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4015 * @throws { BusinessError } 17000002 - The async function is not called with await. 4016 * @syscap SystemCapability.Test.UiTest 4017 * @crossplatform 4018 * @atomicservice 4019 * @since 12 4020 * @test 4021 */ 4022 fling(direction: UiDirection, speed: number): Promise<void>; 4023 4024 /** 4025 * Click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. 4026 * 4027 * @param { Point } p The coordinate of the specified location. 4028 * @param { MouseButton } btnId The button of Mouse. 4029 * @param { number } key1 the first keyCode. 4030 * @param { number } key2 the second keyCode. 4031 * @returns { Promise<void> } 4032 * @throws { BusinessError } 401 - if the input parameters are invalid. 4033 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4034 * @syscap SystemCapability.Test.UiTest 4035 * @since 10 4036 * @test 4037 */ 4038 /** 4039 * Click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. 4040 * 4041 * @param { Point } p - the coordinate of the specified location. 4042 * @param { MouseButton } btnId - the button of Mouse. 4043 * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. 4044 * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. 4045 * @returns { Promise<void> } 4046 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4047 * @throws { BusinessError } 17000002 - The async function is not called with await. 4048 * @syscap SystemCapability.Test.UiTest 4049 * @atomicservice 4050 * @since 11 4051 * @test 4052 */ 4053 mouseClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise<void>; 4054 4055 /** 4056 * Move the mouse cursor to the specified location. 4057 * 4058 * @param { Point } p The coordinate of the specified location. 4059 * @returns { Promise<void> } 4060 * @throws { BusinessError } 401 - if the input parameters are invalid. 4061 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4062 * @syscap SystemCapability.Test.UiTest 4063 * @since 10 4064 * @test 4065 */ 4066 /** 4067 * Move the mouse cursor to the specified location. 4068 * 4069 * @param { Point } p - the coordinate of the specified location. 4070 * @returns { Promise<void> } 4071 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4072 * @throws { BusinessError } 17000002 - The async function is not called with await. 4073 * @syscap SystemCapability.Test.UiTest 4074 * @atomicservice 4075 * @since 11 4076 * @test 4077 */ 4078 mouseMoveTo(p: Point): Promise<void>; 4079 4080 /** 4081 * The mouse wheel scrolls the specified cell at the specified position, and press the specified key simultaneously if necessary. 4082 * 4083 * @param { Point } p The coordinate of the specified location. 4084 * @param { boolean } down Whether the mouse wheel rolls down. 4085 * @param { number } d The number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels. 4086 * @param { number } key1 the first keyCode. 4087 * @param { number } key2 the second keyCode. 4088 * @returns { Promise<void> } 4089 * @throws { BusinessError } 401 - if the input parameters are invalid. 4090 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4091 * @syscap SystemCapability.Test.UiTest 4092 * @since 10 4093 * @test 4094 */ 4095 /** 4096 * The mouse wheel scrolls the specified cell at the specified position, and press the specified key simultaneously if necessary. 4097 * 4098 * @param { Point } p - the coordinate of the specified location. 4099 * @param { boolean } down - whether the mouse wheel rolls down. 4100 * @param { number } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels. 4101 * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. 4102 * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. 4103 * @returns { Promise<void> } 4104 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4105 * @throws { BusinessError } 17000002 - The async function is not called with await. 4106 * @syscap SystemCapability.Test.UiTest 4107 * @atomicservice 4108 * @since 11 4109 * @test 4110 */ 4111 mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number): Promise<void>; 4112 /** 4113 * The mouse wheel scrolls the specified cell at the specified position, and press the specified key simultaneously if necessary. 4114 * 4115 * @param { Point } p - the coordinate of the specified location. 4116 * @param { boolean } down - whether the mouse wheel rolls down. 4117 * @param { number } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels. 4118 * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. 4119 * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. 4120 * @param { number } [speed] - The Speed of mouse wheel rolls(cells per second),ranges from 1 to 500.Set it default 20 if out of range or null or undefined. 4121 * @returns { Promise<void> } 4122 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4123 * @throws { BusinessError } 17000002 - The async function is not called with await. 4124 * @syscap SystemCapability.Test.UiTest 4125 * @atomicservice 4126 * @since 11 4127 * @test 4128 */ 4129 mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number, speed?: number): Promise<void>; 4130 4131 /** 4132 * Capture the specified area of current screen and save as picture which PNG format. 4133 * 4134 * @param { string } savePath the path where to store the picture. 4135 * @param { Rect } rect The specified area of current screen, default to full screen. 4136 * @returns { Promise<boolean> } true if screen-capturing and file-storing are completed successfully,false otherwise. 4137 * @throws { BusinessError } 401 - if the input parameters are invalid. 4138 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4139 * @syscap SystemCapability.Test.UiTest 4140 * @since 10 4141 * @test 4142 */ 4143 /** 4144 * Capture the specified area of current screen and save as picture which PNG format. 4145 * 4146 * @param { string } savePath - the path where to store the picture, must be in the application sandbox directory. 4147 * @param { Rect } [rect] - the specified area of current screen, default to full screen.Set it default if null or undefined. 4148 * @returns { Promise<boolean> } true if screen-capturing and file-storing are completed successfully,false otherwise. 4149 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4150 * @throws { BusinessError } 17000002 - The async function is not called with await. 4151 * @syscap SystemCapability.Test.UiTest 4152 * @atomicservice 4153 * @since 11 4154 * @test 4155 */ 4156 screenCapture(savePath: string, rect?: Rect): Promise<boolean>; 4157 4158 /** 4159 * Create an {@link UIEventObserver} object. 4160 * 4161 * @returns { UIEventObserver } the {@link UIEventObserver} object. 4162 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4163 * @syscap SystemCapability.Test.UiTest 4164 * @since 10 4165 * @test 4166 */ 4167 /** 4168 * Create an {@link UIEventObserver} object. 4169 * 4170 * @returns { UIEventObserver } the {@link UIEventObserver} object. 4171 * @throws { BusinessError } 17000002 - The async function is not called with await. 4172 * @syscap SystemCapability.Test.UiTest 4173 * @atomicservice 4174 * @since 11 4175 * @test 4176 */ 4177 createUIEventObserver(): UIEventObserver; 4178 4179 /** 4180 * Double click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. 4181 * 4182 * @param { Point } p - the coordinate of the specified location. 4183 * @param { MouseButton } btnId - the button of Mouse. 4184 * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. 4185 * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. 4186 * @returns { Promise<void> } 4187 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4188 * @throws { BusinessError } 17000002 - The async function is not called with await. 4189 * @syscap SystemCapability.Test.UiTest 4190 * @atomicservice 4191 * @since 11 4192 * @test 4193 */ 4194 mouseDoubleClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise<void>; 4195 4196 /** 4197 * Long click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. 4198 * 4199 * @param { Point } p - the coordinate of the specified location. 4200 * @param { MouseButton } btnId - the button of Mouse. 4201 * @param { number } [key1] - the first keyCode,set it default 0 if null or undefined. 4202 * @param { number } [key2] - the second keyCode,set it default 0 if null or undefined. 4203 * @returns { Promise<void> } 4204 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4205 * @throws { BusinessError } 17000002 - The async function is not called with await. 4206 * @syscap SystemCapability.Test.UiTest 4207 * @atomicservice 4208 * @since 11 4209 * @test 4210 */ 4211 mouseLongClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise<void>; 4212 4213 /** 4214 * Swipe on the screen between the specified points with mouse. 4215 * 4216 * @param { Point } from - the starting point. 4217 * @param { Point } to - the ending point. 4218 * @param { number } [speed] - speed of swipe (pixels per second),the value ranges from 200 to 40000.Set it default 600 if out of range or null or undefined. 4219 * @returns { Promise<void> } 4220 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4221 * @throws { BusinessError } 17000002 - The async function is not called with await. 4222 * @syscap SystemCapability.Test.UiTest 4223 * @atomicservice 4224 * @since 11 4225 * @test 4226 */ 4227 mouseMoveWithTrack(from: Point, to: Point, speed?: number): Promise<void>; 4228 4229 /** 4230 * Hold down the left mouse button and drag on the screen between the specified points. 4231 * 4232 * @param { Point } from - the starting point. 4233 * @param { Point } to - the ending point. 4234 * @param { number } [speed] - speed of drag (pixels per second),the value ranges from 200 to 40000,Set it default 600 if out of range or null or undefined. 4235 * @returns { Promise<void> } 4236 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4237 * @throws { BusinessError } 17000002 - The async function is not called with await. 4238 * @syscap SystemCapability.Test.UiTest 4239 * @atomicservice 4240 * @since 11 4241 * @test 4242 */ 4243 mouseDrag(from: Point, to: Point, speed?: number): Promise<void>; 4244 4245 /** 4246 * Inject text on the specified location. 4247 * 4248 * @param { Point } p - the coordinate of the specified location. 4249 * @param { string } text - the text to inject. 4250 * @returns { Promise<void> } 4251 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4252 * @throws { BusinessError } 17000002 - The async function is not called with await. 4253 * @syscap SystemCapability.Test.UiTest 4254 * @atomicservice 4255 * @since 11 4256 * @test 4257 */ 4258 inputText(p: Point, text: string): Promise<void>; 4259 4260 /** 4261 * Simulate touchpad multi-finger swipe gestures. 4262 * @param { number } fingers Finger count of touchpad multi-finger swipe, ranges from 3 to 4. 4263 * @param { UiDirection } direction Direction of touchpad multi-finger swipe. 4264 * @param { TouchPadSwipeOptions } [options] Additional options touchpad multi-finger swipe gestures, set its parameters to default values if null or undefined. 4265 * @returns { Promise<void> } 4266 * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4267 * @throws { BusinessError } 17000002 The async function is not called with await. 4268 * @throws { BusinessError } 17000005 This operation is not supported. 4269 * @syscap SystemCapability.Test.UiTest 4270 * @atomicservice 4271 * @since 18 4272 * @test 4273 */ 4274 touchPadMultiFingerSwipe(fingers: number, direction: UiDirection, options?: TouchPadSwipeOptions): Promise<void>; 4275 4276 /** 4277 * Simulate pen click operation. 4278 * @param { Point } point Coordinate of the specified location. 4279 * @returns { Promise<void> } 4280 * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4281 * @throws { BusinessError } 17000002 The async function is not called with await. 4282 * @syscap SystemCapability.Test.UiTest 4283 * @atomicservice 4284 * @since 18 4285 * @test 4286 */ 4287 penClick(point: Point): Promise<void>; 4288 4289 /** 4290 * Simulate pen long click operation. 4291 * @param { Point } point Coordinate of the specified location. 4292 * @param { number } [pressure] Pressure of pen long click operation, default is 1.0, the value ranges from 0.0 to 1.0. 4293 * @returns { Promise<void> } 4294 * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4295 * @throws { BusinessError } 17000002 The async function is not called with await. 4296 * @syscap SystemCapability.Test.UiTest 4297 * @atomicservice 4298 * @since 18 4299 * @test 4300 */ 4301 penLongClick(point: Point, pressure?: number): Promise<void>; 4302 4303 /** 4304 * Simulate pen double click operation. 4305 * @param { Point } point Coordinate of the specified location. 4306 * @returns { Promise<void> } 4307 * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4308 * @throws { BusinessError } 17000002 The async function is not called with await. 4309 * @syscap SystemCapability.Test.UiTest 4310 * @atomicservice 4311 * @since 18 4312 * @test 4313 */ 4314 penDoubleClick(point: Point): Promise<void>; 4315 4316 /** 4317 * Simulate pen swipe operation. 4318 * @param { Point } startPoint Coordinate of the specified location. 4319 * @param { Point } endPoint Coordinate of the specified location. 4320 * @param { number } [speed] Speed(pixels per second) of pen swipe, default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 4321 * @param { number } [pressure] Pressure of pen swipe operation, default is 1.0, the value ranges from 0.0 to 1.0. 4322 * @returns { Promise<void> } 4323 * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4324 * @throws { BusinessError } 17000002 The async function is not called with await. 4325 * @syscap SystemCapability.Test.UiTest 4326 * @atomicservice 4327 * @since 18 4328 * @test 4329 */ 4330 penSwipe(startPoint: Point, endPoint: Point, speed?: number, pressure?: number): Promise<void>; 4331 4332 /** 4333 * Inject pen multi-pointer action on the device display. 4334 * @param { PointerMatrix } pointers The two-dimensional array of pointers to inject. 4335 * @param { number } [speed] Speed(pixels per second) of inject pen pointer action, default is 600,the value ranges from 200 to 40000,set it 600 if out of range. 4336 * @param { number } [pressure] Pressure of inject pen pointer action operation, default is 1.0, the value ranges from 0.0 to 1.0. 4337 * @returns { Promise<void> } 4338 * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4339 * @throws { BusinessError } 17000002 The async function is not called with await. 4340 * @syscap SystemCapability.Test.UiTest 4341 * @atomicservice 4342 * @since 18 4343 * @test 4344 */ 4345 injectPenPointerAction(pointers: PointerMatrix, speed?: number, pressure?: number): Promise<void>; 4346} 4347 4348/** 4349 * @syscap SystemCapability.Test.UiTest 4350 * @since 9 4351 * @test 4352 */ 4353/** 4354 * Represents a window of the ohos application,user can perform operations or query attributes on it. 4355 * 4356 * @syscap SystemCapability.Test.UiTest 4357 * @atomicservice 4358 * @since 11 4359 * @test 4360 */ 4361declare class UiWindow { 4362 /** 4363 * Get the bundle name of this {@link UiWindow}. 4364 * 4365 * @returns { Promise<string> } the bundle name. 4366 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4367 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4368 * @syscap SystemCapability.Test.UiTest 4369 * @since 9 4370 * @test 4371 */ 4372 /** 4373 * Get the bundle name of this {@link UiWindow}. 4374 * 4375 * @returns { Promise<string> } the bundle name. 4376 * @throws { BusinessError } 17000002 - The async function is not called with await. 4377 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4378 * @syscap SystemCapability.Test.UiTest 4379 * @atomicservice 4380 * @since 11 4381 * @test 4382 */ 4383 getBundleName(): Promise<string>; 4384 4385 /** 4386 * Get the bounds rect of this {@link UiWindow}. 4387 * 4388 * @returns { Promise<Rect> } the bounds rect object. 4389 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4390 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4391 * @syscap SystemCapability.Test.UiTest 4392 * @since 9 4393 * @test 4394 */ 4395 /** 4396 * Get the bounds rect of this {@link UiWindow}. 4397 * 4398 * @returns { Promise<Rect> } the bounds rect object. 4399 * @throws { BusinessError } 17000002 - The async function is not called with await. 4400 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4401 * @syscap SystemCapability.Test.UiTest 4402 * @crossplatform 4403 * @atomicservice 4404 * @since 11 4405 * @test 4406 */ 4407 getBounds(): Promise<Rect>; 4408 4409 /** 4410 * Get the title of this {@link UiWindow}. 4411 * 4412 * @returns { Promise<string> } the title value. 4413 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4414 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4415 * @syscap SystemCapability.Test.UiTest 4416 * @since 9 4417 * @test 4418 */ 4419 /** 4420 * Get the title of this {@link UiWindow}. 4421 * 4422 * @returns { Promise<string> } the title value. 4423 * @throws { BusinessError } 17000002 - The async function is not called with await. 4424 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4425 * @syscap SystemCapability.Test.UiTest 4426 * @atomicservice 4427 * @since 11 4428 * @test 4429 */ 4430 getTitle(): Promise<string>; 4431 4432 /** 4433 * Get the window mode of this {@link UiWindow}. 4434 * 4435 * @returns { Promise<WindowMode> } the {@link WindowMode} object 4436 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4437 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4438 * @syscap SystemCapability.Test.UiTest 4439 * @since 9 4440 * @test 4441 */ 4442 /** 4443 * Get the window mode of this {@link UiWindow}. 4444 * 4445 * @returns { Promise<WindowMode> } the {@link WindowMode} object 4446 * @throws { BusinessError } 17000002 - The async function is not called with await. 4447 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4448 * @syscap SystemCapability.Test.UiTest 4449 * @atomicservice 4450 * @since 11 4451 * @test 4452 */ 4453 getWindowMode(): Promise<WindowMode>; 4454 4455 /** 4456 * Get the focused status of this {@link UiWindow}. 4457 * 4458 * @returns { Promise<boolean> } the focused status 4459 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4460 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4461 * @syscap SystemCapability.Test.UiTest 4462 * @since 9 4463 * @test 4464 */ 4465 /** 4466 * Get the focused status of this {@link UiWindow}. 4467 * 4468 * @returns { Promise<boolean> } the focused status 4469 * @throws { BusinessError } 17000002 - The async function is not called with await. 4470 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4471 * @syscap SystemCapability.Test.UiTest 4472 * @atomicservice 4473 * @since 11 4474 * @test 4475 */ 4476 isFocused(): Promise<boolean>; 4477 4478 /** 4479 * Get the active status of this {@link UiWindow}. 4480 * 4481 * @returns { Promise<boolean> } the actived status 4482 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4483 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4484 * @syscap SystemCapability.Test.UiTest 4485 * @since 9 4486 * @test 4487 */ 4488 /** 4489 * Get the active status of this {@link UiWindow}. 4490 * 4491 * @returns { Promise<boolean> } the actived status 4492 * @throws { BusinessError } 17000002 - The async function is not called with await. 4493 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4494 * @syscap SystemCapability.Test.UiTest 4495 * @since 11 4496 * @deprecated since 11 4497 * @useinstead ohos.UiTest.UiWindow#isActive 4498 * @test 4499 */ 4500 isActived(): Promise<boolean>; 4501 4502 /** 4503 * Set the focused status of this {@link UiWindow}. 4504 * 4505 * @returns { Promise<void> } 4506 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4507 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4508 * @syscap SystemCapability.Test.UiTest 4509 * @since 9 4510 * @test 4511 */ 4512 /** 4513 * Set the focused status of this {@link UiWindow}. 4514 * 4515 * @returns { Promise<void> } 4516 * @throws { BusinessError } 17000002 - The async function is not called with await. 4517 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4518 * @syscap SystemCapability.Test.UiTest 4519 * @atomicservice 4520 * @since 11 4521 * @test 4522 */ 4523 focus(): Promise<void>; 4524 4525 /** 4526 * Move this {@link UiWindow} to the specified points. 4527 * 4528 * @param { number } x The x coordinate of destination. 4529 * @param { number } y The y coordinate of destination. 4530 * @returns { Promise<void> } 4531 * @throws { BusinessError } 401 - if the input parameters are invalid. 4532 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4533 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4534 * @throws { BusinessError } 17000005 - if the action is not supported on this window. 4535 * @syscap SystemCapability.Test.UiTest 4536 * @since 9 4537 * @test 4538 */ 4539 /** 4540 * Move this {@link UiWindow} to the specified points. 4541 * 4542 * @param { number } x - the x coordinate of destination, not less than 0. 4543 * @param { number } y - the y coordinate of destination, not less than 0. 4544 * @returns { Promise<void> } 4545 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4546 * @throws { BusinessError } 17000002 - The async function is not called with await. 4547 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4548 * @throws { BusinessError } 17000005 - This operation is not supported. 4549 * @syscap SystemCapability.Test.UiTest 4550 * @atomicservice 4551 * @since 11 4552 * @test 4553 */ 4554 moveTo(x: number, y: number): Promise<void>; 4555 4556 /** 4557 * Resize this {@link UiWindow} to the specified size for the specified direction. 4558 * 4559 * @param { number } wide The expected wide of the window after resizing. 4560 * @param { number } height The expected height of the window after resizing. 4561 * @param { ResizeDirection } direction The expected direction of the window after resizing. 4562 * @returns { Promise<void> } 4563 * @throws { BusinessError } 401 - if the input parameters are invalid. 4564 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4565 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4566 * @throws { BusinessError } 17000005 - if the action is not supported on this window. 4567 * @syscap SystemCapability.Test.UiTest 4568 * @since 9 4569 * @test 4570 */ 4571 /** 4572 * Resize this {@link UiWindow} to the specified size for the specified direction. 4573 * 4574 * @param { number } wide - the expected wide of the window after resizing. 4575 * @param { number } height - the expected height of the window after resizing. 4576 * @param { ResizeDirection } direction - the expected direction of the window after resizing. 4577 * @returns { Promise<void> } 4578 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4579 * @throws { BusinessError } 17000002 - The async function is not called with await. 4580 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4581 * @throws { BusinessError } 17000005 - This operation is not supported. 4582 * @syscap SystemCapability.Test.UiTest 4583 * @atomicservice 4584 * @since 11 4585 * @test 4586 */ 4587 resize(wide: number, height: number, direction: ResizeDirection): Promise<void>; 4588 4589 /** 4590 * Change this {@link UiWindow} into split screen mode. 4591 * 4592 * @returns { Promise<void> } 4593 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4594 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4595 * @throws { BusinessError } 17000005 - if the action is not supported on this window. 4596 * @syscap SystemCapability.Test.UiTest 4597 * @since 9 4598 * @test 4599 */ 4600 /** 4601 * Change this {@link UiWindow} into split screen mode. 4602 * 4603 * @returns { Promise<void> } 4604 * @throws { BusinessError } 17000002 - The async function is not called with await. 4605 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4606 * @throws { BusinessError } 17000005 - This operation is not supported. 4607 * @syscap SystemCapability.Test.UiTest 4608 * @atomicservice 4609 * @since 11 4610 * @test 4611 */ 4612 split(): Promise<void>; 4613 4614 /** 4615 * Maximize this {@link UiWindow}. 4616 * 4617 * @returns { Promise<void> } 4618 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4619 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4620 * @throws { BusinessError } 17000005 - if the action is not supported on this window. 4621 * @syscap SystemCapability.Test.UiTest 4622 * @since 9 4623 * @test 4624 */ 4625 /** 4626 * Maximize this {@link UiWindow}. 4627 * 4628 * @returns { Promise<void> } 4629 * @throws { BusinessError } 17000002 - The async function is not called with await. 4630 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4631 * @throws { BusinessError } 17000005 - This operation is not supported. 4632 * @syscap SystemCapability.Test.UiTest 4633 * @atomicservice 4634 * @since 11 4635 * @test 4636 */ 4637 maximize(): Promise<void>; 4638 4639 /** 4640 * Minimize this {@link UiWindow}. 4641 * 4642 * @returns { Promise<void> } 4643 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4644 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4645 * @throws { BusinessError } 17000005 - if the action is not supported on this window. 4646 * @syscap SystemCapability.Test.UiTest 4647 * @since 9 4648 * @test 4649 */ 4650 /** 4651 * Minimize this {@link UiWindow}. 4652 * 4653 * @returns { Promise<void> } 4654 * @throws { BusinessError } 17000002 - The async function is not called with await. 4655 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4656 * @throws { BusinessError } 17000005 - This operation is not supported. 4657 * @syscap SystemCapability.Test.UiTest 4658 * @atomicservice 4659 * @since 11 4660 * @test 4661 */ 4662 minimize(): Promise<void>; 4663 4664 /** 4665 * Resume this {@link UiWindow}. 4666 * 4667 * @returns { Promise<void> } 4668 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4669 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4670 * @throws { BusinessError } 17000005 - if the action is not supported on this window. 4671 * @syscap SystemCapability.Test.UiTest 4672 * @since 9 4673 * @test 4674 */ 4675 /** 4676 * Resume this {@link UiWindow}. 4677 * 4678 * @returns { Promise<void> } 4679 * @throws { BusinessError } 17000002 - The async function is not called with await. 4680 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4681 * @throws { BusinessError } 17000005 - This operation is not supported. 4682 * @syscap SystemCapability.Test.UiTest 4683 * @atomicservice 4684 * @since 11 4685 * @test 4686 */ 4687 resume(): Promise<void>; 4688 4689 /** 4690 * Close this {@link UiWindow}. 4691 * 4692 * @returns { Promise<void> } 4693 * @throws { BusinessError } 17000002 - if the async function was not called with await. 4694 * @throws { BusinessError } 17000004 - if the window is invisible or destroyed. 4695 * @throws { BusinessError } 17000005 - if the action is not supported on this window. 4696 * @syscap SystemCapability.Test.UiTest 4697 * @since 9 4698 * @test 4699 */ 4700 /** 4701 * Close this {@link UiWindow}. 4702 * 4703 * @returns { Promise<void> } 4704 * @throws { BusinessError } 17000002 - The async function is not called with await. 4705 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4706 * @throws { BusinessError } 17000005 - This operation is not supported. 4707 * @syscap SystemCapability.Test.UiTest 4708 * @atomicservice 4709 * @since 11 4710 * @test 4711 */ 4712 close(): Promise<void>; 4713 4714 /** 4715 * Get the active status of this {@link UiWindow}. 4716 * 4717 * @returns { Promise<boolean> } the active status. 4718 * @throws { BusinessError } 17000002 - The async function is not called with await. 4719 * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. 4720 * @syscap SystemCapability.Test.UiTest 4721 * @atomicservice 4722 * @since 11 4723 * @test 4724 */ 4725 isActive(): Promise<boolean>; 4726} 4727 4728/** 4729 * Represents a two-dimensional array of pointers on the device display, it's used to build a 4730 * multi-finger trace which can be injected with UiDriver. 4731 * 4732 * @syscap SystemCapability.Test.UiTest 4733 * @since 9 4734 * @test 4735 */ 4736/** 4737 * Represents a two-dimensional array of pointers on the device display, it's used to build a 4738 * multi-finger trace which can be injected with UiDriver. 4739 * 4740 * @syscap SystemCapability.Test.UiTest 4741 * @crossplatform 4742 * @atomicservice 4743 * @since 11 4744 * @test 4745 */ 4746declare class PointerMatrix { 4747 /** 4748 * Create an {@link PointerMatrix} object. 4749 * 4750 * @param { number } fingers The number of fingers. 4751 * @param { number } steps The number of steps of each finger trace. 4752 * @returns { PointerMatrix } the {@link PointerMatrix} object. 4753 * @throws { BusinessError } 401 - if the input parameters are invalid. 4754 * @syscap SystemCapability.Test.UiTest 4755 * @since 9 4756 * @test 4757 */ 4758 /** 4759 * Create an {@link PointerMatrix} object. 4760 * 4761 * @param { number } fingers - The number of fingers, ranges from 1 to 10. 4762 * @param { number } steps - The number of steps of each finger trace, ranges from 1 to 1000. 4763 * @returns { PointerMatrix } the {@link PointerMatrix} object. 4764 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4765 * @syscap SystemCapability.Test.UiTest 4766 * @crossplatform 4767 * @atomicservice 4768 * @since 11 4769 * @test 4770 */ 4771 static create(fingers: number, steps: number): PointerMatrix; 4772 4773 /** 4774 * Set the point value of an element in the PointerMatrix. 4775 * 4776 * @param { number } finger The index of target finger to set. 4777 * @param { number } step The index of target step to set. 4778 * @param { Point } point The coordinate of target step to set. 4779 * @throws { BusinessError } 401 - if the input parameters are invalid. 4780 * @syscap SystemCapability.Test.UiTest 4781 * @since 9 4782 * @test 4783 */ 4784 /** 4785 * Set the point value of an element in the PointerMatrix. 4786 * 4787 * @param { number } finger - the index of target finger to set. 4788 * @param { number } step - the index of target step to set. 4789 * @param { Point } point - the coordinate of target step to set. 4790 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. 4791 * @syscap SystemCapability.Test.UiTest 4792 * @crossplatform 4793 * @atomicservice 4794 * @since 11 4795 * @test 4796 */ 4797 setPoint(finger: number, step: number, point: Point): void; 4798} 4799 4800/** 4801 * The static builder for building {@link By}object conveniently,usage example:BY.text('txt').enabled(true). 4802 * 4803 * @syscap SystemCapability.Test.UiTest 4804 * @since 8 4805 * @deprecated since 9 4806 * @useinstead ohos.uitest.ON 4807 * @test 4808 */ 4809declare const BY: By; 4810 4811/** 4812 * The static builder for building {@link On}object conveniently,usage example:ON.text('txt').enabled(true). 4813 * 4814 * @syscap SystemCapability.Test.UiTest 4815 * @since 9 4816 * @test 4817 */ 4818/** 4819 * The static builder for building {@link On}object conveniently,usage example:ON.text('txt').enabled(true). 4820 * 4821 * @syscap SystemCapability.Test.UiTest 4822 * @crossplatform 4823 * @atomicservice 4824 * @since 11 4825 * @test 4826 */ 4827declare const ON: On; 4828 4829export { 4830 UiComponent, 4831 UiDriver, 4832 Component, 4833 Driver, 4834 UiWindow, 4835 ON, 4836 On, 4837 BY, 4838 By, 4839 MatchPattern, 4840 DisplayRotation, 4841 ResizeDirection, 4842 WindowMode, 4843 Point, 4844 WindowFilter, 4845 Rect, 4846 PointerMatrix, 4847 UiDirection, 4848 MouseButton, 4849 UIElementInfo, 4850 UIEventObserver, 4851 TouchPadSwipeOptions 4852}; 4853