-
Notifications
You must be signed in to change notification settings - Fork 24.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Detox integrations to Android RNTester app
Summary: This diff adds required Detox integrations to the RNTester app to be able to run Detox end-to-end tests on the Android version of the app. * Instructions at https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md were followed. * The `minSdkVersion` version for the app was bumped to 18, as required by Detox. * I also added build and test configurations in `package.json` * The debug app is able to run some of the existing tests, but the release app instacrashes. I do not know the reason for the instacrash at this time. * CI integrations to build and test the Android app will be added in future diffs Changelog: [Internal] add Detox integrations to the RNTester Android app Reviewed By: TheSavior Differential Revision: D19566834 fbshipit-source-id: 5dd506bbdbb426a5db18146e5dc7c450a27b1d0c
- Loading branch information
1 parent
6ba2aee
commit 29d3dfb
Showing
5 changed files
with
69 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
RNTester/android/app/src/androidTest/java/com/facebook/react/uiapp/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,33 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// This uses instructions from | ||
// https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md#4-create-android-test-class | ||
|
||
package com.facebook.react.uiapp; | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import androidx.test.filters.LargeTest; | ||
import androidx.test.rule.ActivityTestRule; | ||
import com.wix.detox.Detox; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@LargeTest | ||
public class DetoxTest { | ||
|
||
@Rule | ||
public ActivityTestRule<RNTesterActivity> mActivityRule = | ||
new ActivityTestRule<>(RNTesterActivity.class, false, false); | ||
|
||
@Test | ||
public void runDetoxTests() { | ||
Detox.runTests(mActivityRule); | ||
} | ||
} |
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