diff --git a/404.html b/404.html index 9503bb406e..0aa4d88c62 100644 --- a/404.html +++ b/404.html @@ -11,13 +11,13 @@ - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/assets/js/0f6ee85b.48bb3dbc.js b/assets/js/0f6ee85b.e274100e.js similarity index 65% rename from assets/js/0f6ee85b.48bb3dbc.js rename to assets/js/0f6ee85b.e274100e.js index fafc576c37..f709b3e56e 100644 --- a/assets/js/0f6ee85b.48bb3dbc.js +++ b/assets/js/0f6ee85b.e274100e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7249],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>w});var a=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),p=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},b=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,l=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),d=p(n),b=i,w=d["".concat(s,".").concat(b)]||d[b]||m[b]||l;return n?a.createElement(w,r(r({ref:t},c),{},{components:n})):a.createElement(w,r({ref:t},c))}));function w(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var l=n.length,r=new Array(l);r[0]=b;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[d]="string"==typeof e?e:i,r[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>r,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var a=n(87462),i=(n(67294),n(3905));const l={},r="Web views",o={unversionedId:"api/webviews",id:"api/webviews",title:"Web views",description:"Detox supports testing web views on Android only. We are working on adding support for iOS apps as well.",source:"@site/../docs/api/webviews.md",sourceDirName:"api",slug:"/api/webviews",permalink:"/Detox/docs/next/api/webviews",draft:!1,editUrl:"https://github.com/wix/Detox/edit/master/docs/../docs/api/webviews.md",tags:[],version:"current",frontMatter:{},sidebar:"apiSidebar",previous:{title:"Expect",permalink:"/Detox/docs/next/api/expect"},next:{title:"Logger",permalink:"/Detox/docs/next/api/logger"}},s={},p=[{value:"Locating web view elements",id:"locating-web-view-elements",level:2},{value:"web.element(matcher)",id:"webelementmatcher",level:3},{value:"web(nativeMatcher).element(matcher)",id:"webnativematcherelementmatcher",level:3},{value:"Matchers",id:"matchers",level:2},{value:"by.web.id(id)",id:"bywebidid",level:3},{value:"by.web.className(className)",id:"bywebclassnameclassname",level:3},{value:"by.web.cssSelector(cssSelector)",id:"bywebcssselectorcssselector",level:3},{value:"by.web.name(name)",id:"bywebnamename",level:3},{value:"by.web.xpath(xpath)",id:"bywebxpathxpath",level:3},{value:"by.web.href(href)",id:"bywebhrefhref",level:3},{value:"by.web.hrefContains(href)",id:"bywebhrefcontainshref",level:3},{value:"by.web.tag(tag)",id:"bywebtagtag",level:3},{value:"atIndex(index)",id:"atindexindex",level:3},{value:"Actions",id:"actions",level:2},{value:"tap()",id:"tap",level:3},{value:"typeText(text[, isContentEditable])",id:"typetexttext-iscontenteditable",level:3},{value:"replaceText(text)",id:"replacetexttext",level:3},{value:"clearText()",id:"cleartext",level:3},{value:"selectAllText()",id:"selectalltext",level:3},{value:"getText()",id:"gettext",level:3},{value:"scrollToView()",id:"scrolltoview",level:3},{value:"focus()",id:"focus",level:3},{value:"moveCursorToEnd()",id:"movecursortoend",level:3},{value:"runScript(script[, args])",id:"runscriptscript-args",level:3},{value:"getCurrentUrl()",id:"getcurrenturl",level:3},{value:"getTitle()",id:"gettitle",level:3},{value:"Expectations",id:"expectations",level:2},{value:"toHaveText(text)",id:"tohavetexttext",level:3},{value:"toExist()",id:"toexist",level:3},{value:"not",id:"not",level:3}],c={toc:p},d="wrapper";function m(e){let{components:t,...n}=e;return(0,i.kt)(d,(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"web-views"},"Web views"),(0,i.kt)("admonition",{title:"Note",type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Detox supports testing web views on ",(0,i.kt)("strong",{parentName:"p"},"Android")," only. We are working on adding support for iOS apps as well.")),(0,i.kt)("p",null,"A web view is a native component that displays content not available in a native format, such as a web page or a PDF document."),(0,i.kt)("p",null,"Elements inside web views, however, are not native components, so Detox cannot interact with them the usual way.\nThat's why Detox provides a set of matchers, actions, and expectations to allow you to interact with the content inside web views."),(0,i.kt)("h2",{id:"locating-web-view-elements"},"Locating web view elements"),(0,i.kt)("h3",{id:"webelementmatcher"},(0,i.kt)("inlineCode",{parentName:"h3"},"web.element(matcher)")),(0,i.kt)("p",null,"In the most common case, you will have a single web view on the screen, so you can use ",(0,i.kt)("inlineCode",{parentName:"p"},"web.element()")," function with ",(0,i.kt)("a",{parentName:"p",href:"/Detox/docs/next/api/webviews#matchers"},"web view matchers")," to reference elements inside it. After you have a reference to a web element, you can use the ",(0,i.kt)("a",{parentName:"p",href:"/Detox/docs/next/api/webviews#actions"},"web view actions")," and ",(0,i.kt)("a",{parentName:"p",href:"/Detox/docs/next/api/webviews#expectations"},"web view expectations")," on it, e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const innerElement = web.element(by.web.id('inner_element_identifier'))\nawait expect(innerElement).toHaveText('Hello World!');\n")),(0,i.kt)("p",null,"The code above finds an inner element by HTML ",(0,i.kt)("inlineCode",{parentName:"p"},"id")," attribute, and expects it to have a specific text."),(0,i.kt)("h3",{id:"webnativematcherelementmatcher"},(0,i.kt)("inlineCode",{parentName:"h3"},"web(nativeMatcher).element(matcher)")),(0,i.kt)("p",null,"If you have multiple web views on the screen, you must locate a specific web view first by using a ",(0,i.kt)("a",{parentName:"p",href:"/Detox/docs/next/api/matchers"},"native matcher"),", e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const myWebView = web(by.id('webview_identifier'));\nconst innerElement = myWebView.element(by.web.id('inner_element_identifier'))\nawait expect(innerElement).toHaveText('Hello World!');\n")),(0,i.kt)("p",null,"In the example above:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"We use ",(0,i.kt)("inlineCode",{parentName:"li"},"web()")," function and ",(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/matchers#byidid"},(0,i.kt)("inlineCode",{parentName:"a"},"by.id()"))," matcher to locate a web view by its accessibility identifier."),(0,i.kt)("li",{parentName:"ol"},"We use ",(0,i.kt)("inlineCode",{parentName:"li"},"myWebView.element()")," method and ",(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebidid"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.id()"))," web matcher to find an HTML element inside that web view."),(0,i.kt)("li",{parentName:"ol"},"We run the same expectation (to have text) as in the previous example.")),(0,i.kt)("h2",{id:"matchers"},"Matchers"),(0,i.kt)("p",null,"Web view matchers are used to find elements within a web view:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebidid"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.id()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebclassnameclassname"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.className()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebcssselectorcssselector"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.cssSelector()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebnamename"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.name()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebxpathxpath"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.xpath()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebhrefhref"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.href()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebhrefcontainshref"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.hrefContains()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebtagtag"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.tag()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#atindexindex"},(0,i.kt)("inlineCode",{parentName:"a"},"atIndex()")))),(0,i.kt)("h3",{id:"bywebidid"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.id(id)")),(0,i.kt)("p",null,"Match elements with the specified accessibility identifier."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.id('identifier'));\n")),(0,i.kt)("h3",{id:"bywebclassnameclassname"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.className(className)")),(0,i.kt)("p",null,"Match elements with the specified CSS class name."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.className('className'));\n")),(0,i.kt)("h3",{id:"bywebcssselectorcssselector"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.cssSelector(cssSelector)")),(0,i.kt)("p",null,"Match elements with the specified CSS selector."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.cssSelector('#cssSelector'));\n")),(0,i.kt)("h3",{id:"bywebnamename"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.name(name)")),(0,i.kt)("p",null,"Match form input elements with the specified ",(0,i.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#name"},(0,i.kt)("inlineCode",{parentName:"a"},"name")," attribute"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.name('name'));\n")),(0,i.kt)("h3",{id:"bywebxpathxpath"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.xpath(xpath)")),(0,i.kt)("p",null,"Match elements with the specified XPath."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.xpath('//*[@id=\"testingh1-1\"]'));\n")),(0,i.kt)("h3",{id:"bywebhrefhref"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.href(href)")),(0,i.kt)("p",null,"Match elements with the specified ",(0,i.kt)("inlineCode",{parentName:"p"},"href"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.href('https://wix.com'));\n")),(0,i.kt)("h3",{id:"bywebhrefcontainshref"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.hrefContains(href)")),(0,i.kt)("p",null,"Match elements that contain the specified ",(0,i.kt)("inlineCode",{parentName:"p"},"href"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.hrefContains('wix'));\n")),(0,i.kt)("h3",{id:"bywebtagtag"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.tag(tag)")),(0,i.kt)("p",null,"Match elements with the specified tag."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.tag('h1'));\n")),(0,i.kt)("h3",{id:"atindexindex"},(0,i.kt)("inlineCode",{parentName:"h3"},"atIndex(index)")),(0,i.kt)("p",null,"Choose the element at the specified index."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.tag('h1').atIndex(1));\n")),(0,i.kt)("p",null,"Use it sparingly for those rare cases when you cannot make your matcher less ambiguous, so it returns one element only."),(0,i.kt)("h2",{id:"actions"},"Actions"),(0,i.kt)("p",null,"Web view actions are used to interact with elements within a web view:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#tap"},(0,i.kt)("inlineCode",{parentName:"a"},"tap()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#typetexttext-iscontenteditable"},(0,i.kt)("inlineCode",{parentName:"a"},"typeText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#replacetexttext"},(0,i.kt)("inlineCode",{parentName:"a"},"replaceText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#cleartext"},(0,i.kt)("inlineCode",{parentName:"a"},"clearText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#selectalltext"},(0,i.kt)("inlineCode",{parentName:"a"},"selectAllText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#gettext"},(0,i.kt)("inlineCode",{parentName:"a"},"getText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#scrolltoview"},(0,i.kt)("inlineCode",{parentName:"a"},"scrollToView()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#focus"},(0,i.kt)("inlineCode",{parentName:"a"},"focus()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#movecursortoend"},(0,i.kt)("inlineCode",{parentName:"a"},"moveCursorToEnd()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#runscriptscript"},(0,i.kt)("inlineCode",{parentName:"a"},"runScript()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#runscriptwithargsscript-args"},(0,i.kt)("inlineCode",{parentName:"a"},"runScriptWithArgs()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#getcurrenturl"},(0,i.kt)("inlineCode",{parentName:"a"},"getCurrentUrl()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#gettitle"},(0,i.kt)("inlineCode",{parentName:"a"},"getTitle()")))),(0,i.kt)("h3",{id:"tap"},(0,i.kt)("inlineCode",{parentName:"h3"},"tap()")),(0,i.kt)("p",null,"Tap the element."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).tap();\n")),(0,i.kt)("h3",{id:"typetexttext-iscontenteditable"},(0,i.kt)("inlineCode",{parentName:"h3"},"typeText(text[, isContentEditable])")),(0,i.kt)("p",null,"Type the specified text into the element."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"isContentEditable")," is an optional parameter that indicates whether the element should be a ",(0,i.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable"},"content-editable")," (",(0,i.kt)("inlineCode",{parentName:"p"},"contenteditable"),") element, and defaults to ",(0,i.kt)("inlineCode",{parentName:"p"},"false"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).typeText('Hello World!');\n")),(0,i.kt)("h3",{id:"replacetexttext"},(0,i.kt)("inlineCode",{parentName:"h3"},"replaceText(text)")),(0,i.kt)("p",null,"Replace the text of the element with the specified text."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This action is currently not supported for content-editable elements.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).replaceText('Hello World!');\n")),(0,i.kt)("h3",{id:"cleartext"},(0,i.kt)("inlineCode",{parentName:"h3"},"clearText()")),(0,i.kt)("p",null,"Clear the text of the element."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This action is currently not supported for content-editable elements.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).clearText();\n")),(0,i.kt)("h3",{id:"selectalltext"},(0,i.kt)("inlineCode",{parentName:"h3"},"selectAllText()")),(0,i.kt)("p",null,"Select all the text of the element."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This action is currently supported for content-editable elements only.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).selectAllText();\n")),(0,i.kt)("h3",{id:"gettext"},(0,i.kt)("inlineCode",{parentName:"h3"},"getText()")),(0,i.kt)("p",null,"Get the text of the element."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const text = await web.element(by.web.id('identifier')).getText();\n")),(0,i.kt)("h3",{id:"scrolltoview"},(0,i.kt)("inlineCode",{parentName:"h3"},"scrollToView()")),(0,i.kt)("p",null,"Scroll to the element until its top is at the top of the viewport."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).scrollToView();\n")),(0,i.kt)("h3",{id:"focus"},(0,i.kt)("inlineCode",{parentName:"h3"},"focus()")),(0,i.kt)("p",null,"Focus on the element."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).focus();\n")),(0,i.kt)("h3",{id:"movecursortoend"},(0,i.kt)("inlineCode",{parentName:"h3"},"moveCursorToEnd()")),(0,i.kt)("p",null,"Move the input cursor to the end of the element's content."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This action is currently supported for content-editable elements only.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).moveCursorToEnd();\n")),(0,i.kt)("h3",{id:"runscriptscript-args"},(0,i.kt)("inlineCode",{parentName:"h3"},"runScript(script[, args])")),(0,i.kt)("p",null,"Run the specified script on the element.\nThe script should be a string that contains a valid JavaScript function.\nIt will be called with that element as the first argument:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const webElement = web.element(by.web.id('identifier'));\nawait webElement.runScript('(el) => el.click()');\n")),(0,i.kt)("p",null,"For convenience, you can pass a function instead of a string, but please note that this will not work if the function uses any variables from the outer scope:"),(0,i.kt)("p",null,"The script can accept additional arguments and return a value. Make sure the values are primitive types or serializable objects, as they will be converted to JSON and back:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const text = await webElement.runScript(function get(element, property) {\n return element[property];\n}, ['textContent']);\n")),(0,i.kt)("h3",{id:"getcurrenturl"},(0,i.kt)("inlineCode",{parentName:"h3"},"getCurrentUrl()")),(0,i.kt)("p",null,"Get the current URL of the web view."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Although this action returns the URL of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const url = await web.element(by.web.id('identifier')).getCurrentUrl();\n")),(0,i.kt)("h3",{id:"gettitle"},(0,i.kt)("inlineCode",{parentName:"h3"},"getTitle()")),(0,i.kt)("p",null,"Get the title of the web view."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Although this action returns the title of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const title = await web.element(by.web.id('identifier')).getTitle();\n")),(0,i.kt)("h2",{id:"expectations"},"Expectations"),(0,i.kt)("p",null,"Web view expectations are used to assert the state of elements within a web view:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#tohavetexttext"},(0,i.kt)("inlineCode",{parentName:"a"},"toHaveText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#toexist"},(0,i.kt)("inlineCode",{parentName:"a"},"toExist()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#not"},(0,i.kt)("inlineCode",{parentName:"a"},"not")))),(0,i.kt)("h3",{id:"tohavetexttext"},(0,i.kt)("inlineCode",{parentName:"h3"},"toHaveText(text)")),(0,i.kt)("p",null,"Assert that the element has the specified text."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await expect(web.element(by.web.id('identifier'))).toHaveText('Hello World!');\n")),(0,i.kt)("h3",{id:"toexist"},(0,i.kt)("inlineCode",{parentName:"h3"},"toExist()")),(0,i.kt)("p",null,"Assert that the element exists."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await expect(web.element(by.web.id('identifier'))).toExist();\n")),(0,i.kt)("h3",{id:"not"},(0,i.kt)("inlineCode",{parentName:"h3"},"not")),(0,i.kt)("p",null,"Negate the expectation."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await expect(web.element(by.web.id('identifier'))).not.toHaveText('Hello World!');\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7249],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>w});var a=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=a.createContext({}),p=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},c=function(e){var t=p(e.components);return a.createElement(s.Provider,{value:t},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},b=a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,l=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),d=p(n),b=i,w=d["".concat(s,".").concat(b)]||d[b]||m[b]||l;return n?a.createElement(w,r(r({ref:t},c),{},{components:n})):a.createElement(w,r({ref:t},c))}));function w(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var l=n.length,r=new Array(l);r[0]=b;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[d]="string"==typeof e?e:i,r[1]=o;for(var p=2;p{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>r,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var a=n(87462),i=(n(67294),n(3905));const l={},r="Web views",o={unversionedId:"api/webviews",id:"api/webviews",title:"Web views",description:"Detox supports testing web views on Android only. We are working on adding support for iOS apps as well.",source:"@site/../docs/api/webviews.md",sourceDirName:"api",slug:"/api/webviews",permalink:"/Detox/docs/next/api/webviews",draft:!1,editUrl:"https://github.com/wix/Detox/edit/master/docs/../docs/api/webviews.md",tags:[],version:"current",frontMatter:{},sidebar:"apiSidebar",previous:{title:"Expect",permalink:"/Detox/docs/next/api/expect"},next:{title:"Logger",permalink:"/Detox/docs/next/api/logger"}},s={},p=[{value:"Locating web view elements",id:"locating-web-view-elements",level:2},{value:"web.element(matcher)",id:"webelementmatcher",level:3},{value:"web(nativeMatcher).element(matcher)",id:"webnativematcherelementmatcher",level:3},{value:"Matchers",id:"matchers",level:2},{value:"by.web.id(id)",id:"bywebidid",level:3},{value:"by.web.className(className)",id:"bywebclassnameclassname",level:3},{value:"by.web.cssSelector(cssSelector)",id:"bywebcssselectorcssselector",level:3},{value:"by.web.name(name)",id:"bywebnamename",level:3},{value:"by.web.xpath(xpath)",id:"bywebxpathxpath",level:3},{value:"by.web.href(href)",id:"bywebhrefhref",level:3},{value:"by.web.hrefContains(href)",id:"bywebhrefcontainshref",level:3},{value:"by.web.tag(tag)",id:"bywebtagtag",level:3},{value:"atIndex(index)",id:"atindexindex",level:3},{value:"Actions",id:"actions",level:2},{value:"tap()",id:"tap",level:3},{value:"typeText(text[, isContentEditable])",id:"typetexttext-iscontenteditable",level:3},{value:"replaceText(text)",id:"replacetexttext",level:3},{value:"clearText()",id:"cleartext",level:3},{value:"selectAllText()",id:"selectalltext",level:3},{value:"getText()",id:"gettext",level:3},{value:"scrollToView()",id:"scrolltoview",level:3},{value:"focus()",id:"focus",level:3},{value:"moveCursorToEnd()",id:"movecursortoend",level:3},{value:"runScript(script[, args])",id:"runscriptscript-args",level:3},{value:"getCurrentUrl()",id:"getcurrenturl",level:3},{value:"getTitle()",id:"gettitle",level:3},{value:"Expectations",id:"expectations",level:2},{value:"toHaveText(text)",id:"tohavetexttext",level:3},{value:"toExist()",id:"toexist",level:3},{value:"not",id:"not",level:3}],c={toc:p},d="wrapper";function m(e){let{components:t,...n}=e;return(0,i.kt)(d,(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"web-views"},"Web views"),(0,i.kt)("admonition",{title:"Note",type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Detox supports testing web views on ",(0,i.kt)("strong",{parentName:"p"},"Android")," only. We are working on adding support for iOS apps as well.")),(0,i.kt)("p",null,"A web view is a native component that displays content not available in a native format, such as a web page or a PDF document."),(0,i.kt)("p",null,"Elements inside web views, however, are not native components, so Detox cannot interact with them the usual way.\nThat's why Detox provides a set of matchers, actions, and expectations to allow you to interact with the content inside web views."),(0,i.kt)("h2",{id:"locating-web-view-elements"},"Locating web view elements"),(0,i.kt)("h3",{id:"webelementmatcher"},(0,i.kt)("inlineCode",{parentName:"h3"},"web.element(matcher)")),(0,i.kt)("p",null,"In the most common case, you will have a single web view on the screen, so you can use ",(0,i.kt)("inlineCode",{parentName:"p"},"web.element()")," function with ",(0,i.kt)("a",{parentName:"p",href:"/Detox/docs/next/api/webviews#matchers"},"web view matchers")," to reference elements inside it. After you have a reference to a web element, you can use the ",(0,i.kt)("a",{parentName:"p",href:"/Detox/docs/next/api/webviews#actions"},"web view actions")," and ",(0,i.kt)("a",{parentName:"p",href:"/Detox/docs/next/api/webviews#expectations"},"web view expectations")," on it, e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const innerElement = web.element(by.web.id('inner_element_identifier'))\nawait expect(innerElement).toHaveText('Hello World!');\n")),(0,i.kt)("p",null,"The code above finds an inner element by HTML ",(0,i.kt)("inlineCode",{parentName:"p"},"id")," attribute, and expects it to have a specific text."),(0,i.kt)("h3",{id:"webnativematcherelementmatcher"},(0,i.kt)("inlineCode",{parentName:"h3"},"web(nativeMatcher).element(matcher)")),(0,i.kt)("p",null,"If you have multiple web views on the screen, you must locate a specific web view first by using a ",(0,i.kt)("a",{parentName:"p",href:"/Detox/docs/next/api/matchers"},"native matcher"),", e.g.:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const myWebView = web(by.id('webview_identifier'));\nconst innerElement = myWebView.element(by.web.id('inner_element_identifier'))\nawait expect(innerElement).toHaveText('Hello World!');\n")),(0,i.kt)("p",null,"In the example above:"),(0,i.kt)("ol",null,(0,i.kt)("li",{parentName:"ol"},"We use ",(0,i.kt)("inlineCode",{parentName:"li"},"web()")," function and ",(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/matchers#byidid"},(0,i.kt)("inlineCode",{parentName:"a"},"by.id()"))," matcher to locate a web view by its accessibility identifier."),(0,i.kt)("li",{parentName:"ol"},"We use ",(0,i.kt)("inlineCode",{parentName:"li"},"myWebView.element()")," method and ",(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebidid"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.id()"))," web matcher to find an HTML element inside that web view."),(0,i.kt)("li",{parentName:"ol"},"We run the same expectation (to have text) as in the previous example.")),(0,i.kt)("h2",{id:"matchers"},"Matchers"),(0,i.kt)("p",null,"Web view matchers are used to find elements within a web view:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebidid"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.id()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebclassnameclassname"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.className()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebcssselectorcssselector"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.cssSelector()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebnamename"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.name()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebxpathxpath"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.xpath()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebhrefhref"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.href()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebhrefcontainshref"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.hrefContains()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#bywebtagtag"},(0,i.kt)("inlineCode",{parentName:"a"},"by.web.tag()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#atindexindex"},(0,i.kt)("inlineCode",{parentName:"a"},"atIndex()")))),(0,i.kt)("h3",{id:"bywebidid"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.id(id)")),(0,i.kt)("p",null,"Match elements with the specified accessibility identifier."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.id('identifier'));\n")),(0,i.kt)("h3",{id:"bywebclassnameclassname"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.className(className)")),(0,i.kt)("p",null,"Match elements with the specified CSS class name."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.className('className'));\n")),(0,i.kt)("h3",{id:"bywebcssselectorcssselector"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.cssSelector(cssSelector)")),(0,i.kt)("p",null,"Match elements with the specified CSS selector."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.cssSelector('#cssSelector'));\n")),(0,i.kt)("h3",{id:"bywebnamename"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.name(name)")),(0,i.kt)("p",null,"Match form input elements with the specified ",(0,i.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input#name"},(0,i.kt)("inlineCode",{parentName:"a"},"name")," attribute"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.name('name'));\n")),(0,i.kt)("h3",{id:"bywebxpathxpath"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.xpath(xpath)")),(0,i.kt)("p",null,"Match elements with the specified XPath."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.xpath('//*[@id=\"testingh1-1\"]'));\n")),(0,i.kt)("h3",{id:"bywebhrefhref"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.href(href)")),(0,i.kt)("p",null,"Match elements with the specified ",(0,i.kt)("inlineCode",{parentName:"p"},"href"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.href('https://wix.com'));\n")),(0,i.kt)("h3",{id:"bywebhrefcontainshref"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.hrefContains(href)")),(0,i.kt)("p",null,"Match elements that contain the specified ",(0,i.kt)("inlineCode",{parentName:"p"},"href"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.hrefContains('wix'));\n")),(0,i.kt)("h3",{id:"bywebtagtag"},(0,i.kt)("inlineCode",{parentName:"h3"},"by.web.tag(tag)")),(0,i.kt)("p",null,"Match elements with the specified tag."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.tag('h1'));\n")),(0,i.kt)("h3",{id:"atindexindex"},(0,i.kt)("inlineCode",{parentName:"h3"},"atIndex(index)")),(0,i.kt)("p",null,"Choose the element at the specified index."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"web.element(by.web.tag('h1').atIndex(1));\n")),(0,i.kt)("p",null,"Use it sparingly for those rare cases when you cannot make your matcher less ambiguous, so it returns one element only."),(0,i.kt)("h2",{id:"actions"},"Actions"),(0,i.kt)("p",null,"Web view actions are used to interact with elements within a web view:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#tap"},(0,i.kt)("inlineCode",{parentName:"a"},"tap()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#typetexttext-iscontenteditable"},(0,i.kt)("inlineCode",{parentName:"a"},"typeText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#replacetexttext"},(0,i.kt)("inlineCode",{parentName:"a"},"replaceText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#cleartext"},(0,i.kt)("inlineCode",{parentName:"a"},"clearText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#selectalltext"},(0,i.kt)("inlineCode",{parentName:"a"},"selectAllText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#gettext"},(0,i.kt)("inlineCode",{parentName:"a"},"getText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#scrolltoview"},(0,i.kt)("inlineCode",{parentName:"a"},"scrollToView()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#focus"},(0,i.kt)("inlineCode",{parentName:"a"},"focus()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#movecursortoend"},(0,i.kt)("inlineCode",{parentName:"a"},"moveCursorToEnd()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#runscriptscript-args"},(0,i.kt)("inlineCode",{parentName:"a"},"runScript()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#getcurrenturl"},(0,i.kt)("inlineCode",{parentName:"a"},"getCurrentUrl()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#gettitle"},(0,i.kt)("inlineCode",{parentName:"a"},"getTitle()")))),(0,i.kt)("h3",{id:"tap"},(0,i.kt)("inlineCode",{parentName:"h3"},"tap()")),(0,i.kt)("p",null,"Tap the element."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).tap();\n")),(0,i.kt)("h3",{id:"typetexttext-iscontenteditable"},(0,i.kt)("inlineCode",{parentName:"h3"},"typeText(text[, isContentEditable])")),(0,i.kt)("p",null,"Type the specified text into the element."),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"isContentEditable")," is an optional parameter that indicates whether the element should be a ",(0,i.kt)("a",{parentName:"p",href:"https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable"},"content-editable")," (",(0,i.kt)("inlineCode",{parentName:"p"},"contenteditable"),") element, and defaults to ",(0,i.kt)("inlineCode",{parentName:"p"},"false"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).typeText('Hello World!');\n")),(0,i.kt)("h3",{id:"replacetexttext"},(0,i.kt)("inlineCode",{parentName:"h3"},"replaceText(text)")),(0,i.kt)("p",null,"Replace the text of the element with the specified text."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This action is currently not supported for content-editable elements.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).replaceText('Hello World!');\n")),(0,i.kt)("h3",{id:"cleartext"},(0,i.kt)("inlineCode",{parentName:"h3"},"clearText()")),(0,i.kt)("p",null,"Clear the text of the element."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This action is currently not supported for content-editable elements.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).clearText();\n")),(0,i.kt)("h3",{id:"selectalltext"},(0,i.kt)("inlineCode",{parentName:"h3"},"selectAllText()")),(0,i.kt)("p",null,"Select all the text of the element."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This action is currently supported for content-editable elements only.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).selectAllText();\n")),(0,i.kt)("h3",{id:"gettext"},(0,i.kt)("inlineCode",{parentName:"h3"},"getText()")),(0,i.kt)("p",null,"Get the text of the element."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const text = await web.element(by.web.id('identifier')).getText();\n")),(0,i.kt)("h3",{id:"scrolltoview"},(0,i.kt)("inlineCode",{parentName:"h3"},"scrollToView()")),(0,i.kt)("p",null,"Scroll to the element until its top is at the top of the viewport."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).scrollToView();\n")),(0,i.kt)("h3",{id:"focus"},(0,i.kt)("inlineCode",{parentName:"h3"},"focus()")),(0,i.kt)("p",null,"Focus on the element."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).focus();\n")),(0,i.kt)("h3",{id:"movecursortoend"},(0,i.kt)("inlineCode",{parentName:"h3"},"moveCursorToEnd()")),(0,i.kt)("p",null,"Move the input cursor to the end of the element's content."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"This action is currently supported for content-editable elements only.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await web.element(by.web.id('identifier')).moveCursorToEnd();\n")),(0,i.kt)("h3",{id:"runscriptscript-args"},(0,i.kt)("inlineCode",{parentName:"h3"},"runScript(script[, args])")),(0,i.kt)("p",null,"Run the specified script on the element.\nThe script should be a string that contains a valid JavaScript function.\nIt will be called with that element as the first argument:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const webElement = web.element(by.web.id('identifier'));\nawait webElement.runScript('(el) => el.click()');\n")),(0,i.kt)("p",null,"For convenience, you can pass a function instead of a string, but please note that this will not work if the function uses any variables from the outer scope:"),(0,i.kt)("p",null,"The script can accept additional arguments and return a value. Make sure the values are primitive types or serializable objects, as they will be converted to JSON and back:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const text = await webElement.runScript(function get(element, property) {\n return element[property];\n}, ['textContent']);\n")),(0,i.kt)("h3",{id:"getcurrenturl"},(0,i.kt)("inlineCode",{parentName:"h3"},"getCurrentUrl()")),(0,i.kt)("p",null,"Get the current URL of the web view."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Although this action returns the URL of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const url = await web.element(by.web.id('identifier')).getCurrentUrl();\n")),(0,i.kt)("h3",{id:"gettitle"},(0,i.kt)("inlineCode",{parentName:"h3"},"getTitle()")),(0,i.kt)("p",null,"Get the title of the web view."),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"Although this action returns the title of the presented web document, it can be called from an inner element only (for example, an iframe id or the HTML) and not from the root native web view element itself.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"const title = await web.element(by.web.id('identifier')).getTitle();\n")),(0,i.kt)("h2",{id:"expectations"},"Expectations"),(0,i.kt)("p",null,"Web view expectations are used to assert the state of elements within a web view:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#tohavetexttext"},(0,i.kt)("inlineCode",{parentName:"a"},"toHaveText()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#toexist"},(0,i.kt)("inlineCode",{parentName:"a"},"toExist()"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/Detox/docs/next/api/webviews#not"},(0,i.kt)("inlineCode",{parentName:"a"},"not")))),(0,i.kt)("h3",{id:"tohavetexttext"},(0,i.kt)("inlineCode",{parentName:"h3"},"toHaveText(text)")),(0,i.kt)("p",null,"Assert that the element has the specified text."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await expect(web.element(by.web.id('identifier'))).toHaveText('Hello World!');\n")),(0,i.kt)("h3",{id:"toexist"},(0,i.kt)("inlineCode",{parentName:"h3"},"toExist()")),(0,i.kt)("p",null,"Assert that the element exists."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await expect(web.element(by.web.id('identifier'))).toExist();\n")),(0,i.kt)("h3",{id:"not"},(0,i.kt)("inlineCode",{parentName:"h3"},"not")),(0,i.kt)("p",null,"Negate the expectation."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-js"},"await expect(web.element(by.web.id('identifier'))).not.toHaveText('Hello World!');\n")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.2248b487.js b/assets/js/runtime~main.32104673.js similarity index 99% rename from assets/js/runtime~main.2248b487.js rename to assets/js/runtime~main.32104673.js index 747582b48a..1ae0fcdf68 100644 --- a/assets/js/runtime~main.2248b487.js +++ b/assets/js/runtime~main.32104673.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,c,f,d,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=b,e=[],r.O=(a,c,f,d)=>{if(!c){var b=1/0;for(i=0;i=d)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[c,f,d]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var d=Object.create(null);r.r(d);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&f&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(d,b),d},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({33:"b49de2ad",38:"a55aca30",53:"935f2afb",101:"00424e3f",161:"e8bfc54f",242:"865d1447",252:"684e0aea",272:"04d1378b",331:"181d712d",378:"f98b7248",486:"af67069a",511:"19ee85cd",535:"0c7edd3c",572:"8ab53c77",629:"b80a1ac9",656:"1a01fdf1",683:"9a34b858",694:"398b3246",718:"04c33c1d",779:"7accbb75",804:"5eff386f",891:"ddab1e1f",962:"933bed1e",981:"a8a1de49",1056:"e6bddadc",1131:"2dcc617a",1175:"2ec4e639",1203:"ddb15f76",1244:"6e1398c4",1298:"0ef19a76",1452:"bab8a798",1545:"e6cdcb35",1665:"af558054",1688:"3fb5a56d",1728:"170ab94c",1774:"74a579df",1882:"e9d07a0a",1906:"37fdb427",1908:"d389a7b2",1993:"50214cd4",2028:"120e2fab",2159:"d9683343",2179:"bc243f9c",2232:"c262e01e",2240:"5fcf77d7",2314:"9292650b",2392:"743699a6",2393:"cae448e5",2409:"9a6ca8b8",2415:"f9078c13",2428:"54c48e38",2492:"3e7ee0fc",2508:"289d965c",2535:"814f3328",2559:"fa42474c",2560:"f431fa1f",2589:"b1c3f2c7",2614:"24602229",2627:"7b8d824d",2630:"b48043f7",2796:"5e26652b",2826:"ea7b1b31",2849:"e237dedf",2873:"0a02aff3",3012:"f97fefc4",3038:"66c89031",3089:"a6aa9e1f",3257:"7d2f6bd9",3382:"fc9f0a8f",3418:"41e12717",3524:"239f6efa",3560:"f2f4b8a7",3573:"4c76b531",3599:"dc701447",3608:"9e4087bc",3652:"8f43d633",3685:"32a9b7bf",3686:"5bfbde57",3928:"2d84255a",4013:"01a85c17",4060:"7358fe14",4100:"0e97a833",4119:"17f9232f",4161:"df5bc064",4195:"c4f5d8e4",4201:"3498d2db",4217:"cb38042d",4223:"373c35af",4274:"5fc994c2",4296:"a32fb7f5",4357:"b6072cb9",4381:"3b089002",4384:"dcfd3b61",4514:"85addd09",4537:"3abc4359",4647:"86a9c212",4749:"268dddcf",4786:"649c4fa3",4806:"5d2f6d16",4836:"ea9c95e7",4878:"c8447d5b",4938:"3974811d",4943:"f14c3b1d",5135:"a622d695",5202:"9eb50243",5237:"45e366b7",5299:"7c97e9a2",5482:"0b72a6ff",5494:"66491fb6",5495:"d9894068",5716:"121cced5",5844:"fc323215",5994:"1c545b73",6040:"30a967f3",6068:"4898f926",6096:"861bdbb6",6103:"ccc49370",6108:"90ca9965",6190:"ba1e31c2",6271:"df8c2417",6320:"3f859f05",6326:"3d4c33f6",6327:"c83bcda6",6367:"4e8770ad",6383:"96997528",6474:"af952e90",6567:"6fb4057b",6587:"5bc90040",6630:"85a74db3",6711:"5133b137",6724:"851303a1",6881:"40e30cb7",6933:"8e7c33d6",6945:"3f50474f",6961:"23a61782",6978:"79ac7843",7051:"d0f64c9c",7061:"5125c427",7185:"a4761f6f",7249:"0f6ee85b",7250:"f6b2bbb1",7295:"5a9cd6fb",7334:"48c4a2a0",7373:"e453af6e",7478:"0970ca0c",7586:"0b851b4d",7734:"0d1d5dba",7760:"c12557ec",7762:"26368098",7766:"80f9953e",7773:"df0b489b",7811:"06556991",7816:"d350cff3",7857:"656a21b7",7893:"4afa4b8a",7911:"9b67fd78",7918:"17896441",7920:"1a4e3797",7940:"5b12c1a9",8009:"cd796466",8022:"c74a7097",8198:"a6860cb2",8201:"7a99341f",8286:"c7632c1f",8360:"dbe4f0b7",8369:"4a184f52",8382:"ecfe08ed",8421:"1d245f66",8521:"f02f7df4",8545:"9509e94f",8552:"20110cf9",8554:"eb35abdd",8577:"6af18994",8602:"9338ecde",8610:"6875c492",8627:"1c323773",8664:"3bc305d8",8763:"40113ee6",8788:"4aba33e7",8814:"c62bfd53",8854:"6781c826",8875:"2cf03b61",8883:"ae694851",8887:"1373a77b",8928:"e432d2f9",8952:"0a2b2829",9167:"85c7de33",9182:"7dcc0419",9319:"7c823085",9358:"9017a355",9455:"3f3efe2b",9597:"ef7da448",9617:"b9d5de69",9651:"dd5377a3",9737:"f164116d",9775:"329947da",9780:"38bf2aac",9831:"beec6c9a",9906:"881ac13d"}[e]||e)+"."+{33:"73ae903e",38:"385f4c83",53:"0192e000",101:"b3bcd00f",161:"b86dac46",242:"c18fda4c",252:"d9371cc1",272:"503b1a35",331:"4d7707ad",378:"bc2bb882",486:"d1e60930",511:"86403847",535:"f0e90ed0",572:"cbb3fa27",629:"9b57142f",656:"b5e55309",683:"5a3562dd",694:"e3816650",718:"59159a34",779:"0fa4c644",804:"cc0fda29",891:"a0161fb6",962:"89ed8752",981:"0cb9c6ce",1056:"b1373cd4",1131:"385bb394",1175:"eacb4943",1203:"1b16c174",1244:"507dd01c",1298:"ccde7a82",1426:"d17dece3",1452:"98f11408",1545:"ab303487",1580:"d8db51bd",1665:"3508c247",1688:"dd8d67d3",1728:"a8f9ee85",1774:"e2c47a11",1882:"ba1dc1e5",1906:"81d6e362",1908:"b27c7b4f",1993:"971d24a9",2028:"13f39980",2159:"3d406ae8",2179:"e65922be",2232:"7752dceb",2240:"2227f784",2314:"c04566ef",2392:"7b6877db",2393:"4fdefac7",2403:"4dc445fe",2409:"2edfbf34",2415:"4ec988fe",2428:"614da151",2492:"e24bc7b8",2508:"971df1b9",2535:"9311db57",2559:"83eefb6e",2560:"65fc0fb8",2589:"e3471f17",2614:"39a0ff3f",2627:"9ab8e460",2630:"22866cdf",2796:"8b75a93e",2826:"f2c457d0",2849:"14ea00f7",2873:"2a3b1eb5",3012:"ec427960",3038:"99f5f57f",3089:"1243819c",3257:"f66de1f7",3382:"6fb92f73",3418:"d26189d0",3473:"6bdd7223",3524:"e0d8a0f6",3560:"40c155ec",3573:"6e265254",3599:"5ed167db",3608:"68f4c250",3652:"22349c86",3685:"246c83be",3686:"b35b5d26",3928:"4aa6542d",3969:"e132a487",4013:"61a6096c",4060:"6176a771",4100:"13128271",4119:"ede4867d",4161:"19d2d5cc",4195:"05eca37d",4201:"a29410ce",4217:"ca76cbfa",4223:"e800dc7f",4274:"0ac89feb",4296:"4e70f83a",4357:"6343002b",4381:"ecca1acb",4384:"ee2b16f3",4514:"ea3d39fd",4537:"377e0160",4647:"d84584ba",4749:"a3abf543",4786:"f001d724",4806:"676863cd",4836:"37257a08",4878:"83d8ab3d",4938:"b383af98",4943:"283f6532",4972:"07c42fc3",5135:"cab7f678",5202:"9cb88865",5237:"89557f30",5299:"ad74049e",5482:"eafa0dab",5494:"62b25014",5495:"42c58a86",5716:"acb49535",5844:"ba42da5a",5994:"ac283a51",6040:"9fe21dcb",6048:"402a0ca7",6068:"c15bcc93",6096:"6bdcc5bd",6103:"fad14a28",6108:"ec572d77",6190:"4738e799",6271:"a618c3e6",6320:"08969d6d",6326:"5e7944d0",6327:"43d5043d",6367:"f9123020",6383:"0b4fcd48",6474:"80125f14",6567:"61f447ba",6587:"ffa7f04e",6630:"3c1bf55c",6711:"fd2f3a7d",6724:"e757283f",6881:"1cb5156f",6933:"eb5f2f68",6945:"f70d9518",6961:"6cc8e770",6978:"a2ee5080",7051:"2b7e1e7c",7061:"4dde8e4b",7185:"83588798",7249:"48bb3dbc",7250:"3e57d7fd",7295:"117c438f",7334:"26941f98",7373:"2dc8f9fc",7478:"71bdd71b",7586:"20c86fcf",7734:"a666d0c0",7760:"670c8d36",7762:"883e2b98",7766:"c0185c4e",7773:"44c9f2ad",7811:"6e2355c1",7816:"85e0eb04",7857:"39cd2145",7893:"c5d16bc0",7911:"1b02ca79",7918:"27cba3cb",7920:"2166bf45",7940:"70fe5173",8009:"14f0e0dc",8022:"dd3c04f1",8198:"6639f4a9",8201:"b5245fe7",8286:"27a76a34",8360:"8b1c2a87",8369:"39a678c8",8382:"17dd7219",8421:"d2c220bf",8521:"5574577c",8545:"e83b1184",8552:"796e3c9e",8554:"ee46a43f",8577:"f26a358f",8602:"864835f8",8610:"f84432d4",8627:"355432ec",8664:"7f7e6b56",8763:"d476d9de",8788:"057e8887",8814:"37e0f070",8854:"06d960cc",8875:"7d7bda0a",8883:"cb6f7bf4",8887:"c8e0f087",8894:"b9f31e33",8928:"b881975c",8952:"bc548627",9167:"a78fac8a",9182:"e1b89be3",9319:"85890eaa",9358:"f7ff43be",9455:"a1ac6b33",9597:"ae383c78",9617:"33110098",9651:"cdef229e",9737:"7ec930cf",9775:"bb785b65",9780:"e6d4f268",9831:"5658b454",9906:"b9ce65a8"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},d="website:",r.l=(e,a,c,b)=>{if(f[e])f[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var d=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),d&&d.forEach((e=>e(c))),a)return a(c)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/Detox/",r.gca=function(e){return e={17896441:"7918",24602229:"2614",26368098:"7762",96997528:"6383",b49de2ad:"33",a55aca30:"38","935f2afb":"53","00424e3f":"101",e8bfc54f:"161","865d1447":"242","684e0aea":"252","04d1378b":"272","181d712d":"331",f98b7248:"378",af67069a:"486","19ee85cd":"511","0c7edd3c":"535","8ab53c77":"572",b80a1ac9:"629","1a01fdf1":"656","9a34b858":"683","398b3246":"694","04c33c1d":"718","7accbb75":"779","5eff386f":"804",ddab1e1f:"891","933bed1e":"962",a8a1de49:"981",e6bddadc:"1056","2dcc617a":"1131","2ec4e639":"1175",ddb15f76:"1203","6e1398c4":"1244","0ef19a76":"1298",bab8a798:"1452",e6cdcb35:"1545",af558054:"1665","3fb5a56d":"1688","170ab94c":"1728","74a579df":"1774",e9d07a0a:"1882","37fdb427":"1906",d389a7b2:"1908","50214cd4":"1993","120e2fab":"2028",d9683343:"2159",bc243f9c:"2179",c262e01e:"2232","5fcf77d7":"2240","9292650b":"2314","743699a6":"2392",cae448e5:"2393","9a6ca8b8":"2409",f9078c13:"2415","54c48e38":"2428","3e7ee0fc":"2492","289d965c":"2508","814f3328":"2535",fa42474c:"2559",f431fa1f:"2560",b1c3f2c7:"2589","7b8d824d":"2627",b48043f7:"2630","5e26652b":"2796",ea7b1b31:"2826",e237dedf:"2849","0a02aff3":"2873",f97fefc4:"3012","66c89031":"3038",a6aa9e1f:"3089","7d2f6bd9":"3257",fc9f0a8f:"3382","41e12717":"3418","239f6efa":"3524",f2f4b8a7:"3560","4c76b531":"3573",dc701447:"3599","9e4087bc":"3608","8f43d633":"3652","32a9b7bf":"3685","5bfbde57":"3686","2d84255a":"3928","01a85c17":"4013","7358fe14":"4060","0e97a833":"4100","17f9232f":"4119",df5bc064:"4161",c4f5d8e4:"4195","3498d2db":"4201",cb38042d:"4217","373c35af":"4223","5fc994c2":"4274",a32fb7f5:"4296",b6072cb9:"4357","3b089002":"4381",dcfd3b61:"4384","85addd09":"4514","3abc4359":"4537","86a9c212":"4647","268dddcf":"4749","649c4fa3":"4786","5d2f6d16":"4806",ea9c95e7:"4836",c8447d5b:"4878","3974811d":"4938",f14c3b1d:"4943",a622d695:"5135","9eb50243":"5202","45e366b7":"5237","7c97e9a2":"5299","0b72a6ff":"5482","66491fb6":"5494",d9894068:"5495","121cced5":"5716",fc323215:"5844","1c545b73":"5994","30a967f3":"6040","4898f926":"6068","861bdbb6":"6096",ccc49370:"6103","90ca9965":"6108",ba1e31c2:"6190",df8c2417:"6271","3f859f05":"6320","3d4c33f6":"6326",c83bcda6:"6327","4e8770ad":"6367",af952e90:"6474","6fb4057b":"6567","5bc90040":"6587","85a74db3":"6630","5133b137":"6711","851303a1":"6724","40e30cb7":"6881","8e7c33d6":"6933","3f50474f":"6945","23a61782":"6961","79ac7843":"6978",d0f64c9c:"7051","5125c427":"7061",a4761f6f:"7185","0f6ee85b":"7249",f6b2bbb1:"7250","5a9cd6fb":"7295","48c4a2a0":"7334",e453af6e:"7373","0970ca0c":"7478","0b851b4d":"7586","0d1d5dba":"7734",c12557ec:"7760","80f9953e":"7766",df0b489b:"7773","06556991":"7811",d350cff3:"7816","656a21b7":"7857","4afa4b8a":"7893","9b67fd78":"7911","1a4e3797":"7920","5b12c1a9":"7940",cd796466:"8009",c74a7097:"8022",a6860cb2:"8198","7a99341f":"8201",c7632c1f:"8286",dbe4f0b7:"8360","4a184f52":"8369",ecfe08ed:"8382","1d245f66":"8421",f02f7df4:"8521","9509e94f":"8545","20110cf9":"8552",eb35abdd:"8554","6af18994":"8577","9338ecde":"8602","6875c492":"8610","1c323773":"8627","3bc305d8":"8664","40113ee6":"8763","4aba33e7":"8788",c62bfd53:"8814","6781c826":"8854","2cf03b61":"8875",ae694851:"8883","1373a77b":"8887",e432d2f9:"8928","0a2b2829":"8952","85c7de33":"9167","7dcc0419":"9182","7c823085":"9319","9017a355":"9358","3f3efe2b":"9455",ef7da448:"9597",b9d5de69:"9617",dd5377a3:"9651",f164116d:"9737","329947da":"9775","38bf2aac":"9780",beec6c9a:"9831","881ac13d":"9906"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var f=r.o(e,a)?e[a]:void 0;if(0!==f)if(f)c.push(f[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var d=new Promise(((c,d)=>f=e[a]=[c,d]));c.push(f[2]=d);var b=r.p+r.u(a),t=new Error;r.l(b,(c=>{if(r.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var d=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+d+": "+b+")",t.name="ChunkLoadError",t.type=d,t.request=b,f[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var f,d,b=c[0],t=c[1],o=c[2],n=0;if(b.some((a=>0!==e[a]))){for(f in t)r.o(t,f)&&(r.m[f]=t[f]);if(o)var i=o(r)}for(a&&a(c);n{"use strict";var e,a,c,f,d,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=b,e=[],r.O=(a,c,f,d)=>{if(!c){var b=1/0;for(i=0;i=d)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[c,f,d]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,f){if(1&f&&(e=this(e)),8&f)return e;if("object"==typeof e&&e){if(4&f&&e.__esModule)return e;if(16&f&&"function"==typeof e.then)return e}var d=Object.create(null);r.r(d);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&f&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(d,b),d},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({33:"b49de2ad",38:"a55aca30",53:"935f2afb",101:"00424e3f",161:"e8bfc54f",242:"865d1447",252:"684e0aea",272:"04d1378b",331:"181d712d",378:"f98b7248",486:"af67069a",511:"19ee85cd",535:"0c7edd3c",572:"8ab53c77",629:"b80a1ac9",656:"1a01fdf1",683:"9a34b858",694:"398b3246",718:"04c33c1d",779:"7accbb75",804:"5eff386f",891:"ddab1e1f",962:"933bed1e",981:"a8a1de49",1056:"e6bddadc",1131:"2dcc617a",1175:"2ec4e639",1203:"ddb15f76",1244:"6e1398c4",1298:"0ef19a76",1452:"bab8a798",1545:"e6cdcb35",1665:"af558054",1688:"3fb5a56d",1728:"170ab94c",1774:"74a579df",1882:"e9d07a0a",1906:"37fdb427",1908:"d389a7b2",1993:"50214cd4",2028:"120e2fab",2159:"d9683343",2179:"bc243f9c",2232:"c262e01e",2240:"5fcf77d7",2314:"9292650b",2392:"743699a6",2393:"cae448e5",2409:"9a6ca8b8",2415:"f9078c13",2428:"54c48e38",2492:"3e7ee0fc",2508:"289d965c",2535:"814f3328",2559:"fa42474c",2560:"f431fa1f",2589:"b1c3f2c7",2614:"24602229",2627:"7b8d824d",2630:"b48043f7",2796:"5e26652b",2826:"ea7b1b31",2849:"e237dedf",2873:"0a02aff3",3012:"f97fefc4",3038:"66c89031",3089:"a6aa9e1f",3257:"7d2f6bd9",3382:"fc9f0a8f",3418:"41e12717",3524:"239f6efa",3560:"f2f4b8a7",3573:"4c76b531",3599:"dc701447",3608:"9e4087bc",3652:"8f43d633",3685:"32a9b7bf",3686:"5bfbde57",3928:"2d84255a",4013:"01a85c17",4060:"7358fe14",4100:"0e97a833",4119:"17f9232f",4161:"df5bc064",4195:"c4f5d8e4",4201:"3498d2db",4217:"cb38042d",4223:"373c35af",4274:"5fc994c2",4296:"a32fb7f5",4357:"b6072cb9",4381:"3b089002",4384:"dcfd3b61",4514:"85addd09",4537:"3abc4359",4647:"86a9c212",4749:"268dddcf",4786:"649c4fa3",4806:"5d2f6d16",4836:"ea9c95e7",4878:"c8447d5b",4938:"3974811d",4943:"f14c3b1d",5135:"a622d695",5202:"9eb50243",5237:"45e366b7",5299:"7c97e9a2",5482:"0b72a6ff",5494:"66491fb6",5495:"d9894068",5716:"121cced5",5844:"fc323215",5994:"1c545b73",6040:"30a967f3",6068:"4898f926",6096:"861bdbb6",6103:"ccc49370",6108:"90ca9965",6190:"ba1e31c2",6271:"df8c2417",6320:"3f859f05",6326:"3d4c33f6",6327:"c83bcda6",6367:"4e8770ad",6383:"96997528",6474:"af952e90",6567:"6fb4057b",6587:"5bc90040",6630:"85a74db3",6711:"5133b137",6724:"851303a1",6881:"40e30cb7",6933:"8e7c33d6",6945:"3f50474f",6961:"23a61782",6978:"79ac7843",7051:"d0f64c9c",7061:"5125c427",7185:"a4761f6f",7249:"0f6ee85b",7250:"f6b2bbb1",7295:"5a9cd6fb",7334:"48c4a2a0",7373:"e453af6e",7478:"0970ca0c",7586:"0b851b4d",7734:"0d1d5dba",7760:"c12557ec",7762:"26368098",7766:"80f9953e",7773:"df0b489b",7811:"06556991",7816:"d350cff3",7857:"656a21b7",7893:"4afa4b8a",7911:"9b67fd78",7918:"17896441",7920:"1a4e3797",7940:"5b12c1a9",8009:"cd796466",8022:"c74a7097",8198:"a6860cb2",8201:"7a99341f",8286:"c7632c1f",8360:"dbe4f0b7",8369:"4a184f52",8382:"ecfe08ed",8421:"1d245f66",8521:"f02f7df4",8545:"9509e94f",8552:"20110cf9",8554:"eb35abdd",8577:"6af18994",8602:"9338ecde",8610:"6875c492",8627:"1c323773",8664:"3bc305d8",8763:"40113ee6",8788:"4aba33e7",8814:"c62bfd53",8854:"6781c826",8875:"2cf03b61",8883:"ae694851",8887:"1373a77b",8928:"e432d2f9",8952:"0a2b2829",9167:"85c7de33",9182:"7dcc0419",9319:"7c823085",9358:"9017a355",9455:"3f3efe2b",9597:"ef7da448",9617:"b9d5de69",9651:"dd5377a3",9737:"f164116d",9775:"329947da",9780:"38bf2aac",9831:"beec6c9a",9906:"881ac13d"}[e]||e)+"."+{33:"73ae903e",38:"385f4c83",53:"0192e000",101:"b3bcd00f",161:"b86dac46",242:"c18fda4c",252:"d9371cc1",272:"503b1a35",331:"4d7707ad",378:"bc2bb882",486:"d1e60930",511:"86403847",535:"f0e90ed0",572:"cbb3fa27",629:"9b57142f",656:"b5e55309",683:"5a3562dd",694:"e3816650",718:"59159a34",779:"0fa4c644",804:"cc0fda29",891:"a0161fb6",962:"89ed8752",981:"0cb9c6ce",1056:"b1373cd4",1131:"385bb394",1175:"eacb4943",1203:"1b16c174",1244:"507dd01c",1298:"ccde7a82",1426:"d17dece3",1452:"98f11408",1545:"ab303487",1580:"d8db51bd",1665:"3508c247",1688:"dd8d67d3",1728:"a8f9ee85",1774:"e2c47a11",1882:"ba1dc1e5",1906:"81d6e362",1908:"b27c7b4f",1993:"971d24a9",2028:"13f39980",2159:"3d406ae8",2179:"e65922be",2232:"7752dceb",2240:"2227f784",2314:"c04566ef",2392:"7b6877db",2393:"4fdefac7",2403:"4dc445fe",2409:"2edfbf34",2415:"4ec988fe",2428:"614da151",2492:"e24bc7b8",2508:"971df1b9",2535:"9311db57",2559:"83eefb6e",2560:"65fc0fb8",2589:"e3471f17",2614:"39a0ff3f",2627:"9ab8e460",2630:"22866cdf",2796:"8b75a93e",2826:"f2c457d0",2849:"14ea00f7",2873:"2a3b1eb5",3012:"ec427960",3038:"99f5f57f",3089:"1243819c",3257:"f66de1f7",3382:"6fb92f73",3418:"d26189d0",3473:"6bdd7223",3524:"e0d8a0f6",3560:"40c155ec",3573:"6e265254",3599:"5ed167db",3608:"68f4c250",3652:"22349c86",3685:"246c83be",3686:"b35b5d26",3928:"4aa6542d",3969:"e132a487",4013:"61a6096c",4060:"6176a771",4100:"13128271",4119:"ede4867d",4161:"19d2d5cc",4195:"05eca37d",4201:"a29410ce",4217:"ca76cbfa",4223:"e800dc7f",4274:"0ac89feb",4296:"4e70f83a",4357:"6343002b",4381:"ecca1acb",4384:"ee2b16f3",4514:"ea3d39fd",4537:"377e0160",4647:"d84584ba",4749:"a3abf543",4786:"f001d724",4806:"676863cd",4836:"37257a08",4878:"83d8ab3d",4938:"b383af98",4943:"283f6532",4972:"07c42fc3",5135:"cab7f678",5202:"9cb88865",5237:"89557f30",5299:"ad74049e",5482:"eafa0dab",5494:"62b25014",5495:"42c58a86",5716:"acb49535",5844:"ba42da5a",5994:"ac283a51",6040:"9fe21dcb",6048:"402a0ca7",6068:"c15bcc93",6096:"6bdcc5bd",6103:"fad14a28",6108:"ec572d77",6190:"4738e799",6271:"a618c3e6",6320:"08969d6d",6326:"5e7944d0",6327:"43d5043d",6367:"f9123020",6383:"0b4fcd48",6474:"80125f14",6567:"61f447ba",6587:"ffa7f04e",6630:"3c1bf55c",6711:"fd2f3a7d",6724:"e757283f",6881:"1cb5156f",6933:"eb5f2f68",6945:"f70d9518",6961:"6cc8e770",6978:"a2ee5080",7051:"2b7e1e7c",7061:"4dde8e4b",7185:"83588798",7249:"e274100e",7250:"3e57d7fd",7295:"117c438f",7334:"26941f98",7373:"2dc8f9fc",7478:"71bdd71b",7586:"20c86fcf",7734:"a666d0c0",7760:"670c8d36",7762:"883e2b98",7766:"c0185c4e",7773:"44c9f2ad",7811:"6e2355c1",7816:"85e0eb04",7857:"39cd2145",7893:"c5d16bc0",7911:"1b02ca79",7918:"27cba3cb",7920:"2166bf45",7940:"70fe5173",8009:"14f0e0dc",8022:"dd3c04f1",8198:"6639f4a9",8201:"b5245fe7",8286:"27a76a34",8360:"8b1c2a87",8369:"39a678c8",8382:"17dd7219",8421:"d2c220bf",8521:"5574577c",8545:"e83b1184",8552:"796e3c9e",8554:"ee46a43f",8577:"f26a358f",8602:"864835f8",8610:"f84432d4",8627:"355432ec",8664:"7f7e6b56",8763:"d476d9de",8788:"057e8887",8814:"37e0f070",8854:"06d960cc",8875:"7d7bda0a",8883:"cb6f7bf4",8887:"c8e0f087",8894:"b9f31e33",8928:"b881975c",8952:"bc548627",9167:"a78fac8a",9182:"e1b89be3",9319:"85890eaa",9358:"f7ff43be",9455:"a1ac6b33",9597:"ae383c78",9617:"33110098",9651:"cdef229e",9737:"7ec930cf",9775:"bb785b65",9780:"e6d4f268",9831:"5658b454",9906:"b9ce65a8"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),f={},d="website:",r.l=(e,a,c,b)=>{if(f[e])f[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var d=f[e];if(delete f[e],t.parentNode&&t.parentNode.removeChild(t),d&&d.forEach((e=>e(c))),a)return a(c)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/Detox/",r.gca=function(e){return e={17896441:"7918",24602229:"2614",26368098:"7762",96997528:"6383",b49de2ad:"33",a55aca30:"38","935f2afb":"53","00424e3f":"101",e8bfc54f:"161","865d1447":"242","684e0aea":"252","04d1378b":"272","181d712d":"331",f98b7248:"378",af67069a:"486","19ee85cd":"511","0c7edd3c":"535","8ab53c77":"572",b80a1ac9:"629","1a01fdf1":"656","9a34b858":"683","398b3246":"694","04c33c1d":"718","7accbb75":"779","5eff386f":"804",ddab1e1f:"891","933bed1e":"962",a8a1de49:"981",e6bddadc:"1056","2dcc617a":"1131","2ec4e639":"1175",ddb15f76:"1203","6e1398c4":"1244","0ef19a76":"1298",bab8a798:"1452",e6cdcb35:"1545",af558054:"1665","3fb5a56d":"1688","170ab94c":"1728","74a579df":"1774",e9d07a0a:"1882","37fdb427":"1906",d389a7b2:"1908","50214cd4":"1993","120e2fab":"2028",d9683343:"2159",bc243f9c:"2179",c262e01e:"2232","5fcf77d7":"2240","9292650b":"2314","743699a6":"2392",cae448e5:"2393","9a6ca8b8":"2409",f9078c13:"2415","54c48e38":"2428","3e7ee0fc":"2492","289d965c":"2508","814f3328":"2535",fa42474c:"2559",f431fa1f:"2560",b1c3f2c7:"2589","7b8d824d":"2627",b48043f7:"2630","5e26652b":"2796",ea7b1b31:"2826",e237dedf:"2849","0a02aff3":"2873",f97fefc4:"3012","66c89031":"3038",a6aa9e1f:"3089","7d2f6bd9":"3257",fc9f0a8f:"3382","41e12717":"3418","239f6efa":"3524",f2f4b8a7:"3560","4c76b531":"3573",dc701447:"3599","9e4087bc":"3608","8f43d633":"3652","32a9b7bf":"3685","5bfbde57":"3686","2d84255a":"3928","01a85c17":"4013","7358fe14":"4060","0e97a833":"4100","17f9232f":"4119",df5bc064:"4161",c4f5d8e4:"4195","3498d2db":"4201",cb38042d:"4217","373c35af":"4223","5fc994c2":"4274",a32fb7f5:"4296",b6072cb9:"4357","3b089002":"4381",dcfd3b61:"4384","85addd09":"4514","3abc4359":"4537","86a9c212":"4647","268dddcf":"4749","649c4fa3":"4786","5d2f6d16":"4806",ea9c95e7:"4836",c8447d5b:"4878","3974811d":"4938",f14c3b1d:"4943",a622d695:"5135","9eb50243":"5202","45e366b7":"5237","7c97e9a2":"5299","0b72a6ff":"5482","66491fb6":"5494",d9894068:"5495","121cced5":"5716",fc323215:"5844","1c545b73":"5994","30a967f3":"6040","4898f926":"6068","861bdbb6":"6096",ccc49370:"6103","90ca9965":"6108",ba1e31c2:"6190",df8c2417:"6271","3f859f05":"6320","3d4c33f6":"6326",c83bcda6:"6327","4e8770ad":"6367",af952e90:"6474","6fb4057b":"6567","5bc90040":"6587","85a74db3":"6630","5133b137":"6711","851303a1":"6724","40e30cb7":"6881","8e7c33d6":"6933","3f50474f":"6945","23a61782":"6961","79ac7843":"6978",d0f64c9c:"7051","5125c427":"7061",a4761f6f:"7185","0f6ee85b":"7249",f6b2bbb1:"7250","5a9cd6fb":"7295","48c4a2a0":"7334",e453af6e:"7373","0970ca0c":"7478","0b851b4d":"7586","0d1d5dba":"7734",c12557ec:"7760","80f9953e":"7766",df0b489b:"7773","06556991":"7811",d350cff3:"7816","656a21b7":"7857","4afa4b8a":"7893","9b67fd78":"7911","1a4e3797":"7920","5b12c1a9":"7940",cd796466:"8009",c74a7097:"8022",a6860cb2:"8198","7a99341f":"8201",c7632c1f:"8286",dbe4f0b7:"8360","4a184f52":"8369",ecfe08ed:"8382","1d245f66":"8421",f02f7df4:"8521","9509e94f":"8545","20110cf9":"8552",eb35abdd:"8554","6af18994":"8577","9338ecde":"8602","6875c492":"8610","1c323773":"8627","3bc305d8":"8664","40113ee6":"8763","4aba33e7":"8788",c62bfd53:"8814","6781c826":"8854","2cf03b61":"8875",ae694851:"8883","1373a77b":"8887",e432d2f9:"8928","0a2b2829":"8952","85c7de33":"9167","7dcc0419":"9182","7c823085":"9319","9017a355":"9358","3f3efe2b":"9455",ef7da448:"9597",b9d5de69:"9617",dd5377a3:"9651",f164116d:"9737","329947da":"9775","38bf2aac":"9780",beec6c9a:"9831","881ac13d":"9906"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var f=r.o(e,a)?e[a]:void 0;if(0!==f)if(f)c.push(f[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var d=new Promise(((c,d)=>f=e[a]=[c,d]));c.push(f[2]=d);var b=r.p+r.u(a),t=new Error;r.l(b,(c=>{if(r.o(e,a)&&(0!==(f=e[a])&&(e[a]=void 0),f)){var d=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+d+": "+b+")",t.name="ChunkLoadError",t.type=d,t.request=b,f[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var f,d,b=c[0],t=c[1],o=c[2],n=0;if(b.some((a=>0!==e[a]))){for(f in t)r.o(t,f)&&(r.m[f]=t[f]);if(o)var i=o(r)}for(a&&a(c);n