1*21373fa4SWill Schurman package host.exp.exponent
2*21373fa4SWill Schurman 
3*21373fa4SWill Schurman import androidx.test.InstrumentationRegistry
4*21373fa4SWill Schurman import androidx.test.espresso.IdlingPolicies
5*21373fa4SWill Schurman import androidx.test.uiautomator.UiDevice
6*21373fa4SWill Schurman import host.exp.exponent.kernel.KernelConfig
7*21373fa4SWill Schurman import host.exp.exponent.utils.TestNativeModuleServer
8*21373fa4SWill Schurman import java.util.concurrent.TimeUnit
9*21373fa4SWill Schurman 
10*21373fa4SWill Schurman const val LAUNCH_TIMEOUT = 5000
11*21373fa4SWill Schurman 
12*21373fa4SWill Schurman open class BaseTestClass {
13*21373fa4SWill Schurman   companion object {
14*21373fa4SWill Schurman     @JvmStatic protected lateinit var uiDevice: UiDevice
15*21373fa4SWill Schurman 
beforeClassnull16*21373fa4SWill Schurman     fun beforeClass() {
17*21373fa4SWill Schurman       KernelConfig.IS_TEST = true
18*21373fa4SWill Schurman       KernelConfig.FORCE_NO_KERNEL_DEBUG_MODE = true
19*21373fa4SWill Schurman       KernelConfig.HIDE_ONBOARDING = true
20*21373fa4SWill Schurman 
21*21373fa4SWill Schurman       uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
22*21373fa4SWill Schurman       TestNativeModuleServer.instance.uiDevice = uiDevice
23*21373fa4SWill Schurman 
24*21373fa4SWill Schurman       // Increase Espresso timeout
25*21373fa4SWill Schurman       IdlingPolicies.setMasterPolicyTimeout(3, TimeUnit.MINUTES)
26*21373fa4SWill Schurman       IdlingPolicies.setIdlingResourceTimeout(3, TimeUnit.MINUTES)
27*21373fa4SWill Schurman     }
28*21373fa4SWill Schurman   }
29*21373fa4SWill Schurman }
30