-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup Detox Added documentation for detox Added testIds Added setup tests for Launch Screen, Home Screen, Conversation Screen Added helper utils for tests Draft PR while finalizing Android Setup
- Loading branch information
Alex Risch
authored and
Alex Risch
committed
Dec 21, 2023
1 parent
e95063a
commit 38bec7e
Showing
27 changed files
with
1,669 additions
and
16,550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/** @type {Detox.DetoxConfig} */ | ||
module.exports = { | ||
testRunner: { | ||
args: { | ||
'$0': 'jest', | ||
config: 'e2e/jest.config.js' | ||
}, | ||
jest: { | ||
setupTimeout: 120000 | ||
} | ||
}, | ||
apps: { | ||
'ios.debug': { | ||
type: 'ios.app', | ||
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/xmtpreactnativesdkexample.app', | ||
build: 'xcodebuild -workspace ios/xmtpreactnativesdkexample.xcworkspace -scheme xmtpreactnativesdkexample -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build', | ||
}, | ||
'ios.release': { | ||
type: 'ios.app', | ||
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/YOUR_APP.app', | ||
build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration Release -sdk iphonesimulator -derivedDataPath ios/build' | ||
}, | ||
'android.debug': { | ||
type: 'android.apk', | ||
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk', | ||
build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug', | ||
reversePorts: [ | ||
8081 | ||
] | ||
}, | ||
'android.release': { | ||
type: 'android.apk', | ||
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk', | ||
build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release' | ||
} | ||
}, | ||
devices: { | ||
simulator: { | ||
type: 'ios.simulator', | ||
device: { | ||
type: 'iPhone 15' | ||
} | ||
}, | ||
attached: { | ||
type: 'android.attached', | ||
device: { | ||
adbName: '.*' | ||
} | ||
}, | ||
emulator: { | ||
type: 'android.emulator', | ||
device: { | ||
avdName: 'Pixel7' | ||
} | ||
} | ||
}, | ||
configurations: { | ||
'ios.sim.debug': { | ||
device: 'simulator', | ||
app: 'ios.debug' | ||
}, | ||
'ios.sim.release': { | ||
device: 'simulator', | ||
app: 'ios.release' | ||
}, | ||
'android.att.debug': { | ||
device: 'attached', | ||
app: 'android.debug' | ||
}, | ||
'android.att.release': { | ||
device: 'attached', | ||
app: 'android.release' | ||
}, | ||
'android.emu.debug': { | ||
device: 'emulator', | ||
app: 'android.debug' | ||
}, | ||
'android.emu.release': { | ||
device: 'emulator', | ||
app: 'android.release' | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...e/android/app/src/androidTest/java/expo/modules/xmtpreactnativesdk/example/DetoxTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package expo.modules.xmtpreactnativesdk.example; | ||
|
||
import com.wix.detox.Detox; | ||
import com.wix.detox.config.DetoxConfig; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import androidx.test.filters.LargeTest; | ||
import androidx.test.rule.ActivityTestRule; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@LargeTest | ||
public class DetoxTest { | ||
@Rule // (2) | ||
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false); | ||
|
||
@Test | ||
public void runDetoxTests() { | ||
DetoxConfig detoxConfig = new DetoxConfig(); | ||
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90; | ||
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60; | ||
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60); | ||
|
||
Detox.runTests(mActivityRule, detoxConfig); | ||
} | ||
} |
95 changes: 0 additions & 95 deletions
95
...id/app/src/androidTest/java/expo/modules/xmtpreactnativesdk/example/EspressoViewFinder.kt
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
...roid/app/src/androidTest/java/expo/modules/xmtpreactnativesdk/example/MainActivityTest.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
example/android/app/src/main/res/xml/network_security_config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<network-security-config> | ||
<domain-config cleartextTrafficPermitted="true"> | ||
<domain includeSubdomains="true">10.0.2.2</domain> | ||
<domain includeSubdomains="true">localhost</domain> | ||
</domain-config> | ||
</network-security-config> | ||
|
Oops, something went wrong.