![](https://i.imgur.com/Enq6CXG.gif) # How to test API by automation test ###### tags: `detox` `unit test` `automation test` `unit test api` > https://github.com/wix/detox/blob/master/README.md :video_game: > https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md:video_game: ## :memo: Where do I start? ### Step 1: Checkout branch `dev_core_detox` on `momo-app-platform` project :rocket: --- ### Step 2: Install package json :boom: Check detox package is valid to macos The most compatible version is `detox: '17.14.9'` --- ### Step 3: Config simulator Update specific simulator to run ! - [x] run command `adb devices` - [x] copy simulator's address from adb - [x] paste simulator’s address to `adbName` from package.jon ![](https://i.imgur.com/4ul0ZNd.gif) ![](https://i.imgur.com/BsT1ScW.png) :::info More informaion: https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md ::: ### Step 4: Build Android - Currently, testing API only support on **Android** - [x] run command `detox build --configuration android.emu.release` ![](https://i.imgur.com/g58ZiWt.png) - [x] **Success build** ![](https://i.imgur.com/bPm3ZKo.png) --- ### Step 5: Run Testing - [x] run command `detox test --configuration android.emu.release` ![](https://i.imgur.com/foaxq0P.png) ## :memo: How to write a unit test? --- ### Write a test - [x] Finding type of message (MoMoMessage, CloudMessage, GetMessage, ProxyMessage, PureMessage) - [x] Prepare request object - [x] Expect condition ![](https://i.imgur.com/imt8mQ4.png) --- ### Kinds of Expect ![](https://i.imgur.com/Enq6CXG.gif) # How to test API by automation test ###### tags: `detox` `unit test` `automation test` `unit test api` > https://github.com/wix/detox/blob/master/README.md :video_game: > https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md:video_game: ## :memo: Where do I start? ### Step 1: Checkout branch `dev_core_detox` on `momo-app-platform` project :rocket: --- ### Step 2: Install package json :boom: Check detox package is valid to macos The most compatible version is `detox: '17.14.9'` --- ### Step 3: Config simulator Update specific simulator to run ! - [x] run command `adb devices` - [x] copy simulator's address from adb - [x] paste simulator’s address to `adbName` from package.jon ![](https://i.imgur.com/4ul0ZNd.gif) ![](https://i.imgur.com/BsT1ScW.png) :::info More informaion: https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md ::: ### Step 4: Build Android - Currently, testing API only support on **Android** - [x] run command `detox build --configuration android.emu.release` ![](https://i.imgur.com/g58ZiWt.png) - [x] **Success build** ![](https://i.imgur.com/bPm3ZKo.png) --- ### Step 5: Run Testing - [x] run command `detox test --configuration android.emu.release` ![](https://i.imgur.com/foaxq0P.png) ## :memo: How to write a unit test? --- ### Write a test - [x] Finding type of message (MoMoMessage, CloudMessage, GetMessage, ProxyMessage, PureMessage) - [x] Prepare request object - [x] Expect condition ![](https://i.imgur.com/imt8mQ4.png) --- ### Kinds of Expect ![](https://i.imgur.com/Enq6CXG.gif) # How to test API by automation test ###### tags: `detox` `unit test` `automation test` `unit test api` > https://github.com/wix/detox/blob/master/README.md :video_game: > https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md:video_game: ## :memo: Where do I start? ### Step 1: Checkout branch `dev_core_detox` on `momo-app-platform` project :rocket: --- ### Step 2: Install package json :boom: Check detox package is valid to macos The most compatible version is `detox: '17.14.9'` --- ### Step 3: Config simulator Update specific simulator to run ! - [x] run command `adb devices` - [x] copy simulator's address from adb - [x] paste simulator’s address to `adbName` from package.jon ![](https://i.imgur.com/4ul0ZNd.gif) ![](https://i.imgur.com/BsT1ScW.png) :::info More informaion: https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md ::: ### Step 4: Build Android - Currently, testing API only support on **Android** - [x] run command `detox build --configuration android.emu.release` ![](https://i.imgur.com/g58ZiWt.png) - [x] **Success build** ![](https://i.imgur.com/bPm3ZKo.png) --- ### Step 5: Run Testing - [x] run command `detox test --configuration android.emu.release` ![](https://i.imgur.com/foaxq0P.png) ## :memo: How to write a unit test? --- ### Write a test - [x] Finding type of message (MoMoMessage, CloudMessage, GetMessage, ProxyMessage, PureMessage) - [x] Prepare request object - [x] Expect condition ![](https://i.imgur.com/imt8mQ4.png) --- ### Kinds of Expect ![](https://i.imgur.com/Enq6CXG.gif) # How to test API by automation test ###### tags: `detox` `unit test` `automation test` `unit test api` > https://github.com/wix/detox/blob/master/README.md :video_game: > https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md:video_game: ## :memo: Where do I start? ### Step 1: Checkout branch `dev_core_detox` on `momo-app-platform` project :rocket: --- ### Step 2: Install package json :boom: Check detox package is valid to macos The most compatible version is `detox: '17.14.9'` --- ### Step 3: Config simulator Update specific simulator to run ! - [x] run command `adb devices` - [x] copy simulator's address from adb - [x] paste simulator’s address to `adbName` from package.jon ![](https://i.imgur.com/4ul0ZNd.gif) ![](https://i.imgur.com/BsT1ScW.png) :::info More informaion: https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md ::: ### Step 4: Build Android - Currently, testing API only support on **Android** - [x] run command `detox build --configuration android.emu.release` ![](https://i.imgur.com/g58ZiWt.png) - [x] **Success build** ![](https://i.imgur.com/bPm3ZKo.png) --- ### Step 5: Run Testing - [x] run command `detox test --configuration android.emu.release` ![](https://i.imgur.com/foaxq0P.png) ## :memo: How to write a unit test? --- ### Write a test - [x] Finding type of message (MoMoMessage, CloudMessage, GetMessage, ProxyMessage, PureMessage) - [x] Prepare request object - [x] Expect condition ![](https://i.imgur.com/imt8mQ4.png) --- ### Kinds of Expect ![](https://i.imgur.com/Enq6CXG.gif) # How to test API by automation test ###### tags: `detox` `unit test` `automation test` `unit test api` > https://github.com/wix/detox/blob/master/README.md :video_game: > https://github.com/wix/Detox/blob/master/docs/Introduction.GettingStarted.md:video_game: ## :memo: Where do I start? ### Step 1: Checkout branch `dev_core_detox` on `momo-app-platform` project :rocket: --- ### Step 2: Install package json :boom: Check detox package is valid to macos The most compatible version is `detox: '17.14.9'` --- ### Step 3: Config simulator Update specific simulator to run ! - [x] run command `adb devices` - [x] copy simulator's address from adb - [x] paste simulator’s address to `adbName` from package.jon ![](https://i.imgur.com/4ul0ZNd.gif) ![](https://i.imgur.com/BsT1ScW.png) :::info More informaion: https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md ::: ### Step 4: Build Android - Currently, testing API only support on **Android** - [x] run command `detox build --configuration android.emu.release` ![](https://i.imgur.com/g58ZiWt.png) - [x] **Success build** ![](https://i.imgur.com/bPm3ZKo.png) --- ### Step 5: Run Testing - [x] run command `detox test --configuration android.emu.release` ![](https://i.imgur.com/foaxq0P.png) ## :memo: How to write a unit test? --- ### Write a test - [x] Finding type of message (MoMoMessage, CloudMessage, GetMessage, ProxyMessage, PureMessage) - [x] Prepare request object - [x] Expect condition ![](https://i.imgur.com/imt8mQ4.png) --- ### Kinds of Expect