{"id":391364,"date":"2024-06-29T09:47:01","date_gmt":"2024-06-29T09:47:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=391364"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=391364","title":{"rendered":"<span>Ultron \u2014 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 UI \u0442\u0435\u0441\u0442\u043e\u0432 Android<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u00a0android, \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a kaspresso. \u0410\u00a0\u0435\u0441\u0442\u044c\u00a0\u043b\u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b?<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/5j\/st\/z7\/5jstz7wp1-vc6hscd6xrt0_povi.png\" alt=\"\" title=\"\" data-src=\"https:\/\/habrastorage.org\/webt\/5j\/st\/z7\/5jstz7wp1-vc6hscd6xrt0_povi.png\"\/><\/figure>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u00a0\u0442\u0430\u043a\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043a\u0430\u043a\u00a0<a href=\"https:\/\/github.com\/open-tool\/ultron\" rel=\"noopener noreferrer nofollow\">Ultron<\/a> \u0434\u043b\u044f\u00a0android ui \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u2011\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u00a0kaspresso \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c. \u041d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043c\u0430\u043b\u043e \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u00a0Espresso, UI Automator \u0438 Compose UI testing framework, \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0410\u043b\u0435\u043a\u0441\u0435\u0435\u043c \u0422\u044e\u0440\u0438\u043d\u044b\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u043b \u043d\u0430 Heisenbug. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u0438\u0442\u044c Ultron \u043d\u0430 \u0445\u0430\u0431\u0440\u0435.<\/p>\n<h2>\u041a\u0430\u043a\u043e\u0432\u044b \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430?<\/h2>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043b\u044e\u0431\u044b\u043c action \u0438\u043b\u0438\u00a0assertion<\/p>\n<\/li>\n<li>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 UI\u2011\u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0435\u043d\u0438\u044f preconditions \u0438 postconditions<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u043e\u0431\u043b\u0438\u0436\u0435.<\/p>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 \u043a Assertions and Actions<\/h2>\n<p>\u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b actions \u0438 assertions \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438:<\/p>\n<p><strong>Espresso<\/strong><\/p>\n<pre><code class=\"kotlin\">onView(withId(R.id.send_button)).check(isDisplayed()).perform(click()) <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">withId(R.id.send_button).isDisplayed().click() <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 ultron \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 Ultron \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u043a\u0430\u043a \u0443 \u044d\u0441\u043f\u0440\u0435\u0441\u0441\u043e. Ultron \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/Espresso-operations\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/a>.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 page object:<\/p>\n<pre><code class=\"kotlin\">object SomePage : Page&lt;SomePage>() {     private val button = withId(R.id.button1)     private val eventStatus = withId(R.id.last_event_status)      fun checkEventStatusText(expectedEventText: String) {          button.click()          eventStatus.hasText(expectedEventText)     } } <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0412\u0430\u043c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0430\u0442\u0447\u0435\u0440\u044b \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0430\u0434 \u043d\u0438\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u043d\u0430\u0434 recycler view<\/h2>\n<p><strong>Espresso<\/strong><\/p>\n<pre><code class=\"kotlin\">onView(withId(R.id.recycler_friends))     .perform(         RecyclerViewActions             .scrollTo&lt;RecyclerView.ViewHolder>(hasDescendant(withText(\"Janice\")))     )     .perform(         RecyclerViewActions             .actionOnItem&lt;RecyclerView.ViewHolder>(                 hasDescendant(withText(\"Janice\")),                 click()             )         ) <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">withRecyclerView(R.id.recycler_friends)     .item(hasDescendant(withText(\"Janice\")))     .click() <\/code><\/pre>\n<p>Ultron \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e\u0435 \u0430\u043f\u0438 \u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u0443\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a.<br \/> \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 best practice \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c page object:<\/p>\n<pre><code class=\"kotlin\">object FriendsListPage : Page&lt;FriendsListPage>() {     \/\/ param loadTimeout \u0432 \u043c\u0441 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 RecyclerView     val recycler = withRecyclerView(R.id.recycler_friends, loadTimeout = 10_000L)      fun someStep(){         recycler.assertEmpty()         recycler.hasContentDescription(\"Description\")     } } <\/code><\/pre>\n<p>\u0410\u043f\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"kotlin\">recycler.item(position = 10, autoScroll = true).click() \/\/ \u043d\u0430\u0439\u0442\u0438 10 \u0430\u0439\u0442\u0435\u043c \u043f\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u044c \u0434\u043e \u043d\u0435\u0433\u043e recycler.item(matcher = hasDescendant(withText(\"Janice\"))).isDisplayed() recycler.firstItem().click() \/\/ \u0432\u0437\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0439\u0442\u0435\u043c \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430 recycler.lastItem().isCompletelyDisplayed()  \/\/ \u0435\u0441\u043b\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0442\u0447\u0435\u0440 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 val matcher = hasDescendant(withText(\"Friend\")) recycler.itemMatched(matcher, index = 2).click() \/\/ \u0432\u0435\u0440\u043d\u0443\u0442\u044c 3 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u043f\u043e \u043c\u0430\u0442\u0447\u0435\u0440\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 0 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 recycler.firstItemMatched(matcher).isDisplayed() recycler.lastItemMatched(matcher).isDisplayed() recycler.getItemsAdapterPositionList(matcher) \/\/ \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043c\u0430\u0442\u0447\u0435\u0440\u0443 <\/code><\/pre>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433\u0435 \u0434\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0430\u0432\u0442\u043e\u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0440\u0430\u0432\u0435\u043d true \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0430\u0439\u0442\u0435\u043c\u044b \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430 (\u0438\u043c\u0435\u044e\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432\u044c\u044e) \u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441 \u043d\u0438\u043c\u0438 \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434:<\/p>\n<pre><code class=\"kotlin\">object FriendsListPage : Page&lt;FriendsListPage>() {      \/\/ \u0437\u0430\u0434\u0430\u0435\u043c \u043c\u0430\u0442\u0447\u0435\u0440 \u0434\u043b\u044f \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430     val recycler = withRecyclerView(R.id.recycler_friends)      \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u0439\u0442\u0435\u043c\u0430 \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430     fun getListItem(contactName: String): FriendRecyclerItem {         return recycler.getItem(hasDescendant(allOf(withId(R.id.tv_name), withText(contactName))))     }      \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u043c \u043a\u0430\u043a \u0430\u0439\u0442\u0435\u043c \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430 withRecyclerView(R.id.recycler_friends)     class FriendRecyclerItem : UltronRecyclerViewItem() {         val avatar by lazy { getChild(withId(R.id.avatar)) }         val name by lazy { getChild(withId(R.id.tv_name)) }         val status by lazy { getChild(withId(R.id.tv_status)) }     }      \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c getListItem(name) \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a status     fun assertStatus(name: String, status: String) = apply {         getListItem(name).status.hasText(status).isDisplayed()     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u0430\u043a FriendRecyclerItem, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0430\u043f\u0438:<\/p>\n<pre><code class=\"kotlin\">recycler.getItem&lt;FriendRecyclerItem>(position = 10, autoScroll = true).status.hasText(\"UNAGI\") recycler.getItem&lt;FriendRecyclerItem>(matcher = hasDescendant(withText(\"Janice\"))).status.textContains(\"Oh. My\") recycler.getFirstItem&lt;FriendRecyclerItem>().avatar.click() \/\/ \u0432\u0437\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440 \u0430\u0439\u0442\u0435\u043c recycler.getLastItem&lt;FriendRecyclerItem>().isCompletelyDisplayed()  \/\/ \u0435\u0441\u043b\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0442\u0447\u0435\u0440 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 val matcher = hasDescendant(withText(containsString(\"Friend\"))) recycler.getItemMatched&lt;FriendRecyclerItem>(matcher, index = 2).name.click() \/\/ \u0432\u0435\u0440\u043d\u0443\u0442\u044c 3 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u043f\u043e \u043c\u0430\u0442\u0447\u0435\u0440\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 0 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 recycler.getFirstItemMatched&lt;FriendRecyclerItem>(matcher).name.hasText(\"Friend1\") recycler.getLastItemMatched&lt;FriendRecyclerItem>(matcher).avatar.isDisplayed() <\/code><\/pre>\n<h2>Espresso WebView operations<\/h2>\n<p><strong>Espresso<\/strong><\/p>\n<pre><code class=\"kotlin\">onWebView()     .withElement(findElement(Locator.ID, \"text_input\"))     .perform(webKeys(newTitle))     .withElement(findElement(Locator.ID, \"button1\"))     .perform(webClick())     .withElement(findElement(Locator.ID, \"title\"))     .check(webMatches(getText(), containsString(newTitle))) <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">id(\"text_input\").webKeys(newTitle) id(\"button1\").webClick() id(\"title\").hasText(newTitle) <\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0432\u0435\u0431\u0432\u044c\u044e \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u044b\u0439 \u043a\u0435\u0439\u0441, \u0442\u043e \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/WebView\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0435<\/a>.<\/p>\n<h2>UI Automator operations<\/h2>\n<p><strong>Espresso<\/strong><\/p>\n<pre><code class=\"kotlin\">val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) device     .findObject(By.res(\"com.atiurin.sampleapp:id\", \"button1\"))     .click() <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">byResId(R.id.button1).click() <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 UI Automator \u043e\u043f\u0438\u0441\u0430\u043d <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/UI-Automator-operation\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<h2>\u041f\u0440\u043e\u0441\u0442\u044b\u0435 compose operations<\/h2>\n<p><strong>Compose framework<\/strong><\/p>\n<pre><code class=\"kotlin\">composeTestRule.onNode(hasTestTag(\"Continue\")).performClick() composeTestRule.onNodeWithText(\"Welcome\").assertIsDisplayed() <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">hasTestTag(\"Continue\").click() hasText(\"Welcome\").assertIsDisplayed() <\/code><\/pre>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0441\u0439\u0442\u0432\u0438\u0435 \u0441 \u043a\u043e\u043c\u043f\u043e\u0443\u0437\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/Compose#ultron-compose\" rel=\"noopener noreferrer nofollow\">wiki<\/a>.<\/p>\n<h2>Compose list operations<\/h2>\n<p><strong>Compose framework<\/strong><\/p>\n<pre><code class=\"kotlin\">val itemMatcher = hasText(contact.name) composeRule     .onNodeWithTag(contactsListTestTag)     .performScrollToNode(itemMatcher)     .onChildren()     .filterToOne(itemMatcher)     .assertTextContains(contact.name) <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">composeList(hasTestTag(contactsListTestTag))     .item(hasText(contact.name))     .assertTextContains(contact.name) <\/code><\/pre>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 LazyColumn\/LazyRow \u043e\u043f\u0438\u0441\u0430\u043d\u0430 <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/Compose#ultron-compose-lazycolumnlazyrow\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<h2>\u0421\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430<\/h2>\n<p>\u0427\u0435\u043c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435?<br \/> \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 5 \u0441\u0435\u043a\u0443\u043d\u0434).<\/p>\n<pre><code class=\"kotlin\">UltronWrapperException::class.java, UltronException::class.java, PerformException::class.java, NoMatchingViewException::class.java, AssertionFailedError::class.java, RuntimeException::class.java <\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0438\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 UltronConfig, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &#8212; withTimeout(..) (\u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043d\u0438\u0436\u0435).<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435:<\/p>\n<h3>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/h3>\n<pre><code class=\"kotlin\">withId(R.id.last_event_status).withTimeout(10_000).isDisplayed() <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0430\u0439\u043c\u0430\u0443\u0442, \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f action \u0438\u043b\u0438 assertion \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 5 \u0441\u0435\u043a\u0443\u043d\u0434)<\/p>\n<p>\u0415\u0441\u0442\u044c 2 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430 withTimeout(..):<br \/> \u0423\u043a\u0430\u0436\u0438\u0442\u0435 withTimeout(..) \u0432 \u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u044d\u0442\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c<\/p>\n<pre><code class=\"kotlin\">object SomePage : Page&lt;SomePage>() {     private val eventStatus = withId(R.id.last_event_status).withTimeout(10_000) } <\/code><\/pre>\n<p>\u0423\u043a\u0430\u0436\u0438\u0442\u0435 withTimeout(..) \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0430\u0433\u0430, \u0447\u0442\u043e\u0431\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"kotlin\">object SomePage : Page&lt;SomePage>() {     fun someLongUserStep(expectedEventText: String){          longRequestButton.click()          eventStatus.withTimeout(20_000).hasText(expectedEventText)     } } <\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 hasText(expectedEventText) \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c eventStatus \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f 20 \u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u043a\u0430 \u043e\u043d\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u0442 \u0443\u0441\u043f\u0435\u0445\u0430. \u0415\u0441\u043b\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 20 \u0441\u0435\u043a\u0443\u043d\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u0443\u0432\u0435\u043d\u0447\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0445\u043e\u043c, \u0442\u0435\u0441\u0442 \u0443\u043f\u0430\u0434\u0435\u0442 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439.<\/p>\n<h3>Boolean operation result<\/h3>\n<p>\u0412\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 isSuccess, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 boolean \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 false \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 isSuccess \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 5 \u0441\u0435\u043a\u0443\u043d\u0434). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442 \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u043a\u0443\u043f\u0435 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 isSuccess.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"kotlin\">val isButtonDisplayed = withId(R.id.button).isSuccess { withTimeout(2_000).isDisplayed() } if (isButtonDisplayed) {     \/\/ \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f } <\/code><\/pre>\n<h3>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c\u0438 ViewActions \u0438 ViewAssertions<\/h3>\n<p>\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u044d\u0441\u043f\u0440\u0435\u0441\u0441\u043e Ultron \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 UltronEspressoInteraction. \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f kotlin, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<pre><code class=\"kotlin\">fun &lt;T> UltronEspressoInteraction&lt;T>.appendText(text: String) = apply {     executeAction(         operationBlock = getInteractionActionBlock(AppendTextAction(text)),         name = \"Append text '$text' to ${getInteractionMatcher()}\",         description = \"${interaction!!::class.simpleName} APPEND_TEXT to ${getInteractionMatcher()} during $timeoutMs ms\",     ) <\/code><\/pre>\n<p>AppendTextAction \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 ViewAction<\/p>\n<pre><code class=\"kotlin\">class AppendTextAction(private val value: String) : ViewAction {     override fun getConstraints() = allOf(isDisplayed(), isAssignableFrom(TextView::class.java))     override fun perform(uiController: UiController, view: View) {         (view as TextView).apply {             this.text = \"$text$value\"         }         uiController.loopMainThreadUntilIdle()     }     ... } <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0430\u0448\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043d\u0430 100% \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0434\u043b\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 Ultron, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 3 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<pre><code class=\"kotlin\">\/\/support action for all Matcher&lt;View> fun Matcher&lt;View>.appendText(text: String) = UltronEspressoInteraction(onView(this)).appendText(text)  \/\/support action for all ViewInteractions fun ViewInteraction.appendText(text: String) = UltronEspressoInteraction(this).appendText(text)  \/\/support action for all DataInteractions fun DataInteraction.appendText(text: String) =  UltronEspressoInteraction(this).appendText(text) <\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e appendText:<\/p>\n<pre><code class=\"kotlin\">withId(R.id.text_input).appendText(\"some text to append\") <\/code><\/pre>\n<h3>Custom operation assertions<\/h3>\n<p>\u0411\u044b\u0432\u0430\u044e\u0442 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f click() \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0438 \u0442\u0435\u0441\u0442 \u043f\u0430\u0434\u0430\u0435\u0442 (\u0442\u043e\u0447\u043d\u0435\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043d\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 onClick listener \u0438\u043b\u0438 \u043d\u0435 \u043e\u0442\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0448\u0435\u043d \u043d\u0430 \u043a\u043b\u0438\u043a) \u0438\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0430\u0441\u0441\u0435\u0440\u0448\u043d \u043d\u0430 \u043a\u043b\u0438\u043a, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043a\u043b\u0438\u043a \u0432\u043e\u0437\u044b\u043c\u0435\u043b \u044d\u0444\u0444\u0435\u043a\u0442. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"kotlin\">button.withAssertion(\"Assert smth is displayed\") {     title.isDisplayed() }.click() <\/code><\/pre>\n<p>&#171;Assert smth is displayed&#187; &#8212; \u044d\u0442\u043e \u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<br \/> \u041d\u043e \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"kotlin\">button.withAssertion {     title.isDisplayed() }.click() <\/code><\/pre>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 Ultron \u0432\u043d\u0443\u0442\u0440\u0438 assertion \u0431\u043b\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 logcat, \u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0432 logcat, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 isListened<\/p>\n<pre><code class=\"kotlin\">button.withAssertion(isListened = true) { .. } <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u043d\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435, \u043f\u0440\u043e \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 assertion \u0438 action.<\/p>\n<ul>\n<li>\n<p>withAssertion {..} \u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u0432\u043e\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e action \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0430\u0436\u0434\u044b. \u0418 \u0431\u043b\u043e\u043a assertion \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0430\u0434\u0430\u0435\u0442 action.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 action \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043d\u043e assertion failed, \u0442\u043e action \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f. \u0423 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 action \u0438 assertion.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f assertion, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"kotlin\">button.withAssertion {     title.withTimeout(3_000L).isDisplayed() }.click() <\/code><\/pre>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u043d\u0430 \u0432\u0441\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"kotlin\">button.withTimeout(10_000L).withAssertion {     title.withTimeout(2_000L).isDisplayed() }.click() <\/code><\/pre>\n<h2>RuleSequence + SetUps &amp; TearDowns \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h2>\n<ul>\n<li>\n<p>\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434- \u0438 \u043f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a class=\"mention\" href=\"\/users\/Before\">@Before<\/a> \u0438 <a class=\"mention\" href=\"\/users\/After\">@After<\/a>, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 SetUpRule \u0438\u043b\u0438 TearDownRule<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<h3>RuleSequence<\/h3>\n<p>RuleSequence \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u043d\u043e\u0439 JUnit 4 RuleChain. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>RuleSequence \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0432 \u044d\u0442\u043e\u043c \u0435\u0433\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f.<\/p>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f. RuleSequence \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0440\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0440\u0430\u0432\u0438\u043b \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c.<\/p>\n<p>first &#8212; \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c<br \/> normal &#8212; \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u044d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<br \/> last &#8212; \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438<\/p>\n<p>\u041f\u0440\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/alex-tiurin\/ultron\/wiki\/Deep-dive-into-rules-order-with-RuleSequence\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c RuleSequence \u0432 BaseTest. \u0412\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 RuleSequence \u0432 BaseTest \u0438 \u0432 \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u0430\u0445 BaseTest.<\/p>\n<pre><code class=\"kotlin\">abstract class BaseTest {     val setupRule = SetUpRule().add {             \/\/ \u043f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438\u043b\u0438 \u0430\u0432\u0442\u043e\u043b\u043e\u0433\u0438\u043d \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435         }      @get:Rule     open val ruleSequence = RuleSequence(setupRule) } <\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0431\u043b\u043e\u043a\u0435 init \u0432\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code class=\"kotlin\">class DemoTest : BaseTest() {     private val activityRule = ActivityScenarioRule(MainActivity::class.java)      init {         ruleSequence.addLast(activityRule)     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 RuleSequence (\u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441 RuleChain) \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <a class=\"mention\" href=\"\/users\/get\">@get<\/a>:Rule \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<p>\u0424\u0443\u043b\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u043a\u043d\u0443\u0442\u044c \u0442\u0443\u0442:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/alex-tiurin\/ultron\/blob\/master\/sample-app\/src\/androidTest\/java\/com\/atiurin\/sampleapp\/tests\/BaseTest.kt\" rel=\"noopener noreferrer nofollow\">BaseTest<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/alex-tiurin\/ultron\/blob\/master\/sample-app\/src\/androidTest\/java\/com\/atiurin\/sampleapp\/tests\/espresso\/DemoEspressoTest.kt\" rel=\"noopener noreferrer nofollow\">DemoEspressoTest<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>SetUpRule<\/h2>\n<p>\u042d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0442\u0435\u0441\u0442\u0430. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 RuleSequence \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u043d\u044b \u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h3>\u041f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u044f\u043c\u0431\u0434\u0443 \u0432 SetUpRule \u0431\u0435\u0437 string key \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0438 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0432 \u043a\u043b\u0430\u0441\u0441\u0435.<\/p>\n<pre><code class=\"kotlin\">open val setupRule = SetUpRule()     .add {         Log.info(\"Login valid user will be executed before any test is started\")         AccountManager(InstrumentationRegistry.getInstrumentation().targetContext).login(             CURRENT_USER.login, CURRENT_USER.password         )     } <\/code><\/pre>\n<h3>\u041f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/h3>\n<ol>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0443 \u0441\u043e string key \u0432 (..) \u0432 SetUpRule<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <a class=\"mention\" href=\"\/users\/SetUp\">@SetUp<\/a>(string key) \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0443<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">setupRule.add(FIRST_CONDITION){      Log.info(\"$FIRST_CONDITION setup, executed for test with annotation @SetUp(FIRST_CONDITION)\")   }  @SetUp(FIRST_CONDITION) @Test fun someTest() {     \/\/ \u0441\u0442\u0435\u043f\u044b \u0442\u0435\u0441\u0442\u0430 }  companion object {     private const val FIRST_CONDITION = \"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u044f\" } <\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e SetUpRule \u0432 Rule Sequence.<\/p>\n<pre><code class=\"kotlin\">ruleSequence.add(setupRule) <\/code><\/pre>\n<h2>TearDownRule<\/h2>\n<p>\u042d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430.<\/p>\n<h3>\u041f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043b\u044f\u043c\u0431\u0434\u0443 \u0432 TearDownRule \u0431\u0435\u0437 string key \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445, \u0438 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435.<\/p>\n<pre><code class=\"kotlin\">open val tearDownRule = TearDownRule()     .add {         AccountManager(InstrumentationRegistry.getInstrumentation().targetContext).logout()     } <\/code><\/pre>\n<h3>\u041f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430<\/h3>\n<ol>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u044f\u043c\u0431\u0434\u0443 \u0441\u043e string key \u0432 (..) \u0432 TearDownRule<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e <a class=\"mention\" href=\"\/users\/TearDown\">@TearDown<\/a>(string key) \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u0443<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"kotlin\">tearDownRule.add (LAST_CONDITION){      Log.info(\"$LAST_CONDITION tearDown, executed for test with annotation @TearDown(LAST_CONDITION)\")   }  @TearDown(LAST_CONDITION) @Test fun someTest() {     \/\/ \u0441\u0442\u0435\u043f\u044b \u0442\u0435\u0441\u0442\u0430 }  companion object {     private const val LAST_CONDITION = \"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0443\u0441\u043b\u043e\u0432\u0438\u044f\" } <\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e TearDownRule \u0432 Rule Sequence.<\/p>\n<pre><code class=\"kotlin\">ruleSequence.addLast(tearDownRule) <\/code><\/pre>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0445 Espresso \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439<\/h2>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0435\u043d\u0430 \u0438 \u0432\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<pre><code class=\"kotlin\">val toolbarTitle = withId(R.id.toolbar_title)  fun assertToolbarTitleWithSuitableRoot(text: String) {     toolbarTitle.withSuitableRoot().hasText(text) } <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f withSuitableRoot() \u0438\u0449\u0435\u0442 \u0432\u0438\u0434\u0438\u043c\u044b\u0439 root view, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0430\u0448\u0430 \u0438\u0441\u043a\u043e\u043c\u0430\u044f view \u043f\u043e \u043c\u0430\u0442\u0447\u0435\u0440\u0443 \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0435\u0433\u043e \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e ViewInteraction. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u0430 Espresso, \u0442\u043e \u0432\u044b\u0432\u0430\u043b\u0438\u0442\u0441\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 NoMatchingRootException, \u0447\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 root view \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0438\u0441\u043a\u043e\u043c\u043e\u0439 view \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u043c\u0430\u0442\u0447\u0435\u0440\u0443. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u0438\u043c\u044b\u0445 root view \u043d\u0435\u0442 \u0432\u0430\u0448\u0435\u0439 \u0438\u0441\u043a\u043e\u043c\u043e\u0439 view.<\/p>\n<h2>\u041c\u0438\u043d\u0443\u0441\u044b \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430<\/h2>\n<ul>\n<li>\n<p>\u041d\u0435\u0442 adbServer, \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0448\u0435\u043b\u043b<\/p>\n<\/li>\n<li>\n<p>\u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a \u0430\u043a\u0442\u0438\u0432\u043d\u043e, \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b<\/p>\n<\/li>\n<\/ul>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0444\u0438\u0448\u043a\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0438 \u0442\u0443 \u0431\u0430\u0437\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u0431\u043e\u0440\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 ui \u043d\u0430 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \/ \u0434\u043e\u043b\u0438\u0441\u0442\u0430\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.<\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u0432 \u0433\u0440\u0443\u043f\u043f\u0443, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b <a href=\"https:\/\/t.me\/ultron_framework\" rel=\"noopener noreferrer nofollow\">Ultron telegram group<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/730144\/\"> https:\/\/habr.com\/ru\/articles\/730144\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u00a0android, \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a kaspresso. \u0410\u00a0\u0435\u0441\u0442\u044c\u00a0\u043b\u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b?<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u00a0\u0442\u0430\u043a\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043a\u0430\u043a\u00a0<a href=\"https:\/\/github.com\/open-tool\/ultron\" rel=\"noopener noreferrer nofollow\">Ultron<\/a> \u0434\u043b\u044f\u00a0android ui \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u2011\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u00a0kaspresso \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u043c. \u041d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043c\u0430\u043b\u043e \u043a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435. \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u00a0Espresso, UI Automator \u0438 Compose UI testing framework, \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0410\u043b\u0435\u043a\u0441\u0435\u0435\u043c \u0422\u044e\u0440\u0438\u043d\u044b\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u043b \u043d\u0430 Heisenbug. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u0438\u0442\u044c Ultron \u043d\u0430 \u0445\u0430\u0431\u0440\u0435.<\/p>\n<h2>\u041a\u0430\u043a\u043e\u0432\u044b \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430?<\/h2>\n<ul>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043b\u044e\u0431\u044b\u043c action \u0438\u043b\u0438\u00a0assertion<\/p>\n<\/li>\n<li>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u00a0\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 UI\u2011\u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0435\u043d\u0438\u044f preconditions \u0438 postconditions<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u043e\u0431\u043b\u0438\u0436\u0435.<\/p>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 \u043a Assertions and Actions<\/h2>\n<p>\u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b actions \u0438 assertions \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438:<\/p>\n<p><strong>Espresso<\/strong><\/p>\n<pre><code class=\"kotlin\">onView(withId(R.id.send_button)).check(isDisplayed()).perform(click()) <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">withId(R.id.send_button).isDisplayed().click() <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 ultron \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 Ultron \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u043a\u0430\u043a \u0443 \u044d\u0441\u043f\u0440\u0435\u0441\u0441\u043e. Ultron \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/Espresso-operations\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/a>.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 page object:<\/p>\n<pre><code class=\"kotlin\">object SomePage : Page&lt;SomePage>() {     private val button = withId(R.id.button1)     private val eventStatus = withId(R.id.last_event_status)      fun checkEventStatusText(expectedEventText: String) {          button.click()          eventStatus.hasText(expectedEventText)     } } <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0412\u0430\u043c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0430\u0442\u0447\u0435\u0440\u044b \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0430\u0434 \u043d\u0438\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<h2>\u041f\u043e\u0434\u0445\u043e\u0434 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c \u043d\u0430\u0434 recycler view<\/h2>\n<p><strong>Espresso<\/strong><\/p>\n<pre><code class=\"kotlin\">onView(withId(R.id.recycler_friends))     .perform(         RecyclerViewActions             .scrollTo&lt;RecyclerView.ViewHolder>(hasDescendant(withText(\"Janice\")))     )     .perform(         RecyclerViewActions             .actionOnItem&lt;RecyclerView.ViewHolder>(                 hasDescendant(withText(\"Janice\")),                 click()             )         ) <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">withRecyclerView(R.id.recycler_friends)     .item(hasDescendant(withText(\"Janice\")))     .click() <\/code><\/pre>\n<p>Ultron \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e\u0435 \u0430\u043f\u0438 \u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u0443\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a.<br \/> \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 best practice \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c page object:<\/p>\n<pre><code class=\"kotlin\">object FriendsListPage : Page&lt;FriendsListPage>() {     \/\/ param loadTimeout \u0432 \u043c\u0441 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 RecyclerView     val recycler = withRecyclerView(R.id.recycler_friends, loadTimeout = 10_000L)      fun someStep(){         recycler.assertEmpty()         recycler.hasContentDescription(\"Description\")     } } <\/code><\/pre>\n<p>\u0410\u043f\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"kotlin\">recycler.item(position = 10, autoScroll = true).click() \/\/ \u043d\u0430\u0439\u0442\u0438 10 \u0430\u0439\u0442\u0435\u043c \u043f\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u044c \u0434\u043e \u043d\u0435\u0433\u043e recycler.item(matcher = hasDescendant(withText(\"Janice\"))).isDisplayed() recycler.firstItem().click() \/\/ \u0432\u0437\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0439\u0442\u0435\u043c \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430 recycler.lastItem().isCompletelyDisplayed()  \/\/ \u0435\u0441\u043b\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0442\u0447\u0435\u0440 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 val matcher = hasDescendant(withText(\"Friend\")) recycler.itemMatched(matcher, index = 2).click() \/\/ \u0432\u0435\u0440\u043d\u0443\u0442\u044c 3 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u043f\u043e \u043c\u0430\u0442\u0447\u0435\u0440\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 0 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 recycler.firstItemMatched(matcher).isDisplayed() recycler.lastItemMatched(matcher).isDisplayed() recycler.getItemsAdapterPositionList(matcher) \/\/ \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043c\u0430\u0442\u0447\u0435\u0440\u0443 <\/code><\/pre>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433\u0435 \u0434\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0430\u0432\u0442\u043e\u0441\u043a\u0440\u043e\u043b\u043b\u0438\u043d\u0433 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0440\u0430\u0432\u0435\u043d true \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0430\u0439\u0442\u0435\u043c\u044b \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430 (\u0438\u043c\u0435\u044e\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432\u044c\u044e) \u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441 \u043d\u0438\u043c\u0438 \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434:<\/p>\n<pre><code class=\"kotlin\">object FriendsListPage : Page&lt;FriendsListPage>() {      \/\/ \u0437\u0430\u0434\u0430\u0435\u043c \u043c\u0430\u0442\u0447\u0435\u0440 \u0434\u043b\u044f \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430     val recycler = withRecyclerView(R.id.recycler_friends)      \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u0439\u0442\u0435\u043c\u0430 \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430     fun getListItem(contactName: String): FriendRecyclerItem {         return recycler.getItem(hasDescendant(allOf(withId(R.id.tv_name), withText(contactName))))     }      \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u043c \u043a\u0430\u043a \u0430\u0439\u0442\u0435\u043c \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440\u0430 withRecyclerView(R.id.recycler_friends)     class FriendRecyclerItem : UltronRecyclerViewItem() {         val avatar by lazy { getChild(withId(R.id.avatar)) }         val name by lazy { getChild(withId(R.id.tv_name)) }         val status by lazy { getChild(withId(R.id.tv_status)) }     }      \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c getListItem(name) \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a status     fun assertStatus(name: String, status: String) = apply {         getListItem(name).status.hasText(status).isDisplayed()     } } <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u0430\u043a FriendRecyclerItem, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0430\u043f\u0438:<\/p>\n<pre><code class=\"kotlin\">recycler.getItem&lt;FriendRecyclerItem>(position = 10, autoScroll = true).status.hasText(\"UNAGI\") recycler.getItem&lt;FriendRecyclerItem>(matcher = hasDescendant(withText(\"Janice\"))).status.textContains(\"Oh. My\") recycler.getFirstItem&lt;FriendRecyclerItem>().avatar.click() \/\/ \u0432\u0437\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0435\u0440 \u0430\u0439\u0442\u0435\u043c recycler.getLastItem&lt;FriendRecyclerItem>().isCompletelyDisplayed()  \/\/ \u0435\u0441\u043b\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0442\u0447\u0435\u0440 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 val matcher = hasDescendant(withText(containsString(\"Friend\"))) recycler.getItemMatched&lt;FriendRecyclerItem>(matcher, index = 2).name.click() \/\/ \u0432\u0435\u0440\u043d\u0443\u0442\u044c 3 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u043f\u043e \u043c\u0430\u0442\u0447\u0435\u0440\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 0 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 recycler.getFirstItemMatched&lt;FriendRecyclerItem>(matcher).name.hasText(\"Friend1\") recycler.getLastItemMatched&lt;FriendRecyclerItem>(matcher).avatar.isDisplayed() <\/code><\/pre>\n<h2>Espresso WebView operations<\/h2>\n<p><strong>Espresso<\/strong><\/p>\n<pre><code class=\"kotlin\">onWebView()     .withElement(findElement(Locator.ID, \"text_input\"))     .perform(webKeys(newTitle))     .withElement(findElement(Locator.ID, \"button1\"))     .perform(webClick())     .withElement(findElement(Locator.ID, \"title\"))     .check(webMatches(getText(), containsString(newTitle))) <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">id(\"text_input\").webKeys(newTitle) id(\"button1\").webClick() id(\"title\").hasText(newTitle) <\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0432\u0435\u0431\u0432\u044c\u044e \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u044b\u0439 \u043a\u0435\u0439\u0441, \u0442\u043e \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/WebView\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0435<\/a>.<\/p>\n<h2>UI Automator operations<\/h2>\n<p><strong>Espresso<\/strong><\/p>\n<pre><code class=\"kotlin\">val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) device     .findObject(By.res(\"com.atiurin.sampleapp:id\", \"button1\"))     .click() <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">byResId(R.id.button1).click() <\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 UI Automator \u043e\u043f\u0438\u0441\u0430\u043d <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/UI-Automator-operation\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<h2>\u041f\u0440\u043e\u0441\u0442\u044b\u0435 compose operations<\/h2>\n<p><strong>Compose framework<\/strong><\/p>\n<pre><code class=\"kotlin\">composeTestRule.onNode(hasTestTag(\"Continue\")).performClick() composeTestRule.onNodeWithText(\"Welcome\").assertIsDisplayed() <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">hasTestTag(\"Continue\").click() hasText(\"Welcome\").assertIsDisplayed() <\/code><\/pre>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0441\u0439\u0442\u0432\u0438\u0435 \u0441 \u043a\u043e\u043c\u043f\u043e\u0443\u0437\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/Compose#ultron-compose\" rel=\"noopener noreferrer nofollow\">wiki<\/a>.<\/p>\n<h2>Compose list operations<\/h2>\n<p><strong>Compose framework<\/strong><\/p>\n<pre><code class=\"kotlin\">val itemMatcher = hasText(contact.name) composeRule     .onNodeWithTag(contactsListTestTag)     .performScrollToNode(itemMatcher)     .onChildren()     .filterToOne(itemMatcher)     .assertTextContains(contact.name) <\/code><\/pre>\n<p><strong>Ultron<\/strong><\/p>\n<pre><code class=\"kotlin\">composeList(hasTestTag(contactsListTestTag))     .item(hasText(contact.name))     .assertTextContains(contact.name) <\/code><\/pre>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 LazyColumn\/LazyRow \u043e\u043f\u0438\u0441\u0430\u043d\u0430 <a href=\"https:\/\/github.com\/open-tool\/ultron\/wiki\/Compose#ultron-compose-lazycolumnlazyrow\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<h2>\u0421\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430<\/h2>\n<p>\u0427\u0435\u043c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432 \u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435?<br \/> \u0424\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 5 \u0441\u0435\u043a\u0443\u043d\u0434).<\/p>\n<pre><code class=\"kotlin\">UltronWrapperException::class.java, UltronException::class.java, PerformException::class.java, NoMatchingViewException::class.java, AssertionFailedError::class.java, RuntimeException::class.java <\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0438\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 UltronConfig, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &#8212; withTimeout(..) (\u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043d\u0438\u0436\u0435).<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435:<\/p>\n<h3>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/h3>\n<pre><code class=\"kotlin\">withId(R.id.last_event_status).withTimeout(10_000).isDisplayed() <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0430\u0439\u043c\u0430\u0443\u0442, \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f action \u0438\u043b\u0438 assertion \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 5 \u0441\u0435\u043a\u0443\u043d\u0434)<\/p>\n<p>\u0415\u0441\u0442\u044c 2 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430 withTimeout(..):<br \/> \u0423\u043a\u0430\u0436\u0438\u0442\u0435 withTimeout(..) \u0432 \u043c\u0435\u0441\u0442\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u044d\u0442\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c<\/p>\n<pre><code class=\"kotlin\">object SomePage : Page&lt;SomePage>() {     private val eventStatus = withId(R.id.last_event_status).withTimeout(10_000) } <\/code><\/pre>\n<p>\u0423\u043a\u0430\u0436\u0438\u0442\u0435 withTimeout(..) \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0430\u0433\u0430, \u0447\u0442\u043e\u0431\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"kotlin\">object SomePage : Page&lt;SomePage>() {     fun someLongUserStep(expectedEventText: String){          longRequestButton.click()          eventStatus.withTimeout(20_000).hasText(expectedEventText)     } } <\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 hasText(expectedEventText) \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c eventStatus \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f 20 \u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u043a\u0430 \u043e\u043d\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u0442 \u0443\u0441\u043f\u0435\u0445\u0430. \u0415\u0441\u043b\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 20 \u0441\u0435\u043a\u0443\u043d\u0434 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u0443\u0432\u0435\u043d\u0447\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0445\u043e\u043c, \u0442\u0435\u0441\u0442 \u0443\u043f\u0430\u0434\u0435\u0442 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439.<\/p>\n<h3>Boolean operation result<\/h3>\n<p>\u0412\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 isSuccess, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0432\u0438\u0434\u0435 boolean \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 false \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 isSuccess \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 5 \u0441\u0435\u043a\u0443\u043d\u0434). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0443\u043c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0442\u0430\u0439\u043c-\u0430\u0443\u0442 \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u043a\u0443\u043f\u0435 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 isSuccess.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"kotlin\">val isButtonDisplayed = withId(R.id.button).isSuccess { withTimeout(2_000).isDisplayed() } if (isButtonDisplayed) {     \/\/ \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f } <\/code><\/pre>\n<h3>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c\u0438 ViewActions \u0438 ViewAssertions<\/h3>\n<p>\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u044d\u0441\u043f\u0440\u0435\u0441\u0441\u043e Ultron \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 UltronEspressoInteraction. \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0432\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f kotlin, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<pre><code class=\"kotlin\">fun &lt;T> UltronEspressoInteraction&lt;T>.appendText(text: String) = apply {     executeAction(         operationBlock = getInteractionActionBlock(AppendTextAction(text)),         name = \"Append text '$text' to<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-391364","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/391364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=391364"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/391364\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=391364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=391364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=391364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}