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