diff --git a/404.html b/404.html index 8b8a8a93ab..f93fbfca9d 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/373c35af.2bc80b37.js b/assets/js/373c35af.2bc80b37.js deleted file mode 100644 index 02d2a3cb47..0000000000 --- a/assets/js/373c35af.2bc80b37.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2698],{15680:(e,n,a)=>{a.d(n,{xA:()=>d,yg:()=>y});var t=a(96540);function i(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function l(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function r(e){for(var n=1;n=0||(i[a]=e[a]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=t.createContext({}),c=function(e){var n=t.useContext(s),a=n;return e&&(a="function"==typeof e?e(n):r(r({},n),e)),a},d=function(e){var n=c(e.components);return t.createElement(s.Provider,{value:n},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},g=t.forwardRef((function(e,n){var a=e.components,i=e.mdxType,l=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=c(a),g=i,y=p["".concat(s,".").concat(g)]||p[g]||u[g]||l;return a?t.createElement(y,r(r({ref:n},d),{},{components:a})):t.createElement(y,r({ref:n},d))}));function y(e,n){var a=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var l=a.length,r=new Array(l);r[0]=g;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o[p]="string"==typeof e?e:i,r[1]=o;for(var c=2;c{a.r(n),a.d(n,{assets:()=>s,contentTitle:()=>r,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var t=a(58168),i=(a(96540),a(15680));const l={},r="Device",o={unversionedId:"api/device",id:"version-20.x/api/device",title:"Device",description:"The device object is globally available in every test file, unless you use exposeGlobals: false in the behavior config,",source:"@site/versioned_docs/version-20.x/api/device.md",sourceDirName:"api",slug:"/api/device",permalink:"/Detox/docs/api/device",draft:!1,editUrl:"https://github.com/wix/Detox/edit/master/docs/versioned_docs/version-20.x/api/device.md",tags:[],version:"20.x",frontMatter:{},sidebar:"apiSidebar",previous:{title:"detox run-server",permalink:"/Detox/docs/cli/run-server"},next:{title:"Matchers",permalink:"/Detox/docs/api/matchers"}},s={},c=[{value:"Public Properties",id:"public-properties",level:2},{value:"device.id",id:"deviceid",level:3},{value:"device.name",id:"devicename",level:3},{value:"device.appLaunchArgs",id:"deviceapplaunchargs",level:3},{value:"Methods",id:"methods",level:2},{value:"device.selectApp(name)",id:"deviceselectappname",level:3},{value:"device.launchApp(params)",id:"devicelaunchappparams",level:3},{value:"1. newInstance\u2014Launching a New Instance of the App",id:"1-newinstancelaunching-a-new-instance-of-the-app",level:4},{value:"2. permissions\u2014Set Runtime Permissions (iOS Only)",id:"2-permissionsset-runtime-permissions-ios-only",level:4},{value:"Supported Permissions",id:"supported-permissions",level:5},{value:"3. url\u2014Launching with URL",id:"3-urllaunching-with-url",level:4},{value:"4. userNotification\u2014Launching with User Notifications",id:"4-usernotificationlaunching-with-user-notifications",level:4},{value:"5. userActivity\u2014Launch with User Activity (iOS Only)",id:"5-useractivitylaunch-with-user-activity-ios-only",level:4},{value:"6. delete\u2014Delete and Reinstall Application Before Launching",id:"6-deletedelete-and-reinstall-application-before-launching",level:4},{value:"7. launchArgs\u2014Additional Process Launch Arguments",id:"7-launchargsadditional-process-launch-arguments",level:4},{value:"8. disableTouchIndicators\u2014Disable Touch Indicators (iOS Only)",id:"8-disabletouchindicatorsdisable-touch-indicators-ios-only",level:4},{value:"9. languageAndLocale\u2014Launch with a Specific Language and/or Local (iOS Only)",id:"9-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only",level:4},{value:"10. detoxEnableSynchronization\u2014Initialize Detox with synchronization enabled or disabled at app launch",id:"10-detoxenablesynchronizationinitialize-detox-with-synchronization-enabled-or-disabled-at-app-launch",level:4},{value:"11. detoxURLBlacklistRegex\u2014Initialize the URL Blacklist at app launch",id:"11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch",level:4},{value:"12. detoxDisableWebKitSecurity\u2014Disable WebKit Security (iOS Only)",id:"12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only",level:4},{value:"device.terminateApp()",id:"deviceterminateapp",level:3},{value:"device.sendToHome()",id:"devicesendtohome",level:3},{value:"device.reloadReactNative()",id:"devicereloadreactnative",level:3},{value:"device.installApp()",id:"deviceinstallapp",level:3},{value:"device.uninstallApp()",id:"deviceuninstallapp",level:3},{value:"device.openURL({url, sourceApp[optional]})",id:"deviceopenurlurl-sourceappoptional",level:3},{value:"device.sendUserNotification(params)",id:"devicesendusernotificationparams",level:3},{value:"device.sendUserActivity(params) iOS Only",id:"devicesenduseractivityparams-ios-only",level:3},{value:"device.setOrientation(orientation)",id:"devicesetorientationorientation",level:3},{value:"device.setLocation(lat, lon)",id:"devicesetlocationlat-lon",level:3},{value:"device.disableSynchronization()",id:"devicedisablesynchronization",level:3},{value:"device.enableSynchronization()",id:"deviceenablesynchronization",level:3},{value:"device.setURLBlacklist([urls])",id:"deviceseturlblacklisturls",level:3},{value:"device.resetContentAndSettings() iOS Only",id:"deviceresetcontentandsettings-ios-only",level:3},{value:"device.getPlatform()",id:"devicegetplatform",level:3},{value:"device.takeScreenshot([name])",id:"devicetakescreenshotname",level:3},{value:"device.captureViewHierarchy([name])",id:"devicecaptureviewhierarchyname",level:3},{value:"device.shake() iOS Only",id:"deviceshake-ios-only",level:3},{value:"device.setBiometricEnrollment(bool) iOS Only",id:"devicesetbiometricenrollmentbool-ios-only",level:3},{value:"device.matchFace() iOS Only",id:"devicematchface-ios-only",level:3},{value:"device.unmatchFace() iOS Only",id:"deviceunmatchface-ios-only",level:3},{value:"device.matchFinger() iOS Only",id:"devicematchfinger-ios-only",level:3},{value:"device.unmatchFinger() iOS Only",id:"deviceunmatchfinger-ios-only",level:3},{value:"device.clearKeychain() iOS Only",id:"deviceclearkeychain-ios-only",level:3},{value:"device.setStatusBar() iOS Only",id:"devicesetstatusbar-ios-only",level:3},{value:"device.resetStatusBar() iOS Only",id:"deviceresetstatusbar-ios-only",level:3},{value:"device.reverseTcpPort() Android Only",id:"devicereversetcpport-android-only",level:3},{value:"device.unreverseTcpPort() Android Only",id:"deviceunreversetcpport-android-only",level:3},{value:"device.pressBack() Android Only",id:"devicepressback-android-only",level:3},{value:"device.getUiDevice() Android Only",id:"devicegetuidevice-android-only",level:3}],d={toc:c},p="wrapper";function u(e){let{components:n,...a}=e;return(0,i.yg)(p,(0,t.A)({},d,a,{components:n,mdxType:"MDXLayout"}),(0,i.yg)("h1",{id:"device"},"Device"),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"device")," object is globally available in every test file, unless you use ",(0,i.yg)("inlineCode",{parentName:"p"},"exposeGlobals: false")," in the behavior config,\nand even then you can import it from Detox package:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"const { device } = require('detox');\n")),(0,i.yg)("p",null,"It enables control over the current attached device."),(0,i.yg)("h2",{id:"public-properties"},"Public Properties"),(0,i.yg)("h3",{id:"deviceid"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.id")),(0,i.yg)("p",null,"Holds the environment-unique ID of the device - namely, the ",(0,i.yg)("inlineCode",{parentName:"p"},"adb")," ID on Android (e.g. ",(0,i.yg)("inlineCode",{parentName:"p"},"emulator-5554"),") and the Mac-global simulator UDID on iOS, as used by ",(0,i.yg)("inlineCode",{parentName:"p"},"simctl")," (e.g. ",(0,i.yg)("inlineCode",{parentName:"p"},"AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE"),")."),(0,i.yg)("p",null,"The value will be ",(0,i.yg)("inlineCode",{parentName:"p"},"undefined")," until the device is properly ",(0,i.yg)("em",{parentName:"p"},"prepared")," (i.e. in ",(0,i.yg)("inlineCode",{parentName:"p"},"detox.init()"),")."),(0,i.yg)("h3",{id:"devicename"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.name")),(0,i.yg)("p",null,"Holds a descriptive name of the device. Example: ",(0,i.yg)("inlineCode",{parentName:"p"},"emulator-5554 (Pixel_API_26)")),(0,i.yg)("p",null,"The value will be ",(0,i.yg)("inlineCode",{parentName:"p"},"undefined")," until the device is properly ",(0,i.yg)("em",{parentName:"p"},"prepared")," (i.e. in ",(0,i.yg)("inlineCode",{parentName:"p"},"detox.init()"),")."),(0,i.yg)("h3",{id:"deviceapplaunchargs"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.appLaunchArgs")),(0,i.yg)("p",null,"Access the launch-arguments predefined by the user in preliminary, static scopes such as the Detox ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/apps"},"configuration file"),"\nand ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/cli/test"},"command-line arguments"),". This access allows, through dedicated methods, for both value-querying and modification:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"// Modify some of the predefined arguments:\ndevice.appLaunchArgs.modify({\n mockServerPort: 1234,\n});\n// Retrieve the arguments:\ndevice.appLaunchArgs.get(); // ==> { mockServerPort: 1234 }\n// Reset (i.e. remove all arguments):\ndevice.appLaunchArgs.reset();\n")),(0,i.yg)("p",null,"In multi-app environments, you might want to persist your values between ",(0,i.yg)("inlineCode",{parentName:"p"},"device.selectApp(name)")," calls:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"device.appLaunchArgs.modify({ transientArg: 'value' });\ndevice.appLaunchArgs.shared.modify({\n permanentMockServerPort: 1234,\n};\n\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234, transientArg: 'value' }\ndevice.appLaunchArgs.shared.get(); // ==> { permanentMockServerPort: 1234 }\n\nawait device.selectApp('anotherApp');\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.reset();\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.shared.reset();\ndevice.appLaunchArgs.get(); // ==> {}\n")),(0,i.yg)("p",null,"This is the most flexible way of editing the launch arguments. Refer to the ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/launch-args"},"launch arguments guide")," for complete details."),(0,i.yg)("h2",{id:"methods"},"Methods"),(0,i.yg)("h3",{id:"deviceselectappname"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.selectApp(name)")),(0,i.yg)("p",null,"Use ",(0,i.yg)("strong",{parentName:"p"},"only for advanced multi-app configs")," when you need to switch between your apps\nwithin the same test scenario. Refer to the ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/apps"},"configuration doc"),"\nto discover how to define multiple apps with different ",(0,i.yg)("inlineCode",{parentName:"p"},"name"),"s."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.selectApp('myAppName');\n")),(0,i.yg)("p",null,"As a side effect (due to the current architectural limitation) running ",(0,i.yg)("inlineCode",{parentName:"p"},"device.selectApp")," terminates the previous\napp that had been running before."),(0,i.yg)("h3",{id:"devicelaunchappparams"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.launchApp(params)")),(0,i.yg)("p",null,"Launch the app defined in the current ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/overview"},(0,i.yg)("inlineCode",{parentName:"a"},"configuration")),"."),(0,i.yg)("p",null,(0,i.yg)("inlineCode",{parentName:"p"},"params"),"\u2014object, containing one of more of the following keys and values:"),(0,i.yg)("h4",{id:"1-newinstancelaunching-a-new-instance-of-the-app"},"1. ",(0,i.yg)("inlineCode",{parentName:"h4"},"newInstance"),"\u2014Launching a New Instance of the App"),(0,i.yg)("p",null,"Terminate the app and launch it again."),(0,i.yg)("p",null,"If set to ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),", the device will try to resume the app (e.g. bring from foreground to background). If the app isn\u2019t running, ",(0,i.yg)("strong",{parentName:"p"},"it will launch a new instance")," nonetheless. ",(0,i.yg)("strong",{parentName:"p"},"Default is ",(0,i.yg)("inlineCode",{parentName:"strong"},"false"),".")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({newInstance: true});\n")),(0,i.yg)("h4",{id:"2-permissionsset-runtime-permissions-ios-only"},"2. ",(0,i.yg)("inlineCode",{parentName:"h4"},"permissions"),"\u2014Set Runtime Permissions (iOS Only)"),(0,i.yg)("p",null,"Grants or denies runtime permissions to your application. This will cause the app to terminate before permissions are applied."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({permissions: {calendar: 'YES'}});\n")),(0,i.yg)("p",null,"Detox uses ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/AppleSimulatorUtils"},"AppleSimUtils")," and ",(0,i.yg)("a",{parentName:"p",href:"https://nshipster.com/simctl/"},(0,i.yg)("inlineCode",{parentName:"a"},"xcrun simctl"))," to implement this functionality for iOS simulators.\nPlease make sure you have the most recent version of both tools installed, since we rely on their latest versions."),(0,i.yg)("h5",{id:"supported-permissions"},"Supported Permissions"),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"Permission"),(0,i.yg)("th",{parentName:"tr",align:null},"Values"),(0,i.yg)("th",{parentName:"tr",align:null},"Notes"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"location"),(0,i.yg)("td",{parentName:"tr",align:null},"always / inuse / never / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"inuse - provides location access only when the app is in use")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"contacts"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset / limited"),(0,i.yg)("td",{parentName:"tr",align:null},"limited - grants limited access to contacts")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"photos"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset / limited"),(0,i.yg)("td",{parentName:"tr",align:null},"limited - grants limited access to photos")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"calendar"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"camera"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"medialibrary"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"microphone"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"motion"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"reminders"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"siri"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"notifications"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"health"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"homekit"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"speech"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"faceid"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"userTracking"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")))),(0,i.yg)("p",null,"Check Detox's ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/blob/master/detox/test/e2e/13.permissions.test.js"},"own test suite")," for usage examples."),(0,i.yg)("h4",{id:"3-urllaunching-with-url"},"3. ",(0,i.yg)("inlineCode",{parentName:"h4"},"url"),"\u2014Launching with URL"),(0,i.yg)("p",null,"Launches the app with the specified URL to test your app\u2019s deep link handling mechanism."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({url});\nawait device.launchApp({url, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({url, newInstance: false}); // Reuse existing instance\n")),(0,i.yg)("p",null,"Read more ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-open-with-url"},"here"),". Go back to subsection 1 to read about the full effect of the ",(0,i.yg)("inlineCode",{parentName:"p"},"newInstance")," argument."),(0,i.yg)("h4",{id:"4-usernotificationlaunching-with-user-notifications"},"4. ",(0,i.yg)("inlineCode",{parentName:"h4"},"userNotification"),"\u2014Launching with User Notifications"),(0,i.yg)("p",null,"Launches with the specified user notification."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({userNotification});\nawait device.launchApp({userNotification, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({userNotification, newInstance: false}); // Reuse existing instance\n")),(0,i.yg)("p",null,"Read more ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-user-notifications"},"here"),". Go back to subsection 1 to read about the full effect of the ",(0,i.yg)("inlineCode",{parentName:"p"},"newInstance")," argument."),(0,i.yg)("h4",{id:"5-useractivitylaunch-with-user-activity-ios-only"},"5. ",(0,i.yg)("inlineCode",{parentName:"h4"},"userActivity"),"\u2014Launch with User Activity (iOS Only)"),(0,i.yg)("p",null,"Launches the app with the specified user activity."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({userActivity: activity});\nawait device.launchApp({userActivity: activity, newInstance: true}); //Launch a new instance of the app\nawait device.launchApp({userActivity: activity, newInstance: false}); //Reuse existing instance\n")),(0,i.yg)("p",null,"Read more in ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-user-activity"},"here"),". Go back to subsection 1 to read about the full effect of the ",(0,i.yg)("inlineCode",{parentName:"p"},"newInstance")," argument."),(0,i.yg)("h4",{id:"6-deletedelete-and-reinstall-application-before-launching"},"6. ",(0,i.yg)("inlineCode",{parentName:"h4"},"delete"),"\u2014Delete and Reinstall Application Before Launching"),(0,i.yg)("p",null,"Before launching the application, it is uninstalled and then reinstalled."),(0,i.yg)("p",null,"A flag that enables relaunching into a fresh installation of the app (it will uninstall and install the binary). Default is ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({delete: true});\n")),(0,i.yg)("h4",{id:"7-launchargsadditional-process-launch-arguments"},"7. ",(0,i.yg)("inlineCode",{parentName:"h4"},"launchArgs"),"\u2014Additional Process Launch Arguments"),(0,i.yg)("p",null,"Launches the app on the device with on-site, user-specified launch arguments:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},'await device.launchApp({\n launchArgs: {\n arg1: 1,\n arg2: "2",\n }\n});\n')),(0,i.yg)("p",null,"This is the most explicit and straightforward way of setting launch arguments. Refer to the ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/launch-args"},"launch arguments guide")," for a complete overview on app launch arguments."),(0,i.yg)("h4",{id:"8-disabletouchindicatorsdisable-touch-indicators-ios-only"},"8. ",(0,i.yg)("inlineCode",{parentName:"h4"},"disableTouchIndicators"),"\u2014Disable Touch Indicators (iOS Only)"),(0,i.yg)("p",null,"Disables touch indicators on iOS. Default is ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({disableTouchIndicators: true});\n")),(0,i.yg)("h4",{id:"9-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only"},"9. ",(0,i.yg)("inlineCode",{parentName:"h4"},"languageAndLocale"),"\u2014Launch with a Specific Language and/or Local (iOS Only)"),(0,i.yg)("p",null,"Launch the app with a specific system language"),(0,i.yg)("p",null,"Information about accepted values can be found ",(0,i.yg)("a",{parentName:"p",href:"https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html"},"here"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},'await device.launchApp({\n languageAndLocale: {\n language: "es-MX",\n locale: "es-MX"\n }\n});\n')),(0,i.yg)("p",null,"With this API, you can run sets of E2E tests per language. For example:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"describe.each([\n ['es-MX'], ['fr-FR'], ['pt-BR'],\n])(`Test suite (locale: %s)`, (locale) => {\n beforeAll(async () => {\n await device.launchApp({\n newInstance: true,\n languageAndLocale: {\n language: locale,\n locale\n }\n });\n });\n\n test('some description', async () => {\n // \u2026\n });\n});\n")),(0,i.yg)("h4",{id:"10-detoxenablesynchronizationinitialize-detox-with-synchronization-enabled-or-disabled-at-app-launch"},"10. ",(0,i.yg)("inlineCode",{parentName:"h4"},"detoxEnableSynchronization"),"\u2014Initialize Detox with synchronization enabled or disabled at app launch"),(0,i.yg)("p",null,"Launches the app with the synchronization mechanism enabled or disabled. Useful if the app cannot be synchronized during the launch process. Synchronization can later be enabled using ",(0,i.yg)("inlineCode",{parentName:"p"},"device.enableSynchronization()"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({\n newInstance: true,\n launchArgs: { detoxEnableSynchronization: 0 }\n});\n")),(0,i.yg)("h4",{id:"11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch"},"11. ",(0,i.yg)("inlineCode",{parentName:"h4"},"detoxURLBlacklistRegex"),"\u2014Initialize the URL Blacklist at app launch"),(0,i.yg)("p",null,"Launches the app with a URL blacklist to disable network synchronization on certain endpoints.\nUseful if the app makes frequent network calls to blacklisted endpoints upon startup."),(0,i.yg)("blockquote",null,(0,i.yg)("p",{parentName:"blockquote"},"Note that due to the complexity of reg-exps and interoperability concerns, the implementation is fairly sensitive to the format of the string of urls.\nPlease do your best to follow the example below:")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},'await device.launchApp({\n newInstance: true,\n launchArgs: { detoxURLBlacklistRegex: \'\\\\("^http://192\\.168\\.1\\.253:\\\\d{4}/.*","https://e\\.crashlytics\\.com/spi/v2/events"\\\\)\' },\n});\n')),(0,i.yg)("h4",{id:"12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only"},"12. ",(0,i.yg)("inlineCode",{parentName:"h4"},"detoxDisableWebKitSecurity"),"\u2014Disable WebKit Security (iOS Only)"),(0,i.yg)("p",null,"Disables WebKit security on iOS. Default is ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),"."),(0,i.yg)("p",null,"This is useful for testing web views with iframes that loads CORS-protected content."),(0,i.yg)("admonition",{title:"Important",type:"caution"},(0,i.yg)("p",{parentName:"admonition"},"Some pages may not load correctly when WebKit security is disabled (for example, PCI DSS-compliant pages).\nDisabling WebKit security may cause errors when loading pages that have strict security policies.")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({\n launchArgs: { detoxDisableWebKitSecurity: true }\n});\n")),(0,i.yg)("h3",{id:"deviceterminateapp"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.terminateApp()")),(0,i.yg)("p",null,"By default, ",(0,i.yg)("inlineCode",{parentName:"p"},"terminateApp()")," with no params will terminate the app file defined in the current ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/overview"},(0,i.yg)("inlineCode",{parentName:"a"},"configuration")),"."),(0,i.yg)("p",null,"To terminate another app, specify its bundle id"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.terminateApp('other.bundle.id');\n")),(0,i.yg)("h3",{id:"devicesendtohome"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.sendToHome()")),(0,i.yg)("p",null,"Send application to background by bringing ",(0,i.yg)("inlineCode",{parentName:"p"},"com.apple.springboard")," to the foreground.\nCombining ",(0,i.yg)("inlineCode",{parentName:"p"},"sendToHome()")," with ",(0,i.yg)("inlineCode",{parentName:"p"},"launchApp({newInstance: false})")," will simulate app coming back from background.\nCheck out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js"},"own test suite")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.sendToHome();\nawait device.launchApp({newInstance: false});\n// app returned from background, do stuff\n")),(0,i.yg)("p",null,"Check out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js"},"own test suite")),(0,i.yg)("h3",{id:"devicereloadreactnative"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.reloadReactNative()")),(0,i.yg)("p",null,"If this is a React Native app, reload the React Native JS bundle. This action is much faster than ",(0,i.yg)("inlineCode",{parentName:"p"},"device.launchApp()"),", and can be used if you just need to reset your React Native logic."),(0,i.yg)("i",null,"**Note:** This functionality does not work without faults. Under certain conditions, the system may not behave as expected and/or even crash. In these cases, use `device.launchApp()` to launch the app cleanly instead of only reloading the JS bundle."),(0,i.yg)("h3",{id:"deviceinstallapp"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.installApp()")),(0,i.yg)("p",null,"By default, ",(0,i.yg)("inlineCode",{parentName:"p"},"installApp()")," with no params will install the app file defined in the current ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/overview"},(0,i.yg)("inlineCode",{parentName:"a"},"configuration")),"."),(0,i.yg)("p",null,"To install another app, specify its path"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.installApp('path/to/other/app');\n")),(0,i.yg)("h3",{id:"deviceuninstallapp"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.uninstallApp()")),(0,i.yg)("p",null,"By default, ",(0,i.yg)("inlineCode",{parentName:"p"},"uninstallApp()")," with no params will uninstall the app defined in the current ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/overview"},(0,i.yg)("inlineCode",{parentName:"a"},"configuration")),"."),(0,i.yg)("p",null,"To uninstall another app, specify its bundle id"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.uninstallApp('other.bundle.id');\n")),(0,i.yg)("h3",{id:"deviceopenurlurl-sourceappoptional"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.openURL({url, sourceApp[optional]})")),(0,i.yg)("p",null,"Mock opening the app from URL. ",(0,i.yg)("inlineCode",{parentName:"p"},"sourceApp")," is an optional ",(0,i.yg)("strong",{parentName:"p"},"iOS-only")," parameter to specify source application bundle id."),(0,i.yg)("p",null,"Read more in ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-open-with-url"},"Mocking Open with URL")," section.\nCheck out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/15.urls.test.js"},"own test suite")),(0,i.yg)("h3",{id:"devicesendusernotificationparams"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.sendUserNotification(params)")),(0,i.yg)("p",null,"Mock handling of a user notification previously received in the system, while the app is already running."),(0,i.yg)("p",null,"Read more in ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-user-notifications"},"Mocking User Notifications")," section.\nCheck out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/11.user-notifications.test.js"},"own test suite")),(0,i.yg)("h3",{id:"devicesenduseractivityparams-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.sendUserActivity(params)")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Mock handling of received user activity when app is in foreground.\nRead more in ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-user-activity"},"Mocking User Activity")," section.\nCheck out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/18.user-activities.test.js"},"own test suite")),(0,i.yg)("h3",{id:"devicesetorientationorientation"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setOrientation(orientation)")),(0,i.yg)("p",null,"Takes ",(0,i.yg)("inlineCode",{parentName:"p"},'"portrait"')," or ",(0,i.yg)("inlineCode",{parentName:"p"},'"landscape"')," and rotates the device to the given orientation."),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"Note:")," Setting device orientation is only supported for iPhone devices, or for apps declared as requiring full screen on iPad. For all other cases, the current test will be failed."),(0,i.yg)("p",null,"Check out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device-orientation.test.js"},"own test suite.")),(0,i.yg)("h3",{id:"devicesetlocationlat-lon"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setLocation(lat, lon)")),(0,i.yg)("p",null,"Sets the simulator/emulator location to the given latitude and longitude."),(0,i.yg)("blockquote",null,(0,i.yg)("p",{parentName:"blockquote"},"On iOS ",(0,i.yg)("inlineCode",{parentName:"p"},"setLocation")," depends on ",(0,i.yg)("inlineCode",{parentName:"p"},"xcrun simctl"),", and we recommend using its latest version."),(0,i.yg)("p",{parentName:"blockquote"},"On Android ",(0,i.yg)("inlineCode",{parentName:"p"},"setLocation")," will work with both Android Emulator (bundled with Android development tools) and Genymotion. The correct permissions must be set in your app manifest.")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.setLocation(32.0853, 34.7818);\n")),(0,i.yg)("h3",{id:"devicedisablesynchronization"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.disableSynchronization()")),(0,i.yg)("p",null,"Temporarily disable synchronization (idle/busy monitoring) with the app - namely, stop waiting for the app to go idle before moving forward in the test execution."),(0,i.yg)("p",null,"This API is useful for cases where test assertions must be made in an area of your application where it is okay for it to ever remain partly ",(0,i.yg)("em",{parentName:"p"},"busy")," (e.g. due to an endlessly repeating on-screen animation).\nHowever, using it inherently suggests that you are likely to resort to applying ",(0,i.yg)("inlineCode",{parentName:"p"},"sleep()"),"\u2019s in your test code - testing that area, ",(0,i.yg)("strong",{parentName:"p"},"which is not recommended and can never be 100% stable."),' Therefore, as a rule of thumb, test code running "inside" a sync-disabled mode must be reduced to the bare minimum.'),(0,i.yg)("p",null,"Note: Synchronization is enabled by default, and it gets ",(0,i.yg)("strong",{parentName:"p"},"re-enabled on every launch of a new instance of the app.")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.disableSynchronization();\n")),(0,i.yg)("h3",{id:"deviceenablesynchronization"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.enableSynchronization()")),(0,i.yg)("p",null,"Re-enable synchronization (idle/busy monitoring) with the app - namely, resume waiting for the app to go idle before moving forward in the test execution, after a previous disabling of it through a call to ",(0,i.yg)("inlineCode",{parentName:"p"},"device.disableSynchronization()"),"."),(0,i.yg)("p",null,"\u26a0\ufe0f Note: Making this call would resume synchronization ",(0,i.yg)("strong",{parentName:"p"},"instantly"),", having its returned promise only resolve when the app becomes idle again. In other words, this ",(0,i.yg)("strong",{parentName:"p"},'must only be called after you navigate back to "the safe zone", where the app should be able to eventually become idle again'),', or it would remain suspended "forever" (i.e. until a safeguard time-out expires).'),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.enableSynchronization();\n")),(0,i.yg)("h3",{id:"deviceseturlblacklisturls"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setURLBlacklist([urls])")),(0,i.yg)("p",null,"Exclude synchronization with respect to network activity (i.e. don\u2019t wait for network to go idle before moving forward in the test execution) according to ",(0,i.yg)("strong",{parentName:"p"},"specific")," endpoints, denoted as URL reg-exp\u2019s. To disable endpoints at initialization, pass in the black-list as an ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/launch-args"},"app-launch argument")," named ",(0,i.yg)("inlineCode",{parentName:"p"},"detoxURLBlacklistRegex")," (as explained ",(0,i.yg)("a",{parentName:"p",href:"#11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch"},"here"),")."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.setURLBlacklist(['.*127.0.0.1.*', '.*my.ignored.endpoint.*']);\n")),(0,i.yg)("h3",{id:"deviceresetcontentandsettings-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.resetContentAndSettings()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Resets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing\npreviously set permissions."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.resetContentAndSettings();\n")),(0,i.yg)("h3",{id:"devicegetplatform"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.getPlatform()")),(0,i.yg)("p",null,"Returns the current device, ",(0,i.yg)("inlineCode",{parentName:"p"},"ios")," or ",(0,i.yg)("inlineCode",{parentName:"p"},"android"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"if (device.getPlatform() === 'ios') {\n await expect(loopSwitch).toHaveValue('1');\n}\n")),(0,i.yg)("h3",{id:"devicetakescreenshotname"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.takeScreenshot([name])")),(0,i.yg)("p",null,"Takes a screenshot of the device. For full details on taking screenshots with Detox, refer to the ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/taking-screenshots"},"screen-shots guide"),"."),(0,i.yg)("h3",{id:"devicecaptureviewhierarchyname"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.captureViewHierarchy([name])")),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"iOS Only.")," Saves a view hierarchy snapshot (",(0,i.yg)("inlineCode",{parentName:"p"},"*.viewhierarchy"),") of the\ncurrently opened application to a temporary folder and schedules putting it to\nthe artifacts' folder upon the completion of the current test. The file can be\nopened later in Xcode 12.0 and above.\nSee ",(0,i.yg)("a",{parentName:"p",href:"https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes#:~:text=57933113"},"Xcode 12 Release notes: #57933113"),"\nfor more details."),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"name")," parameter is optional \u2014\xa0by default, it equals to ",(0,i.yg)("inlineCode",{parentName:"p"},"capture"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"test('Capture view hierarchy', async () => {\n const temporaryArtifactPath = await device.captureViewHierarchy('myElements');\n\n // The temporary path will remain valid until the test completion.\n // Afterwards, the artifact will be moved, e.g.:\n // * on success, to: /\u2713 Capture view hierarchy/myElements.viewhierarchy\n // * on failure, to: /\u2717 Capture view hierarchy/myElements.viewhierarchy\n});\n")),(0,i.yg)("h3",{id:"deviceshake-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.shake()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulate shake"),(0,i.yg)("h3",{id:"devicesetbiometricenrollmentbool-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setBiometricEnrollment(bool)")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Toggles device enrollment in biometric authentication (Touch ID or Face ID)."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.setBiometricEnrollment(true);\n// or\nawait device.setBiometricEnrollment(false);\n")),(0,i.yg)("h3",{id:"devicematchface-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.matchFace()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulates the success of a face match via Face ID"),(0,i.yg)("h3",{id:"deviceunmatchface-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.unmatchFace()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulates the failure of face match via Face ID"),(0,i.yg)("h3",{id:"devicematchfinger-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.matchFinger()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulates the success of a finger match via Touch ID"),(0,i.yg)("h3",{id:"deviceunmatchfinger-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.unmatchFinger()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulates the failure of a finger match via Touch ID"),(0,i.yg)("h3",{id:"deviceclearkeychain-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.clearKeychain()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Clears the device keychain"),(0,i.yg)("h3",{id:"devicesetstatusbar-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setStatusBar()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Override simulator\u2019s status bar. Available options:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.setStatusBar({\n time: \"12:34\",\n // Set the date or time to a fixed value.\n // If the string is a valid ISO date string it will also set the date on relevant devices.\n dataNetwork: \"wifi\",\n // If specified must be one of 'hide', 'wifi', '3g', '4g', 'lte', 'lte-a', 'lte+', '5g', '5g+', '5g-uwb', or '5g-uc'.\n wifiMode: \"failed\",\n // If specified must be one of 'searching', 'failed', or 'active'.\n wifiBars: \"2\",\n // If specified must be 0-3.\n cellularMode: \"searching\",\n // If specified must be one of 'notSupported', 'searching', 'failed', or 'active'.\n cellularBars: \"3\",\n // If specified must be 0-4.\n operatorName: \"A1\",\n // Set the cellular operator/carrier name. Use '' for the empty string.\n batteryState: \"charging\",\n // If specified must be one of 'charging', 'charged', or 'discharging'.\n batteryLevel: \"50\",\n // If specified must be 0-100.\n});\n")),(0,i.yg)("h3",{id:"deviceresetstatusbar-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.resetStatusBar()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Resets any override in simulator\u2019s status bar."),(0,i.yg)("h3",{id:"devicereversetcpport-android-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.reverseTcpPort()")," ",(0,i.yg)("strong",{parentName:"h3"},"Android Only")),(0,i.yg)("p",null,"Reverse a TCP port from the device (guest) back to the host-computer, as typically done with the ",(0,i.yg)("inlineCode",{parentName:"p"},"adb reverse")," command. The end result would be that all network requests going from the device to the specified port will be forwarded to the computer."),(0,i.yg)("h3",{id:"deviceunreversetcpport-android-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.unreverseTcpPort()")," ",(0,i.yg)("strong",{parentName:"h3"},"Android Only")),(0,i.yg)("p",null,"Clear a ",(0,i.yg)("em",{parentName:"p"},"reversed")," TCP-port (e.g. previously set using ",(0,i.yg)("inlineCode",{parentName:"p"},"device.reverseTcpPort()"),")."),(0,i.yg)("h3",{id:"devicepressback-android-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.pressBack()")," ",(0,i.yg)("strong",{parentName:"h3"},"Android Only")),(0,i.yg)("p",null,"Simulate press back button."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.pressBack();\n")),(0,i.yg)("h3",{id:"devicegetuidevice-android-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.getUiDevice()")," ",(0,i.yg)("strong",{parentName:"h3"},"Android Only")),(0,i.yg)("p",null,"Exposes ",(0,i.yg)("a",{parentName:"p",href:"https://developer.android.com/reference/androidx/test/uiautomator/UiDevice"},(0,i.yg)("inlineCode",{parentName:"a"},"UiAutomator"),"\u2019s ",(0,i.yg)("inlineCode",{parentName:"a"},"UiDevice")," API"),".\n",(0,i.yg)("strong",{parentName:"p"},"This is not a part of the official Detox API"),", it may break and change whenever an update to ",(0,i.yg)("inlineCode",{parentName:"p"},"UiDevice")," or ",(0,i.yg)("inlineCode",{parentName:"p"},"UiAutomator")," Gradle dependencies (",(0,i.yg)("inlineCode",{parentName:"p"},"androidx.test.uiautomator:uiautomator"),") is introduced."),(0,i.yg)("p",null,(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/src/android/espressoapi/UIDevice.js"},(0,i.yg)("inlineCode",{parentName:"a"},"UiDevice"),"\u2019s autogenerated code")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/373c35af.ff5977eb.js b/assets/js/373c35af.ff5977eb.js new file mode 100644 index 0000000000..38cf80efe5 --- /dev/null +++ b/assets/js/373c35af.ff5977eb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2698],{15680:(e,n,a)=>{a.d(n,{xA:()=>d,yg:()=>y});var t=a(96540);function i(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function l(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function r(e){for(var n=1;n=0||(i[a]=e[a]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var s=t.createContext({}),c=function(e){var n=t.useContext(s),a=n;return e&&(a="function"==typeof e?e(n):r(r({},n),e)),a},d=function(e){var n=c(e.components);return t.createElement(s.Provider,{value:n},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var n=e.children;return t.createElement(t.Fragment,{},n)}},g=t.forwardRef((function(e,n){var a=e.components,i=e.mdxType,l=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=c(a),g=i,y=p["".concat(s,".").concat(g)]||p[g]||u[g]||l;return a?t.createElement(y,r(r({ref:n},d),{},{components:a})):t.createElement(y,r({ref:n},d))}));function y(e,n){var a=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var l=a.length,r=new Array(l);r[0]=g;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o[p]="string"==typeof e?e:i,r[1]=o;for(var c=2;c{a.r(n),a.d(n,{assets:()=>s,contentTitle:()=>r,default:()=>u,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var t=a(58168),i=(a(96540),a(15680));const l={},r="Device",o={unversionedId:"api/device",id:"version-20.x/api/device",title:"Device",description:"The device object is globally available in every test file, unless you use exposeGlobals: false in the behavior config,",source:"@site/versioned_docs/version-20.x/api/device.md",sourceDirName:"api",slug:"/api/device",permalink:"/Detox/docs/api/device",draft:!1,editUrl:"https://github.com/wix/Detox/edit/master/docs/versioned_docs/version-20.x/api/device.md",tags:[],version:"20.x",frontMatter:{},sidebar:"apiSidebar",previous:{title:"detox run-server",permalink:"/Detox/docs/cli/run-server"},next:{title:"Matchers",permalink:"/Detox/docs/api/matchers"}},s={},c=[{value:"Public Properties",id:"public-properties",level:2},{value:"device.id",id:"deviceid",level:3},{value:"device.name",id:"devicename",level:3},{value:"device.appLaunchArgs",id:"deviceapplaunchargs",level:3},{value:"Methods",id:"methods",level:2},{value:"device.selectApp(name)",id:"deviceselectappname",level:3},{value:"device.launchApp(params)",id:"devicelaunchappparams",level:3},{value:"1. newInstance\u2014Launching a New Instance of the App",id:"1-newinstancelaunching-a-new-instance-of-the-app",level:4},{value:"2. permissions\u2014Set Runtime Permissions (iOS Only)",id:"2-permissionsset-runtime-permissions-ios-only",level:4},{value:"Supported Permissions",id:"supported-permissions",level:5},{value:"3. url\u2014Launching with URL",id:"3-urllaunching-with-url",level:4},{value:"4. userNotification\u2014Launching with User Notifications",id:"4-usernotificationlaunching-with-user-notifications",level:4},{value:"5. userActivity\u2014Launch with User Activity (iOS Only)",id:"5-useractivitylaunch-with-user-activity-ios-only",level:4},{value:"6. delete\u2014Delete and Reinstall Application Before Launching",id:"6-deletedelete-and-reinstall-application-before-launching",level:4},{value:"7. launchArgs\u2014Additional Process Launch Arguments",id:"7-launchargsadditional-process-launch-arguments",level:4},{value:"8. disableTouchIndicators\u2014Disable Touch Indicators (iOS Only)",id:"8-disabletouchindicatorsdisable-touch-indicators-ios-only",level:4},{value:"9. languageAndLocale\u2014Launch with a Specific Language and/or Local (iOS Only)",id:"9-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only",level:4},{value:"10. detoxEnableSynchronization\u2014Initialize Detox with synchronization enabled or disabled at app launch",id:"10-detoxenablesynchronizationinitialize-detox-with-synchronization-enabled-or-disabled-at-app-launch",level:4},{value:"11. detoxURLBlacklistRegex\u2014Initialize the URL Blacklist at app launch",id:"11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch",level:4},{value:"12. detoxDisableWebKitSecurity\u2014Disable WebKit Security (iOS Only)",id:"12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only",level:4},{value:"device.terminateApp()",id:"deviceterminateapp",level:3},{value:"device.sendToHome()",id:"devicesendtohome",level:3},{value:"device.reloadReactNative()",id:"devicereloadreactnative",level:3},{value:"device.installApp()",id:"deviceinstallapp",level:3},{value:"device.uninstallApp()",id:"deviceuninstallapp",level:3},{value:"device.openURL({url, sourceApp[optional]})",id:"deviceopenurlurl-sourceappoptional",level:3},{value:"device.sendUserNotification(params)",id:"devicesendusernotificationparams",level:3},{value:"device.sendUserActivity(params) iOS Only",id:"devicesenduseractivityparams-ios-only",level:3},{value:"device.setOrientation(orientation)",id:"devicesetorientationorientation",level:3},{value:"device.setLocation(lat, lon)",id:"devicesetlocationlat-lon",level:3},{value:"device.disableSynchronization()",id:"devicedisablesynchronization",level:3},{value:"device.enableSynchronization()",id:"deviceenablesynchronization",level:3},{value:"device.setURLBlacklist([urls])",id:"deviceseturlblacklisturls",level:3},{value:"device.resetContentAndSettings() iOS Only",id:"deviceresetcontentandsettings-ios-only",level:3},{value:"device.getPlatform()",id:"devicegetplatform",level:3},{value:"device.takeScreenshot([name])",id:"devicetakescreenshotname",level:3},{value:"device.captureViewHierarchy([name])",id:"devicecaptureviewhierarchyname",level:3},{value:"device.generateViewHierarchyXml([shouldInjectTestIds])",id:"devicegenerateviewhierarchyxmlshouldinjecttestids",level:3},{value:"device.shake() iOS Only",id:"deviceshake-ios-only",level:3},{value:"device.setBiometricEnrollment(bool) iOS Only",id:"devicesetbiometricenrollmentbool-ios-only",level:3},{value:"device.matchFace() iOS Only",id:"devicematchface-ios-only",level:3},{value:"device.unmatchFace() iOS Only",id:"deviceunmatchface-ios-only",level:3},{value:"device.matchFinger() iOS Only",id:"devicematchfinger-ios-only",level:3},{value:"device.unmatchFinger() iOS Only",id:"deviceunmatchfinger-ios-only",level:3},{value:"device.clearKeychain() iOS Only",id:"deviceclearkeychain-ios-only",level:3},{value:"device.setStatusBar() iOS Only",id:"devicesetstatusbar-ios-only",level:3},{value:"device.resetStatusBar() iOS Only",id:"deviceresetstatusbar-ios-only",level:3},{value:"device.reverseTcpPort() Android Only",id:"devicereversetcpport-android-only",level:3},{value:"device.unreverseTcpPort() Android Only",id:"deviceunreversetcpport-android-only",level:3},{value:"device.pressBack() Android Only",id:"devicepressback-android-only",level:3},{value:"device.getUiDevice() Android Only",id:"devicegetuidevice-android-only",level:3}],d={toc:c},p="wrapper";function u(e){let{components:n,...a}=e;return(0,i.yg)(p,(0,t.A)({},d,a,{components:n,mdxType:"MDXLayout"}),(0,i.yg)("h1",{id:"device"},"Device"),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"device")," object is globally available in every test file, unless you use ",(0,i.yg)("inlineCode",{parentName:"p"},"exposeGlobals: false")," in the behavior config,\nand even then you can import it from Detox package:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"const { device } = require('detox');\n")),(0,i.yg)("p",null,"It enables control over the current attached device."),(0,i.yg)("h2",{id:"public-properties"},"Public Properties"),(0,i.yg)("h3",{id:"deviceid"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.id")),(0,i.yg)("p",null,"Holds the environment-unique ID of the device - namely, the ",(0,i.yg)("inlineCode",{parentName:"p"},"adb")," ID on Android (e.g. ",(0,i.yg)("inlineCode",{parentName:"p"},"emulator-5554"),") and the Mac-global simulator UDID on iOS, as used by ",(0,i.yg)("inlineCode",{parentName:"p"},"simctl")," (e.g. ",(0,i.yg)("inlineCode",{parentName:"p"},"AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE"),")."),(0,i.yg)("p",null,"The value will be ",(0,i.yg)("inlineCode",{parentName:"p"},"undefined")," until the device is properly ",(0,i.yg)("em",{parentName:"p"},"prepared")," (i.e. in ",(0,i.yg)("inlineCode",{parentName:"p"},"detox.init()"),")."),(0,i.yg)("h3",{id:"devicename"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.name")),(0,i.yg)("p",null,"Holds a descriptive name of the device. Example: ",(0,i.yg)("inlineCode",{parentName:"p"},"emulator-5554 (Pixel_API_26)")),(0,i.yg)("p",null,"The value will be ",(0,i.yg)("inlineCode",{parentName:"p"},"undefined")," until the device is properly ",(0,i.yg)("em",{parentName:"p"},"prepared")," (i.e. in ",(0,i.yg)("inlineCode",{parentName:"p"},"detox.init()"),")."),(0,i.yg)("h3",{id:"deviceapplaunchargs"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.appLaunchArgs")),(0,i.yg)("p",null,"Access the launch-arguments predefined by the user in preliminary, static scopes such as the Detox ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/apps"},"configuration file"),"\nand ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/cli/test"},"command-line arguments"),". This access allows, through dedicated methods, for both value-querying and modification:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"// Modify some of the predefined arguments:\ndevice.appLaunchArgs.modify({\n mockServerPort: 1234,\n});\n// Retrieve the arguments:\ndevice.appLaunchArgs.get(); // ==> { mockServerPort: 1234 }\n// Reset (i.e. remove all arguments):\ndevice.appLaunchArgs.reset();\n")),(0,i.yg)("p",null,"In multi-app environments, you might want to persist your values between ",(0,i.yg)("inlineCode",{parentName:"p"},"device.selectApp(name)")," calls:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"device.appLaunchArgs.modify({ transientArg: 'value' });\ndevice.appLaunchArgs.shared.modify({\n permanentMockServerPort: 1234,\n};\n\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234, transientArg: 'value' }\ndevice.appLaunchArgs.shared.get(); // ==> { permanentMockServerPort: 1234 }\n\nawait device.selectApp('anotherApp');\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.reset();\ndevice.appLaunchArgs.get(); // ==> { permanentMockServerPort: 1234 }\ndevice.appLaunchArgs.shared.reset();\ndevice.appLaunchArgs.get(); // ==> {}\n")),(0,i.yg)("p",null,"This is the most flexible way of editing the launch arguments. Refer to the ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/launch-args"},"launch arguments guide")," for complete details."),(0,i.yg)("h2",{id:"methods"},"Methods"),(0,i.yg)("h3",{id:"deviceselectappname"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.selectApp(name)")),(0,i.yg)("p",null,"Use ",(0,i.yg)("strong",{parentName:"p"},"only for advanced multi-app configs")," when you need to switch between your apps\nwithin the same test scenario. Refer to the ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/apps"},"configuration doc"),"\nto discover how to define multiple apps with different ",(0,i.yg)("inlineCode",{parentName:"p"},"name"),"s."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.selectApp('myAppName');\n")),(0,i.yg)("p",null,"As a side effect (due to the current architectural limitation) running ",(0,i.yg)("inlineCode",{parentName:"p"},"device.selectApp")," terminates the previous\napp that had been running before."),(0,i.yg)("h3",{id:"devicelaunchappparams"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.launchApp(params)")),(0,i.yg)("p",null,"Launch the app defined in the current ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/overview"},(0,i.yg)("inlineCode",{parentName:"a"},"configuration")),"."),(0,i.yg)("p",null,(0,i.yg)("inlineCode",{parentName:"p"},"params"),"\u2014object, containing one of more of the following keys and values:"),(0,i.yg)("h4",{id:"1-newinstancelaunching-a-new-instance-of-the-app"},"1. ",(0,i.yg)("inlineCode",{parentName:"h4"},"newInstance"),"\u2014Launching a New Instance of the App"),(0,i.yg)("p",null,"Terminate the app and launch it again."),(0,i.yg)("p",null,"If set to ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),", the device will try to resume the app (e.g. bring from foreground to background). If the app isn\u2019t running, ",(0,i.yg)("strong",{parentName:"p"},"it will launch a new instance")," nonetheless. ",(0,i.yg)("strong",{parentName:"p"},"Default is ",(0,i.yg)("inlineCode",{parentName:"strong"},"false"),".")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({newInstance: true});\n")),(0,i.yg)("h4",{id:"2-permissionsset-runtime-permissions-ios-only"},"2. ",(0,i.yg)("inlineCode",{parentName:"h4"},"permissions"),"\u2014Set Runtime Permissions (iOS Only)"),(0,i.yg)("p",null,"Grants or denies runtime permissions to your application. This will cause the app to terminate before permissions are applied."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({permissions: {calendar: 'YES'}});\n")),(0,i.yg)("p",null,"Detox uses ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/AppleSimulatorUtils"},"AppleSimUtils")," and ",(0,i.yg)("a",{parentName:"p",href:"https://nshipster.com/simctl/"},(0,i.yg)("inlineCode",{parentName:"a"},"xcrun simctl"))," to implement this functionality for iOS simulators.\nPlease make sure you have the most recent version of both tools installed, since we rely on their latest versions."),(0,i.yg)("h5",{id:"supported-permissions"},"Supported Permissions"),(0,i.yg)("table",null,(0,i.yg)("thead",{parentName:"table"},(0,i.yg)("tr",{parentName:"thead"},(0,i.yg)("th",{parentName:"tr",align:null},"Permission"),(0,i.yg)("th",{parentName:"tr",align:null},"Values"),(0,i.yg)("th",{parentName:"tr",align:null},"Notes"))),(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"location"),(0,i.yg)("td",{parentName:"tr",align:null},"always / inuse / never / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"inuse - provides location access only when the app is in use")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"contacts"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset / limited"),(0,i.yg)("td",{parentName:"tr",align:null},"limited - grants limited access to contacts")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"photos"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset / limited"),(0,i.yg)("td",{parentName:"tr",align:null},"limited - grants limited access to photos")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"calendar"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"camera"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"medialibrary"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"microphone"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"motion"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"reminders"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"siri"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null})),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"notifications"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"health"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"homekit"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"speech"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"faceid"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"userTracking"),(0,i.yg)("td",{parentName:"tr",align:null},"YES / NO / unset"),(0,i.yg)("td",{parentName:"tr",align:null},"Requires AppleSimUtils; unsupported by simctl")))),(0,i.yg)("p",null,"Check Detox's ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/blob/master/detox/test/e2e/13.permissions.test.js"},"own test suite")," for usage examples."),(0,i.yg)("h4",{id:"3-urllaunching-with-url"},"3. ",(0,i.yg)("inlineCode",{parentName:"h4"},"url"),"\u2014Launching with URL"),(0,i.yg)("p",null,"Launches the app with the specified URL to test your app\u2019s deep link handling mechanism."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({url});\nawait device.launchApp({url, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({url, newInstance: false}); // Reuse existing instance\n")),(0,i.yg)("p",null,"Read more ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-open-with-url"},"here"),". Go back to subsection 1 to read about the full effect of the ",(0,i.yg)("inlineCode",{parentName:"p"},"newInstance")," argument."),(0,i.yg)("h4",{id:"4-usernotificationlaunching-with-user-notifications"},"4. ",(0,i.yg)("inlineCode",{parentName:"h4"},"userNotification"),"\u2014Launching with User Notifications"),(0,i.yg)("p",null,"Launches with the specified user notification."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({userNotification});\nawait device.launchApp({userNotification, newInstance: true}); // Launch a new instance of the app\nawait device.launchApp({userNotification, newInstance: false}); // Reuse existing instance\n")),(0,i.yg)("p",null,"Read more ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-user-notifications"},"here"),". Go back to subsection 1 to read about the full effect of the ",(0,i.yg)("inlineCode",{parentName:"p"},"newInstance")," argument."),(0,i.yg)("h4",{id:"5-useractivitylaunch-with-user-activity-ios-only"},"5. ",(0,i.yg)("inlineCode",{parentName:"h4"},"userActivity"),"\u2014Launch with User Activity (iOS Only)"),(0,i.yg)("p",null,"Launches the app with the specified user activity."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({userActivity: activity});\nawait device.launchApp({userActivity: activity, newInstance: true}); //Launch a new instance of the app\nawait device.launchApp({userActivity: activity, newInstance: false}); //Reuse existing instance\n")),(0,i.yg)("p",null,"Read more in ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-user-activity"},"here"),". Go back to subsection 1 to read about the full effect of the ",(0,i.yg)("inlineCode",{parentName:"p"},"newInstance")," argument."),(0,i.yg)("h4",{id:"6-deletedelete-and-reinstall-application-before-launching"},"6. ",(0,i.yg)("inlineCode",{parentName:"h4"},"delete"),"\u2014Delete and Reinstall Application Before Launching"),(0,i.yg)("p",null,"Before launching the application, it is uninstalled and then reinstalled."),(0,i.yg)("p",null,"A flag that enables relaunching into a fresh installation of the app (it will uninstall and install the binary). Default is ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({delete: true});\n")),(0,i.yg)("h4",{id:"7-launchargsadditional-process-launch-arguments"},"7. ",(0,i.yg)("inlineCode",{parentName:"h4"},"launchArgs"),"\u2014Additional Process Launch Arguments"),(0,i.yg)("p",null,"Launches the app on the device with on-site, user-specified launch arguments:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},'await device.launchApp({\n launchArgs: {\n arg1: 1,\n arg2: "2",\n }\n});\n')),(0,i.yg)("p",null,"This is the most explicit and straightforward way of setting launch arguments. Refer to the ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/launch-args"},"launch arguments guide")," for a complete overview on app launch arguments."),(0,i.yg)("h4",{id:"8-disabletouchindicatorsdisable-touch-indicators-ios-only"},"8. ",(0,i.yg)("inlineCode",{parentName:"h4"},"disableTouchIndicators"),"\u2014Disable Touch Indicators (iOS Only)"),(0,i.yg)("p",null,"Disables touch indicators on iOS. Default is ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({disableTouchIndicators: true});\n")),(0,i.yg)("h4",{id:"9-languageandlocalelaunch-with-a-specific-language-andor-local-ios-only"},"9. ",(0,i.yg)("inlineCode",{parentName:"h4"},"languageAndLocale"),"\u2014Launch with a Specific Language and/or Local (iOS Only)"),(0,i.yg)("p",null,"Launch the app with a specific system language"),(0,i.yg)("p",null,"Information about accepted values can be found ",(0,i.yg)("a",{parentName:"p",href:"https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html"},"here"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},'await device.launchApp({\n languageAndLocale: {\n language: "es-MX",\n locale: "es-MX"\n }\n});\n')),(0,i.yg)("p",null,"With this API, you can run sets of E2E tests per language. For example:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"describe.each([\n ['es-MX'], ['fr-FR'], ['pt-BR'],\n])(`Test suite (locale: %s)`, (locale) => {\n beforeAll(async () => {\n await device.launchApp({\n newInstance: true,\n languageAndLocale: {\n language: locale,\n locale\n }\n });\n });\n\n test('some description', async () => {\n // \u2026\n });\n});\n")),(0,i.yg)("h4",{id:"10-detoxenablesynchronizationinitialize-detox-with-synchronization-enabled-or-disabled-at-app-launch"},"10. ",(0,i.yg)("inlineCode",{parentName:"h4"},"detoxEnableSynchronization"),"\u2014Initialize Detox with synchronization enabled or disabled at app launch"),(0,i.yg)("p",null,"Launches the app with the synchronization mechanism enabled or disabled. Useful if the app cannot be synchronized during the launch process. Synchronization can later be enabled using ",(0,i.yg)("inlineCode",{parentName:"p"},"device.enableSynchronization()"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({\n newInstance: true,\n launchArgs: { detoxEnableSynchronization: 0 }\n});\n")),(0,i.yg)("h4",{id:"11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch"},"11. ",(0,i.yg)("inlineCode",{parentName:"h4"},"detoxURLBlacklistRegex"),"\u2014Initialize the URL Blacklist at app launch"),(0,i.yg)("p",null,"Launches the app with a URL blacklist to disable network synchronization on certain endpoints.\nUseful if the app makes frequent network calls to blacklisted endpoints upon startup."),(0,i.yg)("blockquote",null,(0,i.yg)("p",{parentName:"blockquote"},"Note that due to the complexity of reg-exps and interoperability concerns, the implementation is fairly sensitive to the format of the string of urls.\nPlease do your best to follow the example below:")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},'await device.launchApp({\n newInstance: true,\n launchArgs: { detoxURLBlacklistRegex: \'\\\\("^http://192\\.168\\.1\\.253:\\\\d{4}/.*","https://e\\.crashlytics\\.com/spi/v2/events"\\\\)\' },\n});\n')),(0,i.yg)("h4",{id:"12-detoxdisablewebkitsecuritydisable-webkit-security-ios-only"},"12. ",(0,i.yg)("inlineCode",{parentName:"h4"},"detoxDisableWebKitSecurity"),"\u2014Disable WebKit Security (iOS Only)"),(0,i.yg)("p",null,"Disables WebKit security on iOS. Default is ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),"."),(0,i.yg)("p",null,"This is useful for testing web views with iframes that loads CORS-protected content."),(0,i.yg)("admonition",{title:"Important",type:"caution"},(0,i.yg)("p",{parentName:"admonition"},"Some pages may not load correctly when WebKit security is disabled (for example, PCI DSS-compliant pages).\nDisabling WebKit security may cause errors when loading pages that have strict security policies.")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.launchApp({\n launchArgs: { detoxDisableWebKitSecurity: true }\n});\n")),(0,i.yg)("h3",{id:"deviceterminateapp"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.terminateApp()")),(0,i.yg)("p",null,"By default, ",(0,i.yg)("inlineCode",{parentName:"p"},"terminateApp()")," with no params will terminate the app file defined in the current ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/overview"},(0,i.yg)("inlineCode",{parentName:"a"},"configuration")),"."),(0,i.yg)("p",null,"To terminate another app, specify its bundle id"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.terminateApp('other.bundle.id');\n")),(0,i.yg)("h3",{id:"devicesendtohome"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.sendToHome()")),(0,i.yg)("p",null,"Send application to background by bringing ",(0,i.yg)("inlineCode",{parentName:"p"},"com.apple.springboard")," to the foreground.\nCombining ",(0,i.yg)("inlineCode",{parentName:"p"},"sendToHome()")," with ",(0,i.yg)("inlineCode",{parentName:"p"},"launchApp({newInstance: false})")," will simulate app coming back from background.\nCheck out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js"},"own test suite")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.sendToHome();\nawait device.launchApp({newInstance: false});\n// app returned from background, do stuff\n")),(0,i.yg)("p",null,"Check out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device.test.js"},"own test suite")),(0,i.yg)("h3",{id:"devicereloadreactnative"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.reloadReactNative()")),(0,i.yg)("p",null,"If this is a React Native app, reload the React Native JS bundle. This action is much faster than ",(0,i.yg)("inlineCode",{parentName:"p"},"device.launchApp()"),", and can be used if you just need to reset your React Native logic."),(0,i.yg)("i",null,"**Note:** This functionality does not work without faults. Under certain conditions, the system may not behave as expected and/or even crash. In these cases, use `device.launchApp()` to launch the app cleanly instead of only reloading the JS bundle."),(0,i.yg)("h3",{id:"deviceinstallapp"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.installApp()")),(0,i.yg)("p",null,"By default, ",(0,i.yg)("inlineCode",{parentName:"p"},"installApp()")," with no params will install the app file defined in the current ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/overview"},(0,i.yg)("inlineCode",{parentName:"a"},"configuration")),"."),(0,i.yg)("p",null,"To install another app, specify its path"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.installApp('path/to/other/app');\n")),(0,i.yg)("h3",{id:"deviceuninstallapp"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.uninstallApp()")),(0,i.yg)("p",null,"By default, ",(0,i.yg)("inlineCode",{parentName:"p"},"uninstallApp()")," with no params will uninstall the app defined in the current ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/config/overview"},(0,i.yg)("inlineCode",{parentName:"a"},"configuration")),"."),(0,i.yg)("p",null,"To uninstall another app, specify its bundle id"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.uninstallApp('other.bundle.id');\n")),(0,i.yg)("h3",{id:"deviceopenurlurl-sourceappoptional"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.openURL({url, sourceApp[optional]})")),(0,i.yg)("p",null,"Mock opening the app from URL. ",(0,i.yg)("inlineCode",{parentName:"p"},"sourceApp")," is an optional ",(0,i.yg)("strong",{parentName:"p"},"iOS-only")," parameter to specify source application bundle id."),(0,i.yg)("p",null,"Read more in ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-open-with-url"},"Mocking Open with URL")," section.\nCheck out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/15.urls.test.js"},"own test suite")),(0,i.yg)("h3",{id:"devicesendusernotificationparams"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.sendUserNotification(params)")),(0,i.yg)("p",null,"Mock handling of a user notification previously received in the system, while the app is already running."),(0,i.yg)("p",null,"Read more in ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-user-notifications"},"Mocking User Notifications")," section.\nCheck out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/11.user-notifications.test.js"},"own test suite")),(0,i.yg)("h3",{id:"devicesenduseractivityparams-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.sendUserActivity(params)")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Mock handling of received user activity when app is in foreground.\nRead more in ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/mocking-user-activity"},"Mocking User Activity")," section.\nCheck out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/18.user-activities.test.js"},"own test suite")),(0,i.yg)("h3",{id:"devicesetorientationorientation"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setOrientation(orientation)")),(0,i.yg)("p",null,"Takes ",(0,i.yg)("inlineCode",{parentName:"p"},'"portrait"')," or ",(0,i.yg)("inlineCode",{parentName:"p"},'"landscape"')," and rotates the device to the given orientation."),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"Note:")," Setting device orientation is only supported for iPhone devices, or for apps declared as requiring full screen on iPad. For all other cases, the current test will be failed."),(0,i.yg)("p",null,"Check out Detox\u2019s ",(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/test/e2e/06.device-orientation.test.js"},"own test suite.")),(0,i.yg)("h3",{id:"devicesetlocationlat-lon"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setLocation(lat, lon)")),(0,i.yg)("p",null,"Sets the simulator/emulator location to the given latitude and longitude."),(0,i.yg)("blockquote",null,(0,i.yg)("p",{parentName:"blockquote"},"On iOS ",(0,i.yg)("inlineCode",{parentName:"p"},"setLocation")," depends on ",(0,i.yg)("inlineCode",{parentName:"p"},"xcrun simctl"),", and we recommend using its latest version."),(0,i.yg)("p",{parentName:"blockquote"},"On Android ",(0,i.yg)("inlineCode",{parentName:"p"},"setLocation")," will work with both Android Emulator (bundled with Android development tools) and Genymotion. The correct permissions must be set in your app manifest.")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.setLocation(32.0853, 34.7818);\n")),(0,i.yg)("h3",{id:"devicedisablesynchronization"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.disableSynchronization()")),(0,i.yg)("p",null,"Temporarily disable synchronization (idle/busy monitoring) with the app - namely, stop waiting for the app to go idle before moving forward in the test execution."),(0,i.yg)("p",null,"This API is useful for cases where test assertions must be made in an area of your application where it is okay for it to ever remain partly ",(0,i.yg)("em",{parentName:"p"},"busy")," (e.g. due to an endlessly repeating on-screen animation).\nHowever, using it inherently suggests that you are likely to resort to applying ",(0,i.yg)("inlineCode",{parentName:"p"},"sleep()"),"\u2019s in your test code - testing that area, ",(0,i.yg)("strong",{parentName:"p"},"which is not recommended and can never be 100% stable."),' Therefore, as a rule of thumb, test code running "inside" a sync-disabled mode must be reduced to the bare minimum.'),(0,i.yg)("p",null,"Note: Synchronization is enabled by default, and it gets ",(0,i.yg)("strong",{parentName:"p"},"re-enabled on every launch of a new instance of the app.")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.disableSynchronization();\n")),(0,i.yg)("h3",{id:"deviceenablesynchronization"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.enableSynchronization()")),(0,i.yg)("p",null,"Re-enable synchronization (idle/busy monitoring) with the app - namely, resume waiting for the app to go idle before moving forward in the test execution, after a previous disabling of it through a call to ",(0,i.yg)("inlineCode",{parentName:"p"},"device.disableSynchronization()"),"."),(0,i.yg)("p",null,"\u26a0\ufe0f Note: Making this call would resume synchronization ",(0,i.yg)("strong",{parentName:"p"},"instantly"),", having its returned promise only resolve when the app becomes idle again. In other words, this ",(0,i.yg)("strong",{parentName:"p"},'must only be called after you navigate back to "the safe zone", where the app should be able to eventually become idle again'),', or it would remain suspended "forever" (i.e. until a safeguard time-out expires).'),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.enableSynchronization();\n")),(0,i.yg)("h3",{id:"deviceseturlblacklisturls"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setURLBlacklist([urls])")),(0,i.yg)("p",null,"Exclude synchronization with respect to network activity (i.e. don\u2019t wait for network to go idle before moving forward in the test execution) according to ",(0,i.yg)("strong",{parentName:"p"},"specific")," endpoints, denoted as URL reg-exp\u2019s. To disable endpoints at initialization, pass in the black-list as an ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/launch-args"},"app-launch argument")," named ",(0,i.yg)("inlineCode",{parentName:"p"},"detoxURLBlacklistRegex")," (as explained ",(0,i.yg)("a",{parentName:"p",href:"#11-detoxurlblacklistregexinitialize-the-url-blacklist-at-app-launch"},"here"),")."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.setURLBlacklist(['.*127.0.0.1.*', '.*my.ignored.endpoint.*']);\n")),(0,i.yg)("h3",{id:"deviceresetcontentandsettings-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.resetContentAndSettings()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Resets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing\npreviously set permissions."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.resetContentAndSettings();\n")),(0,i.yg)("h3",{id:"devicegetplatform"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.getPlatform()")),(0,i.yg)("p",null,"Returns the current device, ",(0,i.yg)("inlineCode",{parentName:"p"},"ios")," or ",(0,i.yg)("inlineCode",{parentName:"p"},"android"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"if (device.getPlatform() === 'ios') {\n await expect(loopSwitch).toHaveValue('1');\n}\n")),(0,i.yg)("h3",{id:"devicetakescreenshotname"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.takeScreenshot([name])")),(0,i.yg)("p",null,"Takes a screenshot of the device. For full details on taking screenshots with Detox, refer to the ",(0,i.yg)("a",{parentName:"p",href:"/Detox/docs/guide/taking-screenshots"},"screen-shots guide"),"."),(0,i.yg)("h3",{id:"devicecaptureviewhierarchyname"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.captureViewHierarchy([name])")),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"iOS Only.")," Saves a view hierarchy snapshot (",(0,i.yg)("inlineCode",{parentName:"p"},"*.viewhierarchy"),") of the\ncurrently opened application to a temporary folder and schedules putting it to\nthe artifacts' folder upon the completion of the current test. The file can be\nopened later in Xcode 12.0 and above.\nSee ",(0,i.yg)("a",{parentName:"p",href:"https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes#:~:text=57933113"},"Xcode 12 Release notes: #57933113"),"\nfor more details."),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"name")," parameter is optional \u2014\xa0by default, it equals to ",(0,i.yg)("inlineCode",{parentName:"p"},"capture"),"."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"test('Capture view hierarchy', async () => {\n const temporaryArtifactPath = await device.captureViewHierarchy('myElements');\n\n // The temporary path will remain valid until the test completion.\n // Afterwards, the artifact will be moved, e.g.:\n // * on success, to: /\u2713 Capture view hierarchy/myElements.viewhierarchy\n // * on failure, to: /\u2717 Capture view hierarchy/myElements.viewhierarchy\n});\n")),(0,i.yg)("h3",{id:"devicegenerateviewhierarchyxmlshouldinjecttestids"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.generateViewHierarchyXml([shouldInjectTestIds])")),(0,i.yg)("p",null,"Generates a view hierarchy XML of the currently opened application. The XML is returned as a string."),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"shouldInjectTestIds")," parameter is optional and defaults to ",(0,i.yg)("inlineCode",{parentName:"p"},"false"),". When set to ",(0,i.yg)("inlineCode",{parentName:"p"},"true"),", Detox will attempt to inject ",(0,i.yg)("inlineCode",{parentName:"p"},"testID")," attributes into the XML for each element if undefined."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"const viewHierarchyXml = await device.generateViewHierarchyXml();\n")),(0,i.yg)("h3",{id:"deviceshake-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.shake()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulate shake"),(0,i.yg)("h3",{id:"devicesetbiometricenrollmentbool-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setBiometricEnrollment(bool)")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Toggles device enrollment in biometric authentication (Touch ID or Face ID)."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.setBiometricEnrollment(true);\n// or\nawait device.setBiometricEnrollment(false);\n")),(0,i.yg)("h3",{id:"devicematchface-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.matchFace()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulates the success of a face match via Face ID"),(0,i.yg)("h3",{id:"deviceunmatchface-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.unmatchFace()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulates the failure of face match via Face ID"),(0,i.yg)("h3",{id:"devicematchfinger-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.matchFinger()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulates the success of a finger match via Touch ID"),(0,i.yg)("h3",{id:"deviceunmatchfinger-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.unmatchFinger()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Simulates the failure of a finger match via Touch ID"),(0,i.yg)("h3",{id:"deviceclearkeychain-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.clearKeychain()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Clears the device keychain"),(0,i.yg)("h3",{id:"devicesetstatusbar-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.setStatusBar()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Override simulator\u2019s status bar. Available options:"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.setStatusBar({\n time: \"12:34\",\n // Set the date or time to a fixed value.\n // If the string is a valid ISO date string it will also set the date on relevant devices.\n dataNetwork: \"wifi\",\n // If specified must be one of 'hide', 'wifi', '3g', '4g', 'lte', 'lte-a', 'lte+', '5g', '5g+', '5g-uwb', or '5g-uc'.\n wifiMode: \"failed\",\n // If specified must be one of 'searching', 'failed', or 'active'.\n wifiBars: \"2\",\n // If specified must be 0-3.\n cellularMode: \"searching\",\n // If specified must be one of 'notSupported', 'searching', 'failed', or 'active'.\n cellularBars: \"3\",\n // If specified must be 0-4.\n operatorName: \"A1\",\n // Set the cellular operator/carrier name. Use '' for the empty string.\n batteryState: \"charging\",\n // If specified must be one of 'charging', 'charged', or 'discharging'.\n batteryLevel: \"50\",\n // If specified must be 0-100.\n});\n")),(0,i.yg)("h3",{id:"deviceresetstatusbar-ios-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.resetStatusBar()")," ",(0,i.yg)("strong",{parentName:"h3"},"iOS Only")),(0,i.yg)("p",null,"Resets any override in simulator\u2019s status bar."),(0,i.yg)("h3",{id:"devicereversetcpport-android-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.reverseTcpPort()")," ",(0,i.yg)("strong",{parentName:"h3"},"Android Only")),(0,i.yg)("p",null,"Reverse a TCP port from the device (guest) back to the host-computer, as typically done with the ",(0,i.yg)("inlineCode",{parentName:"p"},"adb reverse")," command. The end result would be that all network requests going from the device to the specified port will be forwarded to the computer."),(0,i.yg)("h3",{id:"deviceunreversetcpport-android-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.unreverseTcpPort()")," ",(0,i.yg)("strong",{parentName:"h3"},"Android Only")),(0,i.yg)("p",null,"Clear a ",(0,i.yg)("em",{parentName:"p"},"reversed")," TCP-port (e.g. previously set using ",(0,i.yg)("inlineCode",{parentName:"p"},"device.reverseTcpPort()"),")."),(0,i.yg)("h3",{id:"devicepressback-android-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.pressBack()")," ",(0,i.yg)("strong",{parentName:"h3"},"Android Only")),(0,i.yg)("p",null,"Simulate press back button."),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-js"},"await device.pressBack();\n")),(0,i.yg)("h3",{id:"devicegetuidevice-android-only"},(0,i.yg)("inlineCode",{parentName:"h3"},"device.getUiDevice()")," ",(0,i.yg)("strong",{parentName:"h3"},"Android Only")),(0,i.yg)("p",null,"Exposes ",(0,i.yg)("a",{parentName:"p",href:"https://developer.android.com/reference/androidx/test/uiautomator/UiDevice"},(0,i.yg)("inlineCode",{parentName:"a"},"UiAutomator"),"\u2019s ",(0,i.yg)("inlineCode",{parentName:"a"},"UiDevice")," API"),".\n",(0,i.yg)("strong",{parentName:"p"},"This is not a part of the official Detox API"),", it may break and change whenever an update to ",(0,i.yg)("inlineCode",{parentName:"p"},"UiDevice")," or ",(0,i.yg)("inlineCode",{parentName:"p"},"UiAutomator")," Gradle dependencies (",(0,i.yg)("inlineCode",{parentName:"p"},"androidx.test.uiautomator:uiautomator"),") is introduced."),(0,i.yg)("p",null,(0,i.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox/tree/a9a09246c05733f6b91cfcc0dba05a4714abca92/detox/src/android/espressoapi/UIDevice.js"},(0,i.yg)("inlineCode",{parentName:"a"},"UiDevice"),"\u2019s autogenerated code")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/63371bf1.a72526cb.js b/assets/js/63371bf1.56f4aa99.js similarity index 65% rename from assets/js/63371bf1.a72526cb.js rename to assets/js/63371bf1.56f4aa99.js index 8356a3e561..27b79b4775 100644 --- a/assets/js/63371bf1.a72526cb.js +++ b/assets/js/63371bf1.56f4aa99.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9118],{15680:(e,t,r)=>{r.d(t,{xA:()=>u,yg:()=>m});var o=r(96540);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function a(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var l=o.createContext({}),c=function(e){var t=o.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},u=function(e){var t=c(e.components);return o.createElement(l.Provider,{value:t},e.children)},p="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},g=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=c(r),g=n,m=p["".concat(l,".").concat(g)]||p[g]||d[g]||i;return r?o.createElement(m,a(a({ref:t},u),{},{components:r})):o.createElement(m,a({ref:t},u))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,a=new Array(i);a[0]=g;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:n,a[1]=s;for(var c=2;c{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var o=r(58168),n=(r(96540),r(15680));const i={sidebar_label:"Overview"},a="Code Changes Overview",s={unversionedId:"contributing/code/overview",id:"version-20.x/contributing/code/overview",title:"Code Changes Overview",description:"Welcome to the code changes section! As a contributor, it's essential to understand the project's goals and adhere to its code of conduct. Before contributing, please review any existing issues related to your work, ensure your code is well-documented, and has adequate test coverage. It's also important that your code is compatible with the project's supported platforms and their versions.",source:"@site/versioned_docs/version-20.x/contributing/code/overview.md",sourceDirName:"contributing/code",slug:"/contributing/code/overview",permalink:"/Detox/docs/contributing/code/overview",draft:!1,editUrl:"https://github.com/wix/Detox/edit/master/docs/versioned_docs/version-20.x/contributing/code/overview.md",tags:[],version:"20.x",frontMatter:{sidebar_label:"Overview"},sidebar:"contributeSidebar",previous:{title:"Feedback and Suggestions",permalink:"/Detox/docs/contributing/feature-requests"},next:{title:"Setting up the Development Environment",permalink:"/Detox/docs/contributing/code/setting-up-the-dev-environment"}},l={},c=[{value:"Repository Structure",id:"repository-structure",level:2}],u={toc:c},p="wrapper";function d(e){let{components:t,...r}=e;return(0,n.yg)(p,(0,o.A)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("h1",{id:"code-changes-overview"},"Code Changes Overview"),(0,n.yg)("p",null,"Welcome to the code changes section! As a contributor, it's essential to understand the project's goals and adhere to its code of conduct. Before contributing, please review any existing issues related to your work, ensure your code is well-documented, and has adequate test coverage. It's also important that your code is compatible with the project's supported platforms and their versions."),(0,n.yg)("p",null,"Our collaborative workflow is simple:"),(0,n.yg)("ol",null,(0,n.yg)("li",{parentName:"ol"},(0,n.yg)("strong",{parentName:"li"},"Identify an Issue:")," If not exists already, create an issue for new features or bug reports, outlining your proposal or the identified problem."),(0,n.yg)("li",{parentName:"ol"},(0,n.yg)("strong",{parentName:"li"},"Propose a Solution:")," Open a pull request with a proposed solution to the issue. On complex issues, it's recommended to discuss your approach with the community and maintainers before submitting a PR."),(0,n.yg)("li",{parentName:"ol"},(0,n.yg)("strong",{parentName:"li"},"Engage in Review:")," A collaborator will review your pull request. Reviews from other contributors are also encouraged."),(0,n.yg)("li",{parentName:"ol"},(0,n.yg)("strong",{parentName:"li"},"Merge and Release:")," After the review, a collaborator will merge your contribution, typically releasing it in the next version of the project.")),(0,n.yg)("p",null,"We use ",(0,n.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox"},"GitHub")," for managing pull requests, conducting code reviews, and tracking issues."),(0,n.yg)("p",null,"The code review process is central to our collaboration. Every contribution must go through a review before merging to maintain the quality of our codebase. As a contributor, being willing to discuss your work, respond to feedback, and work with the community is key to improving the project and creating a positive environment for all contributors."),(0,n.yg)("h2",{id:"repository-structure"},"Repository Structure"),(0,n.yg)("p",null,"Our GitHub repository is a monorepo, which means it contains multiple Detox-related projects and packages."),(0,n.yg)("p",null,"The main package is the Detox framework, which is the core of the project.\nIt contains the native code for iOS and Android, as well as the JavaScript code.\nThe other projects are the Detox CLI, the Detox test app, example apps, and the Detox documentation website."),(0,n.yg)("p",null,"Here's a high-level overview of the repository structure:"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"detox-cli")," - The CLI for Detox (e.g., ",(0,n.yg)("inlineCode",{parentName:"li"},"detox init"),", ",(0,n.yg)("inlineCode",{parentName:"li"},"detox test"),", read more about our ",(0,n.yg)("a",{parentName:"li",href:"/Detox/docs/cli/overview"},"CLI docs"),")"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"detox")," - The Detox framework",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"android")," - The Android native code, alongside native unit tests"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"ios")," - The iOS native code, including its native submodules (e.g., DetoxSync)"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"test")," - The Detox self-test app: A full-feature React Native app for end-to-end testing Detox itself",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"src")," - The app's JavaScript code"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"e2e")," - The Detox self-tests"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"integration")," - Detox integration self-tests"))),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"local-cli")," - Local CLI commands for Detox development (e.g., ",(0,n.yg)("inlineCode",{parentName:"li"},"detox rebuild-framework-cache"),", which rebuilds the iOS framework)"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"runners")," - The Detox runners, which are used to run the tests"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"scripts")," - Scripts for building the framework for publishing"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"src")," - The JavaScript source code of Detox. The include bundled JavaScript unit tests"))),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"website")," - The documentation website of Detox (read more about our ",(0,n.yg)("a",{parentName:"li",href:"/Detox/docs/contributing/documentation"},"documentation site docs"),")"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"docs")," - The documentation of Detox, written in Markdown and published on the website"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"examples")," - Example apps for Detox (for more information, check the ",(0,n.yg)("a",{parentName:"li",href:"/Detox/docs/contributing/code/example-projects"},"list of example projects"),")"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"scripts")," - Scripts for building and testing Detox")))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9118],{15680:(e,t,r)=>{r.d(t,{xA:()=>u,yg:()=>m});var o=r(96540);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function a(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var l=o.createContext({}),c=function(e){var t=o.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},u=function(e){var t=c(e.components);return o.createElement(l.Provider,{value:t},e.children)},p="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},d=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=c(r),d=n,m=p["".concat(l,".").concat(d)]||p[d]||g[d]||i;return r?o.createElement(m,a(a({ref:t},u),{},{components:r})):o.createElement(m,a({ref:t},u))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,a=new Array(i);a[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[p]="string"==typeof e?e:n,a[1]=s;for(var c=2;c{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>g,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var o=r(58168),n=(r(96540),r(15680));const i={sidebar_label:"Overview"},a="Code Changes Overview",s={unversionedId:"contributing/code/overview",id:"version-20.x/contributing/code/overview",title:"Code Changes Overview",description:"Welcome to the code changes section! As a contributor, it's essential to understand the project's goals and adhere to its code of conduct. Before contributing, please review any existing issues related to your work, ensure your code is well-documented, and has adequate test coverage. It's also important that your code is compatible with the project's supported platforms and their versions.",source:"@site/versioned_docs/version-20.x/contributing/code/overview.md",sourceDirName:"contributing/code",slug:"/contributing/code/overview",permalink:"/Detox/docs/contributing/code/overview",draft:!1,editUrl:"https://github.com/wix/Detox/edit/master/docs/versioned_docs/version-20.x/contributing/code/overview.md",tags:[],version:"20.x",frontMatter:{sidebar_label:"Overview"},sidebar:"contributeSidebar",previous:{title:"Feedback and Suggestions",permalink:"/Detox/docs/contributing/feature-requests"},next:{title:"Setting up the Development Environment",permalink:"/Detox/docs/contributing/code/setting-up-the-dev-environment"}},l={},c=[{value:"Repository Structure",id:"repository-structure",level:2}],u={toc:c},p="wrapper";function g(e){let{components:t,...r}=e;return(0,n.yg)(p,(0,o.A)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("h1",{id:"code-changes-overview"},"Code Changes Overview"),(0,n.yg)("p",null,"Welcome to the code changes section! As a contributor, it's essential to understand the project's goals and adhere to its code of conduct. Before contributing, please review any existing issues related to your work, ensure your code is well-documented, and has adequate test coverage. It's also important that your code is compatible with the project's supported platforms and their versions."),(0,n.yg)("p",null,"Our collaborative workflow is simple:"),(0,n.yg)("ol",null,(0,n.yg)("li",{parentName:"ol"},(0,n.yg)("strong",{parentName:"li"},"Identify an Issue:")," If not exists already, create an issue for new features or bug reports, outlining your proposal or the identified problem."),(0,n.yg)("li",{parentName:"ol"},(0,n.yg)("strong",{parentName:"li"},"Propose a Solution:")," Open a pull request with a proposed solution to the issue. On complex issues, it's recommended to discuss your approach with the community and maintainers before submitting a PR."),(0,n.yg)("li",{parentName:"ol"},(0,n.yg)("strong",{parentName:"li"},"Engage in Review:")," A collaborator will review your pull request. Reviews from other contributors are also encouraged."),(0,n.yg)("li",{parentName:"ol"},(0,n.yg)("strong",{parentName:"li"},"Merge and Release:")," After the review, a collaborator will merge your contribution, typically releasing it in the next version of the project.")),(0,n.yg)("p",null,"We use ",(0,n.yg)("a",{parentName:"p",href:"https://github.com/wix/Detox"},"GitHub")," for managing pull requests, conducting code reviews, and tracking issues."),(0,n.yg)("p",null,"The code review process is central to our collaboration. Every contribution must go through a review before merging to maintain the quality of our codebase. As a contributor, being willing to discuss your work, respond to feedback, and work with the community is key to improving the project and creating a positive environment for all contributors."),(0,n.yg)("h2",{id:"repository-structure"},"Repository Structure"),(0,n.yg)("p",null,"Our GitHub repository is a monorepo, which means it contains multiple Detox-related projects and packages."),(0,n.yg)("p",null,"The main package is the Detox framework, which is the core of the project.\nIt contains the native code for iOS and Android, as well as the JavaScript code.\nThe other projects are the Detox CLI, the Detox test app, example apps, and the Detox documentation website."),(0,n.yg)("p",null,"Here's a high-level overview of the repository structure:"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"detox-cli")," - The CLI for Detox (e.g., ",(0,n.yg)("inlineCode",{parentName:"li"},"detox init"),", ",(0,n.yg)("inlineCode",{parentName:"li"},"detox test"),", read more about our ",(0,n.yg)("a",{parentName:"li",href:"/Detox/docs/cli/overview"},"CLI docs"),")"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"detox-copilot")," - Detox plugin that leverages large language models (LLM) to seamlessly invoke Detox actions (",(0,n.yg)("strong",{parentName:"li"},"work in progress"),")"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"detox")," - The Detox framework",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"android")," - The Android native code, alongside native unit tests"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"ios")," - The iOS native code, including its native submodules (e.g., DetoxSync)"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"test")," - The Detox self-test app: A full-feature React Native app for end-to-end testing Detox itself",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"src")," - The app's JavaScript code"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"e2e")," - The Detox self-tests"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"integration")," - Detox integration self-tests"))),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"local-cli")," - Local CLI commands for Detox development (e.g., ",(0,n.yg)("inlineCode",{parentName:"li"},"detox rebuild-framework-cache"),", which rebuilds the iOS framework)"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"runners")," - The Detox runners, which are used to run the tests"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"scripts")," - Scripts for building the framework for publishing"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"src")," - The JavaScript source code of Detox. The include bundled JavaScript unit tests"))),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"website")," - The documentation website of Detox (read more about our ",(0,n.yg)("a",{parentName:"li",href:"/Detox/docs/contributing/documentation"},"documentation site docs"),")"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"docs")," - The documentation of Detox, written in Markdown and published on the website"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"examples")," - Example apps for Detox (for more information, check the ",(0,n.yg)("a",{parentName:"li",href:"/Detox/docs/contributing/code/example-projects"},"list of example projects"),")"),(0,n.yg)("li",{parentName:"ul"},"\ud83d\udcc1 ",(0,n.yg)("strong",{parentName:"li"},"scripts")," - Scripts for building and testing Detox")))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.1d2f4a15.js b/assets/js/runtime~main.1c26fd2c.js similarity index 99% rename from assets/js/runtime~main.1d2f4a15.js rename to assets/js/runtime~main.1c26fd2c.js index 45eeea5362..8e385ed07d 100644 --- a/assets/js/runtime~main.1d2f4a15.js +++ b/assets/js/runtime~main.1c26fd2c.js @@ -1 +1 @@ -(()=>{"use strict";var e,f,a,d,c,b={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var a=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=b,e=[],r.O=(f,a,d,c)=>{if(!a){var b=1/0;for(i=0;i=c)&&Object.keys(r.O).every((e=>r.O[e](a[o])))?a.splice(o--,1):(t=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[a,d,c]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var c=Object.create(null);r.r(c);var b={};f=f||[null,a({}),a([]),a(a)];for(var t=2&d&&e;"object"==typeof t&&!~f.indexOf(t);t=a(t))Object.getOwnPropertyNames(t).forEach((f=>b[f]=()=>e[f]));return b.default=()=>e,r.d(c,b),c},r.d=(e,f)=>{for(var a in f)r.o(f,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((f,a)=>(r.f[a](e,f),f)),[])),r.u=e=>"assets/js/"+({2:"18fc5556",53:"fe23c957",68:"268dddcf",96:"121cced5",99:"0a2b2829",123:"3bc305d8",178:"861bdbb6",187:"45e366b7",235:"85c7de33",289:"9a6ca8b8",298:"a4761f6f",323:"cb38042d",332:"e6cdcb35",347:"6fb4057b",456:"e9d07a0a",577:"d9894068",612:"b1c3f2c7",641:"86a9c212",643:"20110cf9",656:"d8b689b0",682:"1373a77b",708:"9509e94f",770:"df0b489b",1079:"1c545b73",1138:"96997528",1211:"26368098",1218:"5bc90040",1274:"f02f7df4",1513:"8ab53c77",1533:"9a34b858",1539:"3fb5a56d",1581:"328083ea",1700:"fc9f0a8f",1707:"f431fa1f",1839:"66491fb6",1874:"5fc994c2",1987:"ecfe08ed",1998:"5133b137",2043:"4e8770ad",2068:"5d002dae",2083:"3d4c33f6",2120:"2dcc617a",2124:"0d1d5dba",2138:"1a4e3797",2141:"933bed1e",2154:"9017a355",2247:"af67069a",2269:"3f859f05",2270:"c62bfd53",2338:"7b8d824d",2373:"7a99341f",2377:"38bf2aac",2419:"9eb50243",2438:"4afa4b8a",2459:"649c4fa3",2460:"37fdb427",2496:"85addd09",2525:"d350cff3",2581:"dc701447",2634:"c4f5d8e4",2661:"435645a6",2698:"373c35af",2707:"c50db514",2711:"9e4087bc",2905:"ddab1e1f",2920:"398b3246",2965:"3e7ee0fc",3010:"a55aca30",3015:"0e97a833",3022:"e6bddadc",3103:"f2f4b8a7",3119:"f14c3b1d",3134:"e432d2f9",3150:"090a441b",3182:"6e1398c4",3206:"74a579df",3249:"ccc49370",3360:"c12557ec",3372:"b49de2ad",3379:"f97fefc4",3392:"0ef19a76",3414:"04d1378b",3421:"bab8a798",3486:"cae448e5",3559:"4898f926",3671:"3f3efe2b",3818:"7358fe14",3833:"c262e01e",3890:"06556991",3892:"24602229",3894:"120e2fab",3995:"beec6c9a",4005:"155ec335",4034:"fa42474c",4078:"e8bfc54f",4099:"bc243f9c",4122:"c8447d5b",4196:"f9078c13",4203:"9338ecde",4216:"50214cd4",4261:"66c89031",4324:"9b67fd78",4368:"ef7da448",4480:"4d2064e8",4511:"a6860cb2",4557:"c74a7097",4651:"040764b7",4778:"a622d695",4813:"6875c492",4871:"85a74db3",4879:"00424e3f",4930:"3f50474f",5104:"2ec4e639",5110:"ddb15f76",5210:"4a184f52",5235:"b48043f7",5333:"743699a6",5351:"df5bc064",5403:"684e0aea",5458:"5125c427",5465:"d389a7b2",5484:"30a967f3",5564:"5fcf77d7",5599:"3abc4359",5763:"851303a1",5844:"329947da",5928:"ae694851",5992:"3c59129e",6002:"6781c826",6044:"cd796466",6101:"750255a9",6104:"8e7c33d6",6291:"1ee22d16",6388:"c7632c1f",6417:"79ac7843",6461:"c83bcda6",6527:"32a9b7bf",6618:"a8a1de49",6643:"289d965c",6646:"e453af6e",6769:"1a01fdf1",6887:"19ee85cd",6913:"41e12717",6938:"b80a1ac9",6941:"f98b7248",6990:"8f43d633",7024:"0f6ee85b",7056:"40113ee6",7109:"54c48e38",7126:"5e26652b",7153:"6af18994",7243:"5a9cd6fb",7308:"48c4a2a0",7321:"23a61782",7360:"af952e90",7367:"ea7b1b31",7472:"814f3328",7473:"7accbb75",7529:"90ca9965",7577:"5b12c1a9",7583:"af558054",7606:"9f23071e",7608:"2d84255a",7619:"478bcf42",7643:"a6aa9e1f",7696:"3974811d",7714:"170ab94c",7715:"0b72a6ff",7742:"dcfd3b61",7746:"7dcc0419",7761:"ba1e31c2",7813:"656a21b7",7839:"7d2f6bd9",7846:"dd5377a3",7886:"865d1447",7899:"5bfbde57",7900:"4c76b531",7924:"0a02aff3",8160:"2aa9b0dd",8209:"01a85c17",8221:"40e30cb7",8245:"d9683343",8271:"b9d5de69",8401:"17896441",8455:"eb35abdd",8460:"fc323215",8476:"f6b2bbb1",8519:"7c823085",8560:"0970ca0c",8581:"935f2afb",8620:"1c323773",8634:"b6072cb9",8641:"3498d2db",8758:"f164116d",8768:"881ac13d",8795:"e237dedf",8839:"ea9c95e7",8877:"dbe4f0b7",8881:"3b089002",8952:"2cf03b61",9034:"9292650b",9118:"63371bf1",9120:"df8c2417",9304:"04c33c1d",9342:"7c97e9a2",9437:"17f9232f",9515:"5d2f6d16",9543:"4aba33e7",9582:"80f9953e",9585:"0b851b4d",9591:"1d245f66",9592:"5eff386f",9679:"239f6efa",9685:"181d712d",9812:"f999fa4a",9966:"0c7edd3c"}[e]||e)+"."+{2:"1f27e26a",53:"643705c4",68:"0d2ec23e",96:"faf569c2",99:"edd83f34",123:"1b9fa380",178:"280b9b1f",187:"f3d8b74a",235:"10138825",289:"4abf637f",298:"25266a56",323:"ee0f3976",332:"51e9bf3e",347:"7f4ce9c1",416:"05118c27",456:"093d089d",577:"be77af72",612:"a166cb62",641:"f6191334",643:"41d49cce",656:"e52bc8b4",682:"66d33fde",708:"db909afe",770:"901aae8b",1079:"7080559a",1138:"824b22b0",1211:"9b939b14",1218:"e7c74c88",1274:"35244da2",1513:"2c82f68a",1533:"fca19837",1539:"ae853ff9",1581:"4195c41d",1700:"f157ac87",1707:"c359d024",1774:"17e434df",1839:"dfefe3ec",1874:"e3cf7671",1987:"5b8550eb",1998:"bb9f1657",2043:"4b08afc9",2068:"c916ad98",2083:"9720322e",2120:"c378e6a7",2124:"de224e29",2138:"03df1009",2141:"909642c9",2154:"da472e58",2247:"262c39d0",2269:"a45011d9",2270:"71c74cf9",2338:"57d2e938",2373:"8afe65d7",2377:"1798461c",2419:"046f7024",2438:"957fafc1",2459:"890822eb",2460:"a0734a55",2496:"7e4d3165",2525:"5d62f296",2581:"1981e939",2634:"e1d944f6",2661:"aed80a98",2698:"2bc80b37",2707:"dae9d9d6",2711:"fa02942d",2905:"6b019ced",2920:"59daa309",2965:"78401e17",3010:"fcb1dac4",3015:"c5b175f4",3022:"96a9572e",3103:"b3494d59",3119:"f5799d4a",3134:"c320ce7a",3150:"31216255",3182:"e872148c",3206:"f70d2090",3249:"05697243",3282:"f514eeda",3360:"b7fe54da",3372:"c76e1161",3379:"e3efaf98",3392:"30233b6b",3414:"8a59078e",3421:"919e88ab",3486:"4120424a",3559:"e797962c",3671:"c422c4ff",3818:"84929b86",3833:"96f6bd4c",3890:"a1e9bc3d",3892:"df277861",3894:"7118bdad",3995:"25a3fcd8",4005:"6ac49997",4034:"6e02f4ab",4078:"65e44e04",4098:"ba8e01d2",4099:"56c58255",4122:"611092dd",4196:"8bb50cb6",4203:"f17ba905",4216:"f1fa5def",4261:"039d9b7e",4324:"cb3ef21a",4368:"7a1707f4",4480:"67192b50",4511:"7596329b",4557:"4e05340b",4651:"0dcb9382",4778:"7739c121",4813:"858bb418",4871:"82fed3b6",4879:"f648c4cc",4930:"ee7974c5",5104:"7d2d644b",5110:"58b49f3b",5210:"43ddf441",5235:"66b0d9a6",5333:"2ce8bcd4",5351:"70a63a4b",5403:"6b6bcdc6",5458:"1e49bd17",5465:"c1a5338d",5484:"916290d1",5564:"fdb2b03a",5599:"feb62006",5763:"3883a9fe",5844:"a1bec739",5928:"e7b6bff9",5992:"9e140e08",6002:"a55b3bbe",6044:"57ef271f",6101:"16c7c282",6104:"7bedeeb2",6291:"aeb25c54",6388:"2afcabcc",6417:"6b5cfd35",6461:"298241f0",6527:"c4082127",6618:"16449148",6643:"6c9f1bae",6646:"9a120b1c",6769:"9d3b496e",6887:"de5f9600",6913:"b3eed543",6938:"175f49b8",6941:"b9946c6e",6990:"4e452f8b",7024:"83956665",7056:"4c3565bb",7109:"21d7a131",7126:"4254ddec",7153:"ef523078",7243:"a96191eb",7308:"6a4ec96e",7321:"28a3c9c6",7360:"98ab7f12",7367:"c88270d2",7472:"1e97cc47",7473:"8e68df94",7529:"873b7d50",7577:"05962f98",7583:"47599a5e",7606:"bcb666eb",7608:"5aa43b26",7619:"6e16aad9",7643:"ceda7075",7696:"a36dbbbc",7714:"1a5f4bec",7715:"47b7048e",7742:"e2bbc433",7746:"da942ed4",7761:"866bd94c",7813:"0071775d",7839:"cdc3b49c",7846:"f970aa23",7886:"b3619613",7899:"4495bcb5",7900:"4c2ae5f9",7924:"86b8b3eb",8158:"4d82f1a9",8160:"1635a405",8209:"f9b0ff38",8221:"337380fd",8245:"6305ce29",8271:"5e1e4d58",8382:"dd3ca4bc",8401:"ab9f7aa1",8455:"e26bbdf6",8460:"bc04a210",8476:"0a7de365",8519:"773348c9",8560:"413aa791",8581:"53b559d9",8620:"7389ae93",8634:"f1f6f143",8641:"45e762a4",8758:"ea9aecd2",8768:"ebfed347",8795:"1aee74c9",8839:"bbbdc4fe",8877:"9ecfb22b",8881:"012e62b4",8913:"3eea0e0d",8952:"fc494d15",9034:"2e9752e5",9118:"a72526cb",9120:"6321b9e1",9304:"693e72fc",9342:"d7be4740",9437:"54824781",9515:"719d5572",9543:"2f0398d6",9551:"0760c9a4",9582:"f682bd67",9585:"6283e682",9591:"8fba063b",9592:"ed6cb595",9679:"b088b627",9685:"9d37d632",9812:"1e75f82d",9966:"6773f7e6"}[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,f)=>Object.prototype.hasOwnProperty.call(e,f),d={},c="website:",r.l=(e,f,a,b)=>{if(d[e])d[e].push(f);else{var t,o;if(void 0!==a)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var c=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach((e=>e(a))),f)return f(a)},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:"8401",24602229:"3892",26368098:"1211",96997528:"1138","18fc5556":"2",fe23c957:"53","268dddcf":"68","121cced5":"96","0a2b2829":"99","3bc305d8":"123","861bdbb6":"178","45e366b7":"187","85c7de33":"235","9a6ca8b8":"289",a4761f6f:"298",cb38042d:"323",e6cdcb35:"332","6fb4057b":"347",e9d07a0a:"456",d9894068:"577",b1c3f2c7:"612","86a9c212":"641","20110cf9":"643",d8b689b0:"656","1373a77b":"682","9509e94f":"708",df0b489b:"770","1c545b73":"1079","5bc90040":"1218",f02f7df4:"1274","8ab53c77":"1513","9a34b858":"1533","3fb5a56d":"1539","328083ea":"1581",fc9f0a8f:"1700",f431fa1f:"1707","66491fb6":"1839","5fc994c2":"1874",ecfe08ed:"1987","5133b137":"1998","4e8770ad":"2043","5d002dae":"2068","3d4c33f6":"2083","2dcc617a":"2120","0d1d5dba":"2124","1a4e3797":"2138","933bed1e":"2141","9017a355":"2154",af67069a:"2247","3f859f05":"2269",c62bfd53:"2270","7b8d824d":"2338","7a99341f":"2373","38bf2aac":"2377","9eb50243":"2419","4afa4b8a":"2438","649c4fa3":"2459","37fdb427":"2460","85addd09":"2496",d350cff3:"2525",dc701447:"2581",c4f5d8e4:"2634","435645a6":"2661","373c35af":"2698",c50db514:"2707","9e4087bc":"2711",ddab1e1f:"2905","398b3246":"2920","3e7ee0fc":"2965",a55aca30:"3010","0e97a833":"3015",e6bddadc:"3022",f2f4b8a7:"3103",f14c3b1d:"3119",e432d2f9:"3134","090a441b":"3150","6e1398c4":"3182","74a579df":"3206",ccc49370:"3249",c12557ec:"3360",b49de2ad:"3372",f97fefc4:"3379","0ef19a76":"3392","04d1378b":"3414",bab8a798:"3421",cae448e5:"3486","4898f926":"3559","3f3efe2b":"3671","7358fe14":"3818",c262e01e:"3833","06556991":"3890","120e2fab":"3894",beec6c9a:"3995","155ec335":"4005",fa42474c:"4034",e8bfc54f:"4078",bc243f9c:"4099",c8447d5b:"4122",f9078c13:"4196","9338ecde":"4203","50214cd4":"4216","66c89031":"4261","9b67fd78":"4324",ef7da448:"4368","4d2064e8":"4480",a6860cb2:"4511",c74a7097:"4557","040764b7":"4651",a622d695:"4778","6875c492":"4813","85a74db3":"4871","00424e3f":"4879","3f50474f":"4930","2ec4e639":"5104",ddb15f76:"5110","4a184f52":"5210",b48043f7:"5235","743699a6":"5333",df5bc064:"5351","684e0aea":"5403","5125c427":"5458",d389a7b2:"5465","30a967f3":"5484","5fcf77d7":"5564","3abc4359":"5599","851303a1":"5763","329947da":"5844",ae694851:"5928","3c59129e":"5992","6781c826":"6002",cd796466:"6044","750255a9":"6101","8e7c33d6":"6104","1ee22d16":"6291",c7632c1f:"6388","79ac7843":"6417",c83bcda6:"6461","32a9b7bf":"6527",a8a1de49:"6618","289d965c":"6643",e453af6e:"6646","1a01fdf1":"6769","19ee85cd":"6887","41e12717":"6913",b80a1ac9:"6938",f98b7248:"6941","8f43d633":"6990","0f6ee85b":"7024","40113ee6":"7056","54c48e38":"7109","5e26652b":"7126","6af18994":"7153","5a9cd6fb":"7243","48c4a2a0":"7308","23a61782":"7321",af952e90:"7360",ea7b1b31:"7367","814f3328":"7472","7accbb75":"7473","90ca9965":"7529","5b12c1a9":"7577",af558054:"7583","9f23071e":"7606","2d84255a":"7608","478bcf42":"7619",a6aa9e1f:"7643","3974811d":"7696","170ab94c":"7714","0b72a6ff":"7715",dcfd3b61:"7742","7dcc0419":"7746",ba1e31c2:"7761","656a21b7":"7813","7d2f6bd9":"7839",dd5377a3:"7846","865d1447":"7886","5bfbde57":"7899","4c76b531":"7900","0a02aff3":"7924","2aa9b0dd":"8160","01a85c17":"8209","40e30cb7":"8221",d9683343:"8245",b9d5de69:"8271",eb35abdd:"8455",fc323215:"8460",f6b2bbb1:"8476","7c823085":"8519","0970ca0c":"8560","935f2afb":"8581","1c323773":"8620",b6072cb9:"8634","3498d2db":"8641",f164116d:"8758","881ac13d":"8768",e237dedf:"8795",ea9c95e7:"8839",dbe4f0b7:"8877","3b089002":"8881","2cf03b61":"8952","9292650b":"9034","63371bf1":"9118",df8c2417:"9120","04c33c1d":"9304","7c97e9a2":"9342","17f9232f":"9437","5d2f6d16":"9515","4aba33e7":"9543","80f9953e":"9582","0b851b4d":"9585","1d245f66":"9591","5eff386f":"9592","239f6efa":"9679","181d712d":"9685",f999fa4a:"9812","0c7edd3c":"9966"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(f,a)=>{var d=r.o(e,f)?e[f]:void 0;if(0!==d)if(d)a.push(d[2]);else if(/^(1869|5354)$/.test(f))e[f]=0;else{var c=new Promise(((a,c)=>d=e[f]=[a,c]));a.push(d[2]=c);var b=r.p+r.u(f),t=new Error;r.l(b,(a=>{if(r.o(e,f)&&(0!==(d=e[f])&&(e[f]=void 0),d)){var c=a&&("load"===a.type?"missing":a.type),b=a&&a.target&&a.target.src;t.message="Loading chunk "+f+" failed.\n("+c+": "+b+")",t.name="ChunkLoadError",t.type=c,t.request=b,d[1](t)}}),"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,a)=>{var d,c,b=a[0],t=a[1],o=a[2],n=0;if(b.some((f=>0!==e[f]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(f&&f(a);n{"use strict";var e,f,a,d,c,b={},t={};function r(e){var f=t[e];if(void 0!==f)return f.exports;var a=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=b,e=[],r.O=(f,a,d,c)=>{if(!a){var b=1/0;for(i=0;i=c)&&Object.keys(r.O).every((e=>r.O[e](a[o])))?a.splice(o--,1):(t=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[a,d,c]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var c=Object.create(null);r.r(c);var b={};f=f||[null,a({}),a([]),a(a)];for(var t=2&d&&e;"object"==typeof t&&!~f.indexOf(t);t=a(t))Object.getOwnPropertyNames(t).forEach((f=>b[f]=()=>e[f]));return b.default=()=>e,r.d(c,b),c},r.d=(e,f)=>{for(var a in f)r.o(f,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((f,a)=>(r.f[a](e,f),f)),[])),r.u=e=>"assets/js/"+({2:"18fc5556",53:"fe23c957",68:"268dddcf",96:"121cced5",99:"0a2b2829",123:"3bc305d8",178:"861bdbb6",187:"45e366b7",235:"85c7de33",289:"9a6ca8b8",298:"a4761f6f",323:"cb38042d",332:"e6cdcb35",347:"6fb4057b",456:"e9d07a0a",577:"d9894068",612:"b1c3f2c7",641:"86a9c212",643:"20110cf9",656:"d8b689b0",682:"1373a77b",708:"9509e94f",770:"df0b489b",1079:"1c545b73",1138:"96997528",1211:"26368098",1218:"5bc90040",1274:"f02f7df4",1513:"8ab53c77",1533:"9a34b858",1539:"3fb5a56d",1581:"328083ea",1700:"fc9f0a8f",1707:"f431fa1f",1839:"66491fb6",1874:"5fc994c2",1987:"ecfe08ed",1998:"5133b137",2043:"4e8770ad",2068:"5d002dae",2083:"3d4c33f6",2120:"2dcc617a",2124:"0d1d5dba",2138:"1a4e3797",2141:"933bed1e",2154:"9017a355",2247:"af67069a",2269:"3f859f05",2270:"c62bfd53",2338:"7b8d824d",2373:"7a99341f",2377:"38bf2aac",2419:"9eb50243",2438:"4afa4b8a",2459:"649c4fa3",2460:"37fdb427",2496:"85addd09",2525:"d350cff3",2581:"dc701447",2634:"c4f5d8e4",2661:"435645a6",2698:"373c35af",2707:"c50db514",2711:"9e4087bc",2905:"ddab1e1f",2920:"398b3246",2965:"3e7ee0fc",3010:"a55aca30",3015:"0e97a833",3022:"e6bddadc",3103:"f2f4b8a7",3119:"f14c3b1d",3134:"e432d2f9",3150:"090a441b",3182:"6e1398c4",3206:"74a579df",3249:"ccc49370",3360:"c12557ec",3372:"b49de2ad",3379:"f97fefc4",3392:"0ef19a76",3414:"04d1378b",3421:"bab8a798",3486:"cae448e5",3559:"4898f926",3671:"3f3efe2b",3818:"7358fe14",3833:"c262e01e",3890:"06556991",3892:"24602229",3894:"120e2fab",3995:"beec6c9a",4005:"155ec335",4034:"fa42474c",4078:"e8bfc54f",4099:"bc243f9c",4122:"c8447d5b",4196:"f9078c13",4203:"9338ecde",4216:"50214cd4",4261:"66c89031",4324:"9b67fd78",4368:"ef7da448",4480:"4d2064e8",4511:"a6860cb2",4557:"c74a7097",4651:"040764b7",4778:"a622d695",4813:"6875c492",4871:"85a74db3",4879:"00424e3f",4930:"3f50474f",5104:"2ec4e639",5110:"ddb15f76",5210:"4a184f52",5235:"b48043f7",5333:"743699a6",5351:"df5bc064",5403:"684e0aea",5458:"5125c427",5465:"d389a7b2",5484:"30a967f3",5564:"5fcf77d7",5599:"3abc4359",5763:"851303a1",5844:"329947da",5928:"ae694851",5992:"3c59129e",6002:"6781c826",6044:"cd796466",6101:"750255a9",6104:"8e7c33d6",6291:"1ee22d16",6388:"c7632c1f",6417:"79ac7843",6461:"c83bcda6",6527:"32a9b7bf",6618:"a8a1de49",6643:"289d965c",6646:"e453af6e",6769:"1a01fdf1",6887:"19ee85cd",6913:"41e12717",6938:"b80a1ac9",6941:"f98b7248",6990:"8f43d633",7024:"0f6ee85b",7056:"40113ee6",7109:"54c48e38",7126:"5e26652b",7153:"6af18994",7243:"5a9cd6fb",7308:"48c4a2a0",7321:"23a61782",7360:"af952e90",7367:"ea7b1b31",7472:"814f3328",7473:"7accbb75",7529:"90ca9965",7577:"5b12c1a9",7583:"af558054",7606:"9f23071e",7608:"2d84255a",7619:"478bcf42",7643:"a6aa9e1f",7696:"3974811d",7714:"170ab94c",7715:"0b72a6ff",7742:"dcfd3b61",7746:"7dcc0419",7761:"ba1e31c2",7813:"656a21b7",7839:"7d2f6bd9",7846:"dd5377a3",7886:"865d1447",7899:"5bfbde57",7900:"4c76b531",7924:"0a02aff3",8160:"2aa9b0dd",8209:"01a85c17",8221:"40e30cb7",8245:"d9683343",8271:"b9d5de69",8401:"17896441",8455:"eb35abdd",8460:"fc323215",8476:"f6b2bbb1",8519:"7c823085",8560:"0970ca0c",8581:"935f2afb",8620:"1c323773",8634:"b6072cb9",8641:"3498d2db",8758:"f164116d",8768:"881ac13d",8795:"e237dedf",8839:"ea9c95e7",8877:"dbe4f0b7",8881:"3b089002",8952:"2cf03b61",9034:"9292650b",9118:"63371bf1",9120:"df8c2417",9304:"04c33c1d",9342:"7c97e9a2",9437:"17f9232f",9515:"5d2f6d16",9543:"4aba33e7",9582:"80f9953e",9585:"0b851b4d",9591:"1d245f66",9592:"5eff386f",9679:"239f6efa",9685:"181d712d",9812:"f999fa4a",9966:"0c7edd3c"}[e]||e)+"."+{2:"1f27e26a",53:"643705c4",68:"0d2ec23e",96:"faf569c2",99:"edd83f34",123:"1b9fa380",178:"280b9b1f",187:"f3d8b74a",235:"10138825",289:"4abf637f",298:"25266a56",323:"ee0f3976",332:"51e9bf3e",347:"7f4ce9c1",416:"05118c27",456:"093d089d",577:"be77af72",612:"a166cb62",641:"f6191334",643:"41d49cce",656:"e52bc8b4",682:"66d33fde",708:"db909afe",770:"901aae8b",1079:"7080559a",1138:"824b22b0",1211:"9b939b14",1218:"e7c74c88",1274:"35244da2",1513:"2c82f68a",1533:"fca19837",1539:"ae853ff9",1581:"4195c41d",1700:"f157ac87",1707:"c359d024",1774:"17e434df",1839:"dfefe3ec",1874:"e3cf7671",1987:"5b8550eb",1998:"bb9f1657",2043:"4b08afc9",2068:"c916ad98",2083:"9720322e",2120:"c378e6a7",2124:"de224e29",2138:"03df1009",2141:"909642c9",2154:"da472e58",2247:"262c39d0",2269:"a45011d9",2270:"71c74cf9",2338:"57d2e938",2373:"8afe65d7",2377:"1798461c",2419:"046f7024",2438:"957fafc1",2459:"890822eb",2460:"a0734a55",2496:"7e4d3165",2525:"5d62f296",2581:"1981e939",2634:"e1d944f6",2661:"aed80a98",2698:"ff5977eb",2707:"dae9d9d6",2711:"fa02942d",2905:"6b019ced",2920:"59daa309",2965:"78401e17",3010:"fcb1dac4",3015:"c5b175f4",3022:"96a9572e",3103:"b3494d59",3119:"f5799d4a",3134:"c320ce7a",3150:"31216255",3182:"e872148c",3206:"f70d2090",3249:"05697243",3282:"f514eeda",3360:"b7fe54da",3372:"c76e1161",3379:"e3efaf98",3392:"30233b6b",3414:"8a59078e",3421:"919e88ab",3486:"4120424a",3559:"e797962c",3671:"c422c4ff",3818:"84929b86",3833:"96f6bd4c",3890:"a1e9bc3d",3892:"df277861",3894:"7118bdad",3995:"25a3fcd8",4005:"6ac49997",4034:"6e02f4ab",4078:"65e44e04",4098:"ba8e01d2",4099:"56c58255",4122:"611092dd",4196:"8bb50cb6",4203:"f17ba905",4216:"f1fa5def",4261:"039d9b7e",4324:"cb3ef21a",4368:"7a1707f4",4480:"67192b50",4511:"7596329b",4557:"4e05340b",4651:"0dcb9382",4778:"7739c121",4813:"858bb418",4871:"82fed3b6",4879:"f648c4cc",4930:"ee7974c5",5104:"7d2d644b",5110:"58b49f3b",5210:"43ddf441",5235:"66b0d9a6",5333:"2ce8bcd4",5351:"70a63a4b",5403:"6b6bcdc6",5458:"1e49bd17",5465:"c1a5338d",5484:"916290d1",5564:"fdb2b03a",5599:"feb62006",5763:"3883a9fe",5844:"a1bec739",5928:"e7b6bff9",5992:"9e140e08",6002:"a55b3bbe",6044:"57ef271f",6101:"16c7c282",6104:"7bedeeb2",6291:"aeb25c54",6388:"2afcabcc",6417:"6b5cfd35",6461:"298241f0",6527:"c4082127",6618:"16449148",6643:"6c9f1bae",6646:"9a120b1c",6769:"9d3b496e",6887:"de5f9600",6913:"b3eed543",6938:"175f49b8",6941:"b9946c6e",6990:"4e452f8b",7024:"83956665",7056:"4c3565bb",7109:"21d7a131",7126:"4254ddec",7153:"ef523078",7243:"a96191eb",7308:"6a4ec96e",7321:"28a3c9c6",7360:"98ab7f12",7367:"c88270d2",7472:"1e97cc47",7473:"8e68df94",7529:"873b7d50",7577:"05962f98",7583:"47599a5e",7606:"bcb666eb",7608:"5aa43b26",7619:"6e16aad9",7643:"ceda7075",7696:"a36dbbbc",7714:"1a5f4bec",7715:"47b7048e",7742:"e2bbc433",7746:"da942ed4",7761:"866bd94c",7813:"0071775d",7839:"cdc3b49c",7846:"f970aa23",7886:"b3619613",7899:"4495bcb5",7900:"4c2ae5f9",7924:"86b8b3eb",8158:"4d82f1a9",8160:"1635a405",8209:"f9b0ff38",8221:"337380fd",8245:"6305ce29",8271:"5e1e4d58",8382:"dd3ca4bc",8401:"ab9f7aa1",8455:"e26bbdf6",8460:"bc04a210",8476:"0a7de365",8519:"773348c9",8560:"413aa791",8581:"53b559d9",8620:"7389ae93",8634:"f1f6f143",8641:"45e762a4",8758:"ea9aecd2",8768:"ebfed347",8795:"1aee74c9",8839:"bbbdc4fe",8877:"9ecfb22b",8881:"012e62b4",8913:"3eea0e0d",8952:"fc494d15",9034:"2e9752e5",9118:"56f4aa99",9120:"6321b9e1",9304:"693e72fc",9342:"d7be4740",9437:"54824781",9515:"719d5572",9543:"2f0398d6",9551:"0760c9a4",9582:"f682bd67",9585:"6283e682",9591:"8fba063b",9592:"ed6cb595",9679:"b088b627",9685:"9d37d632",9812:"1e75f82d",9966:"6773f7e6"}[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,f)=>Object.prototype.hasOwnProperty.call(e,f),d={},c="website:",r.l=(e,f,a,b)=>{if(d[e])d[e].push(f);else{var t,o;if(void 0!==a)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(s);var c=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),c&&c.forEach((e=>e(a))),f)return f(a)},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:"8401",24602229:"3892",26368098:"1211",96997528:"1138","18fc5556":"2",fe23c957:"53","268dddcf":"68","121cced5":"96","0a2b2829":"99","3bc305d8":"123","861bdbb6":"178","45e366b7":"187","85c7de33":"235","9a6ca8b8":"289",a4761f6f:"298",cb38042d:"323",e6cdcb35:"332","6fb4057b":"347",e9d07a0a:"456",d9894068:"577",b1c3f2c7:"612","86a9c212":"641","20110cf9":"643",d8b689b0:"656","1373a77b":"682","9509e94f":"708",df0b489b:"770","1c545b73":"1079","5bc90040":"1218",f02f7df4:"1274","8ab53c77":"1513","9a34b858":"1533","3fb5a56d":"1539","328083ea":"1581",fc9f0a8f:"1700",f431fa1f:"1707","66491fb6":"1839","5fc994c2":"1874",ecfe08ed:"1987","5133b137":"1998","4e8770ad":"2043","5d002dae":"2068","3d4c33f6":"2083","2dcc617a":"2120","0d1d5dba":"2124","1a4e3797":"2138","933bed1e":"2141","9017a355":"2154",af67069a:"2247","3f859f05":"2269",c62bfd53:"2270","7b8d824d":"2338","7a99341f":"2373","38bf2aac":"2377","9eb50243":"2419","4afa4b8a":"2438","649c4fa3":"2459","37fdb427":"2460","85addd09":"2496",d350cff3:"2525",dc701447:"2581",c4f5d8e4:"2634","435645a6":"2661","373c35af":"2698",c50db514:"2707","9e4087bc":"2711",ddab1e1f:"2905","398b3246":"2920","3e7ee0fc":"2965",a55aca30:"3010","0e97a833":"3015",e6bddadc:"3022",f2f4b8a7:"3103",f14c3b1d:"3119",e432d2f9:"3134","090a441b":"3150","6e1398c4":"3182","74a579df":"3206",ccc49370:"3249",c12557ec:"3360",b49de2ad:"3372",f97fefc4:"3379","0ef19a76":"3392","04d1378b":"3414",bab8a798:"3421",cae448e5:"3486","4898f926":"3559","3f3efe2b":"3671","7358fe14":"3818",c262e01e:"3833","06556991":"3890","120e2fab":"3894",beec6c9a:"3995","155ec335":"4005",fa42474c:"4034",e8bfc54f:"4078",bc243f9c:"4099",c8447d5b:"4122",f9078c13:"4196","9338ecde":"4203","50214cd4":"4216","66c89031":"4261","9b67fd78":"4324",ef7da448:"4368","4d2064e8":"4480",a6860cb2:"4511",c74a7097:"4557","040764b7":"4651",a622d695:"4778","6875c492":"4813","85a74db3":"4871","00424e3f":"4879","3f50474f":"4930","2ec4e639":"5104",ddb15f76:"5110","4a184f52":"5210",b48043f7:"5235","743699a6":"5333",df5bc064:"5351","684e0aea":"5403","5125c427":"5458",d389a7b2:"5465","30a967f3":"5484","5fcf77d7":"5564","3abc4359":"5599","851303a1":"5763","329947da":"5844",ae694851:"5928","3c59129e":"5992","6781c826":"6002",cd796466:"6044","750255a9":"6101","8e7c33d6":"6104","1ee22d16":"6291",c7632c1f:"6388","79ac7843":"6417",c83bcda6:"6461","32a9b7bf":"6527",a8a1de49:"6618","289d965c":"6643",e453af6e:"6646","1a01fdf1":"6769","19ee85cd":"6887","41e12717":"6913",b80a1ac9:"6938",f98b7248:"6941","8f43d633":"6990","0f6ee85b":"7024","40113ee6":"7056","54c48e38":"7109","5e26652b":"7126","6af18994":"7153","5a9cd6fb":"7243","48c4a2a0":"7308","23a61782":"7321",af952e90:"7360",ea7b1b31:"7367","814f3328":"7472","7accbb75":"7473","90ca9965":"7529","5b12c1a9":"7577",af558054:"7583","9f23071e":"7606","2d84255a":"7608","478bcf42":"7619",a6aa9e1f:"7643","3974811d":"7696","170ab94c":"7714","0b72a6ff":"7715",dcfd3b61:"7742","7dcc0419":"7746",ba1e31c2:"7761","656a21b7":"7813","7d2f6bd9":"7839",dd5377a3:"7846","865d1447":"7886","5bfbde57":"7899","4c76b531":"7900","0a02aff3":"7924","2aa9b0dd":"8160","01a85c17":"8209","40e30cb7":"8221",d9683343:"8245",b9d5de69:"8271",eb35abdd:"8455",fc323215:"8460",f6b2bbb1:"8476","7c823085":"8519","0970ca0c":"8560","935f2afb":"8581","1c323773":"8620",b6072cb9:"8634","3498d2db":"8641",f164116d:"8758","881ac13d":"8768",e237dedf:"8795",ea9c95e7:"8839",dbe4f0b7:"8877","3b089002":"8881","2cf03b61":"8952","9292650b":"9034","63371bf1":"9118",df8c2417:"9120","04c33c1d":"9304","7c97e9a2":"9342","17f9232f":"9437","5d2f6d16":"9515","4aba33e7":"9543","80f9953e":"9582","0b851b4d":"9585","1d245f66":"9591","5eff386f":"9592","239f6efa":"9679","181d712d":"9685",f999fa4a:"9812","0c7edd3c":"9966"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(f,a)=>{var d=r.o(e,f)?e[f]:void 0;if(0!==d)if(d)a.push(d[2]);else if(/^(1869|5354)$/.test(f))e[f]=0;else{var c=new Promise(((a,c)=>d=e[f]=[a,c]));a.push(d[2]=c);var b=r.p+r.u(f),t=new Error;r.l(b,(a=>{if(r.o(e,f)&&(0!==(d=e[f])&&(e[f]=void 0),d)){var c=a&&("load"===a.type?"missing":a.type),b=a&&a.target&&a.target.src;t.message="Loading chunk "+f+" failed.\n("+c+": "+b+")",t.name="ChunkLoadError",t.type=c,t.request=b,d[1](t)}}),"chunk-"+f,f)}},r.O.j=f=>0===e[f];var f=(f,a)=>{var d,c,b=a[0],t=a[1],o=a[2],n=0;if(b.some((f=>0!==e[f]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(f&&f(a);n