-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix misleading filepaths for DetoxTest.java in project-setup.mdx #4287
base: master
Are you sure you want to change the base?
Conversation
Actually, this is curious, @kalyncoose. In our example project, I can see that we don't use I might be okay with adding |
In which package did you put your DetoxTest.java, by the way? I mean, like |
Hi @noomorph, thanks for collaborating on this PR. The project in question is private for my company so I cannot write the exact package name but it is like this:
As for the Gradle version here is what my RN project outputted with
As far as the build scripts go, I have correctly updated my ...
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/dev/debug/app-dev-debug.apk',
build: 'cd android && ./gradlew assembleDevDebug assembleAndroidTest -DtestBuildType=debug',
reversePorts: [8081],
},
'android.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/dev/release/app-dev-release.apk',
build: 'cd android && ./gradlew assembleDevRelease assembleAndroidTest -DtestBuildType=release',
},
... I then successfully execute the build scripts with
Possible issue: does the |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Description
In this pull request, I have fixed misleading filepaths in the documentation for Project Setup in Step 4: Additional Android configuration.
The issue with the misleading documentation lines are that they referenced the test code will reside at
android/app/src/androidTest/java/com/<you.package>/DetoxTest.java
however this is incorrect as it should instead reside atandroid/app/src/androidTest/java/DetoxTest.java
.I spent 2 hours debugging an issue where Detox would build and attempt to run the test however it would not launch the app and would fail at
await device.launchApp()
:11-21 17:08:25.517 20209 20209 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
adb ... shell am instrument
command returningOK (0 tests)
:DetoxTest.java
DetoxTest.java
in my source sets until I found thatandroidTest/java/DetoxTest.java
was the working pathSince I have fixed this issue after 2 hours of debugging I think it warrants the docs to be updated since two simple line changes would have saved me 2 hours.
Note: This solution is working for me with the following combinations:
"react-native": "0.70.5",
"detox": "^20.13.5",
targetSdkVersion = 32
kotlinVersion = '1.7.0'
productFlavors
buildTypes
:debug
andrelease