1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119<!DOCTYPE html> 120<html devsite> 121<head> 122 123 124 <meta name="top_category" value="develop" /> 125 126 <meta name="subcategory" value="reference" /> 127 128 129 <meta name="book_path" value="/reference/android/support/test/_book.yaml" /> 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145<title>AtomAction</title> 146 147 148</head> 149 150<body class="gc-documentation develop reference api apilevel-"> 151<div id="doc-api-level" class="" style="display:none"></div> 152 153 154 155 156<div id="naMessage"></div> 157 158<div id="api-info-block"> 159<div class="api-level"> 160 161 162 163 164</div> 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183<div class="sum-details-links"> 184 185Summary: 186 187 188 189 190 191 192 193 194 195 <a href="#pubctors">Ctors</a> 196 197 198 199 200 | <a href="#pubmethods">Methods</a> 201 202 203 204 205 | <a href="#inhmethods">Inherited Methods</a> 206 207| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> 208 209</div><!-- end sum-details-links --> 210</div><!-- end api-info-block --> 211 212<div class="api apilevel-" id="jd-content"> 213 214<!-- ======== START OF CLASS DATA ======== --> 215 216<h1 class="api-title">AtomAction</h1> 217<p> 218<code class="api-signature"> 219 public 220 221 final 222 223 class 224 AtomAction 225</code> 226<br> 227 228 229<code class="api-signature"> 230 231 extends Object 232 233 234 235</code> 236 237<code class="api-signature"> 238 239 240 implements 241 242 <a href="/reference/android/support/test/espresso/ViewAction.html">ViewAction</a> 243 244 245 246</code> 247 248</p><table class="jd-inheritance-table"> 249 250 251 <tr> 252 253 <td colspan="2" class="jd-inheritance-class-cell">java.lang.Object 254 </td> 255 </tr> 256 257 258 <tr> 259 260 <td class="jd-inheritance-space"> ↳</td> 261 262 <td colspan="1" class="jd-inheritance-class-cell">android.support.test.espresso.web.action.AtomAction<E> 263 </td> 264 </tr> 265 266 267</table> 268 269 270 271 272<br><hr> 273 274 275 <p>A ViewAction which causes the provided Atom to be evaluated within a webview. 276 277 <p>It is not recommended to use AtomAction directly. 278 <p>Instead for 279 examples of how to interact with a WebView's content through Atoms. 280 <p>If you must use AtomAction directly, take care to remember that they are Stateful 281 (unlike most ViewActions) and the caller must call {@ #get()} to ensure that the action 282 has completed.</p> 283 284 285 286 <div> 287 <p><b>See also:</b></p> 288 <ul class="nolist"><li><code><a href="/reference/android/support/test/espresso/web/sugar/Web.html">Web</a></code></li> 289 </ul> 290 </div> 291 292 293 294 295<h2 class="api-section">Summary</h2> 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319<!-- ======== CONSTRUCTOR SUMMARY ======== --> 320<table id="pubctors" class="responsive constructors"> 321<tr><th colspan="2"><h3>Public constructors</h3></th></tr> 322 323 324 325 326 <tr class="api apilevel-" > 327 328 329 <td width="100%"> 330 <code> 331 <a href="/reference/android/support/test/espresso/web/action/AtomAction.html#AtomAction(android.support.test.espresso.web.model.Atom<E>, android.support.test.espresso.web.model.WindowReference, android.support.test.espresso.web.model.ElementReference)">AtomAction</a>(<a href="/reference/android/support/test/espresso/web/model/Atom.html">Atom</a><E> atom, <a href="/reference/android/support/test/espresso/web/model/WindowReference.html">WindowReference</a> window, <a href="/reference/android/support/test/espresso/web/model/ElementReference.html">ElementReference</a> element) 332 </code> 333 334 <p>Creates an AtomAction. 335 336 337</p> 338 339 </td> 340 </tr> 341 342 343 344</table> 345 346 347 348 349 350 351<!-- ========== METHOD SUMMARY =========== --> 352<table id="pubmethods" class="responsive methods"> 353<tr><th colspan="2"><h3>Public methods</h3></th></tr> 354 355 356 357 358 <tr class="api apilevel-" > 359 360 361 <td><code> 362 363 364 365 366 367 E</code> 368 </td> 369 370 <td width="100%"> 371 <code> 372 <a href="/reference/android/support/test/espresso/web/action/AtomAction.html#get(long, java.util.concurrent.TimeUnit)">get</a>(long val, TimeUnit unit) 373 </code> 374 375 <p>Blocks until the atom has completed execution with a configurable timeout. 376 377 378</p> 379 380 </td> 381 </tr> 382 383 384 385 <tr class="api apilevel-" > 386 387 388 <td><code> 389 390 391 392 393 394 E</code> 395 </td> 396 397 <td width="100%"> 398 <code> 399 <a href="/reference/android/support/test/espresso/web/action/AtomAction.html#get()">get</a>() 400 </code> 401 402 <p>Blocks until the atom has completed execution. 403 404 405</p> 406 407 </td> 408 </tr> 409 410 411 412 <tr class="api apilevel-" > 413 414 415 <td><code> 416 417 418 419 420 421 Matcher<View></code> 422 </td> 423 424 <td width="100%"> 425 <code> 426 <a href="/reference/android/support/test/espresso/web/action/AtomAction.html#getConstraints()">getConstraints</a>() 427 </code> 428 429 <p>A mechanism for ViewActions to specify what type of views they can operate on. 430 431 432</p> 433 434 </td> 435 </tr> 436 437 438 439 <tr class="api apilevel-" > 440 441 442 <td><code> 443 444 445 446 447 448 String</code> 449 </td> 450 451 <td width="100%"> 452 <code> 453 <a href="/reference/android/support/test/espresso/web/action/AtomAction.html#getDescription()">getDescription</a>() 454 </code> 455 456 <p>Returns a description of the view action. 457 458 459</p> 460 461 </td> 462 </tr> 463 464 465 466 <tr class="api apilevel-" > 467 468 469 <td><code> 470 471 472 473 474 475 Future<E></code> 476 </td> 477 478 <td width="100%"> 479 <code> 480 <a href="/reference/android/support/test/espresso/web/action/AtomAction.html#getFuture()">getFuture</a>() 481 </code> 482 483 <p>Return a Future, which will be set and transformed from futureEval. 484 485 486</p> 487 488 </td> 489 </tr> 490 491 492 493 <tr class="api apilevel-" > 494 495 496 <td><code> 497 498 499 500 501 502 void</code> 503 </td> 504 505 <td width="100%"> 506 <code> 507 <a href="/reference/android/support/test/espresso/web/action/AtomAction.html#perform(android.support.test.espresso.UiController, android.view.View)">perform</a>(<a href="/reference/android/support/test/espresso/UiController.html">UiController</a> controller, View view) 508 </code> 509 510 <p>Performs this action on the given view. 511 512 513</p> 514 515 </td> 516 </tr> 517 518 519 520</table> 521 522 523 524 525 526 527 528<!-- ========== METHOD SUMMARY =========== --> 529<table id="inhmethods" class="methods inhtable"> 530<tr><th><h3>Inherited methods</h3></th></tr> 531 532 533<tr class="api apilevel-" > 534<td colspan="2"> 535 536 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" 537 ><img height="34" id="inherited-methods-java.lang.Object-trigger" 538 src="/assets/images/styles/disclosure_down.png" 539 class="jd-expando-trigger-img" /></a>From 540class 541<code> 542 543 java.lang.Object 544 545</code> 546<div id="inherited-methods-java.lang.Object"> 547 <div id="inherited-methods-java.lang.Object-list" 548 class="jd-inheritedlinks"> 549 </div> 550 <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> 551 <table class="jd-sumtable-expando responsive"> 552 553 554 555 556 <tr class="api apilevel-" > 557 558 559 <td><code> 560 561 562 563 564 565 Object</code> 566 </td> 567 568 <td width="100%"> 569 <code> 570 clone() 571 </code> 572 573 </td> 574 </tr> 575 576 577 578 <tr class="api apilevel-" > 579 580 581 <td><code> 582 583 584 585 586 587 boolean</code> 588 </td> 589 590 <td width="100%"> 591 <code> 592 equals(Object arg0) 593 </code> 594 595 </td> 596 </tr> 597 598 599 600 <tr class="api apilevel-" > 601 602 603 <td><code> 604 605 606 607 608 609 void</code> 610 </td> 611 612 <td width="100%"> 613 <code> 614 finalize() 615 </code> 616 617 </td> 618 </tr> 619 620 621 622 <tr class="api apilevel-" > 623 624 625 <td><code> 626 627 628 629 final 630 631 Class<?></code> 632 </td> 633 634 <td width="100%"> 635 <code> 636 getClass() 637 </code> 638 639 </td> 640 </tr> 641 642 643 644 <tr class="api apilevel-" > 645 646 647 <td><code> 648 649 650 651 652 653 int</code> 654 </td> 655 656 <td width="100%"> 657 <code> 658 hashCode() 659 </code> 660 661 </td> 662 </tr> 663 664 665 666 <tr class="api apilevel-" > 667 668 669 <td><code> 670 671 672 673 final 674 675 void</code> 676 </td> 677 678 <td width="100%"> 679 <code> 680 notify() 681 </code> 682 683 </td> 684 </tr> 685 686 687 688 <tr class="api apilevel-" > 689 690 691 <td><code> 692 693 694 695 final 696 697 void</code> 698 </td> 699 700 <td width="100%"> 701 <code> 702 notifyAll() 703 </code> 704 705 </td> 706 </tr> 707 708 709 710 <tr class="api apilevel-" > 711 712 713 <td><code> 714 715 716 717 718 719 String</code> 720 </td> 721 722 <td width="100%"> 723 <code> 724 toString() 725 </code> 726 727 </td> 728 </tr> 729 730 731 732 <tr class="api apilevel-" > 733 734 735 <td><code> 736 737 738 739 final 740 741 void</code> 742 </td> 743 744 <td width="100%"> 745 <code> 746 wait(long arg0, int arg1) 747 </code> 748 749 </td> 750 </tr> 751 752 753 754 <tr class="api apilevel-" > 755 756 757 <td><code> 758 759 760 761 final 762 763 void</code> 764 </td> 765 766 <td width="100%"> 767 <code> 768 wait(long arg0) 769 </code> 770 771 </td> 772 </tr> 773 774 775 776 <tr class="api apilevel-" > 777 778 779 <td><code> 780 781 782 783 final 784 785 void</code> 786 </td> 787 788 <td width="100%"> 789 <code> 790 wait() 791 </code> 792 793 </td> 794 </tr> 795 796 797 798 </table> 799 </div> 800</div> 801</td></tr> 802 803 804 805<tr class="api apilevel-" > 806<td colspan="2"> 807 808 <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-android.support.test.espresso.ViewAction" class="jd-expando-trigger closed" 809 ><img height="34" id="inherited-methods-android.support.test.espresso.ViewAction-trigger" 810 src="/assets/images/styles/disclosure_down.png" 811 class="jd-expando-trigger-img" /></a>From 812interface 813<code> 814 815 <a href="/reference/android/support/test/espresso/ViewAction.html">android.support.test.espresso.ViewAction</a> 816 817</code> 818<div id="inherited-methods-android.support.test.espresso.ViewAction"> 819 <div id="inherited-methods-android.support.test.espresso.ViewAction-list" 820 class="jd-inheritedlinks"> 821 </div> 822 <div id="inherited-methods-android.support.test.espresso.ViewAction-summary" style="display: none;"> 823 <table class="jd-sumtable-expando responsive"> 824 825 826 827 828 <tr class="api apilevel-" > 829 830 831 <td><code> 832 abstract 833 834 835 836 837 Matcher<View></code> 838 </td> 839 840 <td width="100%"> 841 <code> 842 <a href="/reference/android/support/test/espresso/ViewAction.html#getConstraints()">getConstraints</a>() 843 </code> 844 845 <p>A mechanism for ViewActions to specify what type of views they can operate on. 846 847 848</p> 849 850 </td> 851 </tr> 852 853 854 855 <tr class="api apilevel-" > 856 857 858 <td><code> 859 abstract 860 861 862 863 864 String</code> 865 </td> 866 867 <td width="100%"> 868 <code> 869 <a href="/reference/android/support/test/espresso/ViewAction.html#getDescription()">getDescription</a>() 870 </code> 871 872 <p>Returns a description of the view action. 873 874 875</p> 876 877 </td> 878 </tr> 879 880 881 882 <tr class="api apilevel-" > 883 884 885 <td><code> 886 abstract 887 888 889 890 891 void</code> 892 </td> 893 894 <td width="100%"> 895 <code> 896 <a href="/reference/android/support/test/espresso/ViewAction.html#perform(android.support.test.espresso.UiController, android.view.View)">perform</a>(<a href="/reference/android/support/test/espresso/UiController.html">UiController</a> uiController, View view) 897 </code> 898 899 <p>Performs this action on the given view. 900 901 902</p> 903 904 </td> 905 </tr> 906 907 908 909 </table> 910 </div> 911</div> 912</td></tr> 913 914 915</table> 916 917 918 919<!-- XML Attributes --> 920 921 922<!-- Enum Values --> 923 924 925<!-- Constants --> 926 927 928<!-- Fields --> 929 930 931<!-- Public ctors --> 932 933 934<!-- ========= CONSTRUCTOR DETAIL ======== --> 935<h2 class="api-section">Public constructors</h2> 936 937 938 939<A NAME="AtomAction(android.support.test.espresso.web.model.Atom<E>, android.support.test.espresso.web.model.WindowReference, android.support.test.espresso.web.model.ElementReference)"></A> 940 941<div class="api apilevel-"> 942 <h3 class="api-name">AtomAction</h3> 943 <div class="api-level"> 944 <div></div> 945 946 947 948 </div> 949<pre class="api-signature no-pretty-print"> 950AtomAction (<a href="/reference/android/support/test/espresso/web/model/Atom.html">Atom</a><E> atom, 951 <a href="/reference/android/support/test/espresso/web/model/WindowReference.html">WindowReference</a> window, 952 <a href="/reference/android/support/test/espresso/web/model/ElementReference.html">ElementReference</a> element)</pre> 953 954 955 956 957 <p>Creates an AtomAction.</p> 958 <table class="responsive"> 959 <tr><th colspan=2>Parameters</th></tr> 960 <tr> 961 <td><code>atom</code></td> 962 <td width="100%"> 963 <code>Atom</code>: 964 the atom to execute</td> 965 </tr> 966 <tr> 967 <td><code>window</code></td> 968 <td width="100%"> 969 <code>WindowReference</code>: 970 (optional/nullable) the window context to execute on.</td> 971 </tr> 972 <tr> 973 <td><code>element</code></td> 974 <td width="100%"> 975 <code>ElementReference</code>: 976 (optional/nullable) the element to execute on. 977</td> 978 </tr> 979 </table> 980 981</div> 982 983 984 985 986 987<!-- ========= CONSTRUCTOR DETAIL ======== --> 988<!-- Protected ctors --> 989 990 991 992<!-- ========= METHOD DETAIL ======== --> 993<!-- Public methdos --> 994 995<h2 class="api-section">Public methods</h2> 996 997 998 999<A NAME="get(long, java.util.concurrent.TimeUnit)"></A> 1000 1001<div class="api apilevel-"> 1002 <h3 class="api-name">get</h3> 1003 <div class="api-level"> 1004 <div></div> 1005 1006 1007 1008 </div> 1009<pre class="api-signature no-pretty-print"> 1010E get (long val, 1011 TimeUnit unit)</pre> 1012 1013 1014 1015 1016 <p>Blocks until the atom has completed execution with a configurable timeout. 1017</p> 1018 <table class="responsive"> 1019 <tr><th colspan=2>Parameters</th></tr> 1020 <tr> 1021 <td><code>val</code></td> 1022 <td width="100%"> 1023 <code>long</code> 1024 <!-- no parameter comment --></td> 1025 </tr> 1026 <tr> 1027 <td><code>unit</code></td> 1028 <td width="100%"> 1029 <code>TimeUnit</code> 1030 <!-- no parameter comment --></td> 1031 </tr> 1032 </table> 1033 <table class="responsive"> 1034 <tr><th colspan=2>Returns</th></tr> 1035 <tr> 1036 <td><code>E</code></td> 1037 <td width="100%"><!-- no returns description in source --></td> 1038 </tr> 1039 </table> 1040 <table class="responsive"> 1041 <tr><th colspan=2>Throws</th></tr> 1042 <tr> 1043 <td><code>ExecutionException</code></td> 1044 <td width="100%"></td> 1045 </tr> 1046 <tr> 1047 <td><code>InterruptedException</code></td> 1048 <td width="100%"></td> 1049 </tr> 1050 <tr> 1051 <td><code>TimeoutException</code></td> 1052 <td width="100%"></td> 1053 </tr> 1054 </table> 1055 1056 1057</div> 1058 1059 1060<A NAME="get()"></A> 1061 1062<div class="api apilevel-"> 1063 <h3 class="api-name">get</h3> 1064 <div class="api-level"> 1065 <div></div> 1066 1067 1068 1069 </div> 1070<pre class="api-signature no-pretty-print"> 1071E get ()</pre> 1072 1073 1074 1075 1076 <p>Blocks until the atom has completed execution. 1077</p> 1078 <table class="responsive"> 1079 <tr><th colspan=2>Returns</th></tr> 1080 <tr> 1081 <td><code>E</code></td> 1082 <td width="100%"><!-- no returns description in source --></td> 1083 </tr> 1084 </table> 1085 <table class="responsive"> 1086 <tr><th colspan=2>Throws</th></tr> 1087 <tr> 1088 <td><code>ExecutionException</code></td> 1089 <td width="100%"></td> 1090 </tr> 1091 <tr> 1092 <td><code>InterruptedException</code></td> 1093 <td width="100%"></td> 1094 </tr> 1095 </table> 1096 1097 1098</div> 1099 1100 1101<A NAME="getConstraints()"></A> 1102 1103<div class="api apilevel-"> 1104 <h3 class="api-name">getConstraints</h3> 1105 <div class="api-level"> 1106 <div></div> 1107 1108 1109 1110 </div> 1111<pre class="api-signature no-pretty-print"> 1112Matcher<View> getConstraints ()</pre> 1113 1114 1115 1116 1117 <p>A mechanism for ViewActions to specify what type of views they can operate on. 1118 1119 A ViewAction can demand that the view passed to perform meets certain constraints. For example 1120 it may want to ensure the view is already in the viewable physical screen of the device or is 1121 of a certain type.</p> 1122 <table class="responsive"> 1123 <tr><th colspan=2>Returns</th></tr> 1124 <tr> 1125 <td><code>Matcher<View></code></td> 1126 <td width="100%">a <a href="http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matcher.html"> 1127 <code>Matcher</code></a> that will be tested prior to calling perform. 1128</td> 1129 </tr> 1130 </table> 1131 1132</div> 1133 1134 1135<A NAME="getDescription()"></A> 1136 1137<div class="api apilevel-"> 1138 <h3 class="api-name">getDescription</h3> 1139 <div class="api-level"> 1140 <div></div> 1141 1142 1143 1144 </div> 1145<pre class="api-signature no-pretty-print"> 1146String getDescription ()</pre> 1147 1148 1149 1150 1151 <p>Returns a description of the view action. The description should not be overly long and should 1152 fit nicely in a sentence like: "performing %description% action on view with id ..." 1153</p> 1154 <table class="responsive"> 1155 <tr><th colspan=2>Returns</th></tr> 1156 <tr> 1157 <td><code>String</code></td> 1158 <td width="100%"><!-- no returns description in source --></td> 1159 </tr> 1160 </table> 1161 1162</div> 1163 1164 1165<A NAME="getFuture()"></A> 1166 1167<div class="api apilevel-"> 1168 <h3 class="api-name">getFuture</h3> 1169 <div class="api-level"> 1170 <div></div> 1171 1172 1173 1174 </div> 1175<pre class="api-signature no-pretty-print"> 1176Future<E> getFuture ()</pre> 1177 1178 1179 1180 1181 <p>Return a Future, which will be set and transformed from futureEval. 1182 Espresso's public API cannot have guava types in its method signatures, so return Future 1183 instead of ListenableFuture or SettableFuture. 1184</p> 1185 <table class="responsive"> 1186 <tr><th colspan=2>Returns</th></tr> 1187 <tr> 1188 <td><code>Future<E></code></td> 1189 <td width="100%"><!-- no returns description in source --></td> 1190 </tr> 1191 </table> 1192 1193</div> 1194 1195 1196<A NAME="perform(android.support.test.espresso.UiController, android.view.View)"></A> 1197 1198<div class="api apilevel-"> 1199 <h3 class="api-name">perform</h3> 1200 <div class="api-level"> 1201 <div></div> 1202 1203 1204 1205 </div> 1206<pre class="api-signature no-pretty-print"> 1207void perform (<a href="/reference/android/support/test/espresso/UiController.html">UiController</a> controller, 1208 View view)</pre> 1209 1210 1211 1212 1213 <p>Performs this action on the given view.</p> 1214 <table class="responsive"> 1215 <tr><th colspan=2>Parameters</th></tr> 1216 <tr> 1217 <td><code>controller</code></td> 1218 <td width="100%"> 1219 <code>UiController</code>: 1220 the controller to use to interact with the UI.</td> 1221 </tr> 1222 <tr> 1223 <td><code>view</code></td> 1224 <td width="100%"> 1225 <code>View</code>: 1226 the view to act upon. never null. 1227</td> 1228 </tr> 1229 </table> 1230 1231</div> 1232 1233 1234 1235 1236 1237<!-- ========= METHOD DETAIL ======== --> 1238 1239 1240 1241<!-- ========= END OF CLASS DATA ========= --> 1242 1243</div><!-- end jd-content --> 1244 1245 1246 1247<div class="data-reference-resources-wrapper"> 1248 1249 <ul data-reference-resources> 1250 1251 1252 1253 <li><h2>Classes</h2> 1254 <ul> 1255 <li class="selected api apilevel-"><a href="/reference/android/support/test/espresso/web/action/AtomAction.html">AtomAction</a></li> 1256 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/web/action/EnableJavascriptAction.html">EnableJavascriptAction</a></li> 1257 </ul> 1258 </li> 1259 1260 1261 1262 </ul> 1263 1264</div> 1265 1266 1267 1268</body> 1269</html> 1270