|
| 1 | +--- |
| 2 | +id: detox-testing-on-hyperexecute |
| 3 | +title: Detox Testing on HyperExecute |
| 4 | +hide_title: false |
| 5 | +sidebar_label: Detox Testing |
| 6 | +description: Learn how to run Detox automation tests on HyperExecute for React Native apps |
| 7 | +keywords: |
| 8 | + - Detox |
| 9 | + - Detox automation |
| 10 | + - Detox testing |
| 11 | + - detox testing react native |
| 12 | + - detox automation testing |
| 13 | + - detox lambdatest |
| 14 | + - hyperexecute |
| 15 | + - hyperexecute detox testing |
| 16 | + - detox tests on hyperexecute |
| 17 | + - hyperexecute automation testing |
| 18 | + - HyperExecute React Native automation |
| 19 | +url: https://www.lambdatest.com/support/docs/detox-testing-on-hyperexecute/ |
| 20 | +site_name: LambdaTest |
| 21 | +slug: detox-testing-on-hyperexecute/ |
| 22 | +--- |
| 23 | + |
| 24 | +import CodeBlock from '@theme/CodeBlock'; |
| 25 | +import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys"; |
| 26 | + |
| 27 | +<script type="application/ld+json" |
| 28 | + dangerouslySetInnerHTML={{ __html: JSON.stringify({ |
| 29 | + "@context": "https://schema.org", |
| 30 | + "@type": "BreadcrumbList", |
| 31 | + "itemListElement": [{ |
| 32 | + "@type": "ListItem", |
| 33 | + "position": 1, |
| 34 | + "name": "Home", |
| 35 | + "item": "https://www.lambdatest.com" |
| 36 | + },{ |
| 37 | + "@type": "ListItem", |
| 38 | + "position": 2, |
| 39 | + "name": "Support", |
| 40 | + "item": "https://www.lambdatest.com/support/docs/" |
| 41 | + },{ |
| 42 | + "@type": "ListItem", |
| 43 | + "position": 3, |
| 44 | + "name": "How to run Detox automation tests on HyperExecute", |
| 45 | + "item": "https://www.lambdatest.com/support/docs/detox-testing-on-hyperexecute/" |
| 46 | + }] |
| 47 | + }) |
| 48 | + }} |
| 49 | +></script> |
| 50 | + |
| 51 | +Detox is a popular end-to-end testing framework for React Native applications. This documentation will help you run your Detox tests on LambdaTest HyperExecute using your local system setup. |
| 52 | + |
| 53 | +## Run a Sample Project |
| 54 | +### Step 1: Clone Sample Repository |
| 55 | + |
| 56 | +:::tip Detox repo |
| 57 | +Download or Clone the Detox sample from LambdaTest’s GitHub Repository |
| 58 | + |
| 59 | +<a href="https://github.com/rishirajs123/LT-Detox" className="github__anchor"><img loading="lazy" src={require('../assets/images/icons/github.png').default} alt="Image" className="doc_img"/> View on GitHub</a> |
| 60 | +::: |
| 61 | + |
| 62 | +### Step 2: Download the CLI in your Project |
| 63 | +Download the HyperExecute CLI and copy it into the root folder of the downloaded sample repository. |
| 64 | + |
| 65 | +| Platform | HyperExecute CLI | |
| 66 | +| ---------| ---------------- | |
| 67 | +| Linux | https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute | |
| 68 | +| Windows | https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe | |
| 69 | +| macOS | https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute | |
| 70 | + |
| 71 | +### Step 3: Execute your Test Suite |
| 72 | +From the project root directory, execute the below CLI command in your terminal: |
| 73 | + |
| 74 | +<div className="lambdatest__codeblock"> |
| 75 | + <CodeBlock className="language-bash"> |
| 76 | + {`./hyperexecute --user ${ YOUR_LAMBDATEST_USERNAME()} --key ${ YOUR_LAMBDATEST_ACCESS_KEY()} --config RELATIVE_PATH_OF_YOUR_YAML_FILE `} |
| 77 | + </CodeBlock> |
| 78 | +</div> |
| 79 | + |
| 80 | +> **NOTE :** In case of macOS, if you get a permission denied warning while executing CLI, simply run **`chmod u+x ./hyperexecute`** to allow permission. In case you get a security popup, allow it from your **System Preferences** → **Security & Privacy** → **General tab**. |
| 81 | +
|
| 82 | +<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/Detox/Detox_cmd.png').default} alt="TestNG HyperExecute Terminal Logs" width="1920" height="868" className="doc_img"/> |
| 83 | + |
| 84 | + |
| 85 | +<br /><br /> |
| 86 | + |
| 87 | +You've successfully triggered the Detox tests on HyperExecute. Visit the [HyperExecute Dashboard](https://hyperexecute.lambdatest.com/hyperexecute) and check your Job status. |
| 88 | + |
| 89 | + |
| 90 | +## Configure your own Project |
| 91 | + |
| 92 | +### Step 1: Download the CLI in your Project |
| 93 | +Download the HyperExecute CLI and copy it into the root folder. |
| 94 | + |
| 95 | +| Platform | HyperExecute CLI | |
| 96 | +| ---------| ---------------- | |
| 97 | +| Linux | https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute | |
| 98 | +| Windows | https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe | |
| 99 | +| macOS | https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute | |
| 100 | + |
| 101 | +### Step 2: Configure YAML in your Test Suite |
| 102 | +Use the sample YAML below to configure your execution: |
| 103 | + |
| 104 | +```yaml |
| 105 | +--- |
| 106 | +autosplit: true |
| 107 | + |
| 108 | +# Set the concurrency level for test execution (2 devices in parallel) |
| 109 | +concurrency: 2 |
| 110 | + |
| 111 | +framework: |
| 112 | + # Name of the test framework (raw in this case) |
| 113 | + name: raw |
| 114 | + args: |
| 115 | + buildName: test_demo_1 |
| 116 | + deviceLogs: true |
| 117 | + devices: |
| 118 | + - Galaxy S23 |
| 119 | + disableReleaseDevice: true |
| 120 | + env: |
| 121 | + DETOX: true |
| 122 | + isRealMobile: true |
| 123 | + mobileDC: true |
| 124 | + platformName: android |
| 125 | + privateCloud: true |
| 126 | + queueTimeout: 600 |
| 127 | + |
| 128 | + # Enable or disable video recording support |
| 129 | + video: true |
| 130 | + |
| 131 | + |
| 132 | +# Make test status as HyperExecute job's status |
| 133 | +frameworkStatusOnly: true |
| 134 | + |
| 135 | +# job label for hyperexecute job |
| 136 | +jobLabel: ['raw','detox','public'] |
| 137 | + |
| 138 | +# Pre-install required dependencies from pre-setup scripts |
| 139 | +pre: |
| 140 | + - bash ./lambdatest/scripts/pre-setup.sh |
| 141 | + |
| 142 | +# Specify the target platform for test execution (Android in this case) |
| 143 | +runson: android |
| 144 | + |
| 145 | +# Test discovery configuration |
| 146 | +testDiscovery: |
| 147 | + # Command to discover tests from the discovery.txt file |
| 148 | + command: cat ./lambdatest/discovery.txt |
| 149 | + # Test discovery mode is static |
| 150 | + mode: static |
| 151 | + # Test type is raw (custom test implementation) |
| 152 | + type: raw |
| 153 | + |
| 154 | +# Command to run the tests using the testRunnerCommand |
| 155 | +testRunnerCommand: bash ./lambdatest/scripts/execute.sh $test |
| 156 | + |
| 157 | +# Define the version of the configuration file |
| 158 | +version: "0.2" |
| 159 | +``` |
| 160 | +
|
| 161 | +> 📘 To explore more configuration options and tailor settings to your project needs, check out the [YAML documentation](https://www.lambdatest.com/support/docs/hyperexecute-yaml-parameters/). |
| 162 | +
|
| 163 | +### Step 3: Monitor the Test Execution |
| 164 | +
|
| 165 | +Visit the [HyperExecute Dashboard](https://hyperexecute.lambdatest.com/hyperexecute) and check your Job status. |
| 166 | +
|
| 167 | +<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/Detox/Detox_dashboard.png').default} alt="TestNG HyperExecute Terminal Logs" width="1920" height="868" className="doc_img"/> |
| 168 | +
|
| 169 | +
|
| 170 | +> For any query or doubt, please feel free to contact us via <span className="doc__lt" onClick={() => window.openLTChatWidget()}>**24×7 chat support**</span> or you can also drop a mail to **[email protected]**.<br /> |
| 171 | +
|
| 172 | +
|
0 commit comments