detox 20.41.1 → 20.41.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Detox-android/com/wix/detox/{20.41.1/detox-20.41.1-sources.jar → 20.41.3/detox-20.41.3-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.41.1/detox-20.41.1.aar → 20.41.3/detox-20.41.3.aar} +0 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.aar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.aar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.41.1/detox-20.41.1.pom → 20.41.3/detox-20.41.3.pom} +1 -1
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.pom.sha512 +1 -0
- package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
- package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
- package/Detox-ios-framework.tbz +0 -0
- package/Detox-ios-src.tbz +0 -0
- package/Detox-ios-xcuitest.tbz +0 -0
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/DetoxIdlingResource.kt +0 -2
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/ReactNativeIdlingResources.kt +0 -1
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/StabilizedIdlingResource.kt +74 -0
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/animations/AnimatedModuleIdlingResource.kt +74 -26
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/factory/FabricDetoxIdlingResourceFactoryStrategy.kt +2 -2
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/storage/AsyncStorageIdlingResource.kt +17 -23
- package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/fabric/FabricUIManagerIdlingResources.kt +1 -1
- package/package.json +2 -2
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.aar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.pom.sha512 +0 -1
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d62daa3c6360e40eee316c7e7d391989
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7188b3152f33cad1dbd467ee2c9daa649f1482a7
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b7a9075a28971504483bdca303e45acb179c2aa16583d03397496372f40aca8a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
83d09a205dd16e6d517249b663f56634604066ac3a974f018cdeed02c0868d4ce67db7b23015592d9a9c3692ec0339124df33644882824245b84413fb7b9ed81
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
13c04ef5c334f8dd971b29fd29746cef
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5f3e7cb44fef6005ce377795a87ea2974031960e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d49345f1dde088f8e36d1acb664552465b8f86c763a29551e339f4a94267cc36
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7c053d70ecb0c178011dc1f0d769a3bd74342f32e857124016c71876dd3debd6f251bdd2c14c2eb39d60fde8e6fed6454ae22bd07795b78da3a6b5ed87fe8de6
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<modelVersion>4.0.0</modelVersion>
|
|
4
4
|
<groupId>com.wix</groupId>
|
|
5
5
|
<artifactId>detox</artifactId>
|
|
6
|
-
<version>20.41.
|
|
6
|
+
<version>20.41.3</version>
|
|
7
7
|
<packaging>aar</packaging>
|
|
8
8
|
<name>Detox</name>
|
|
9
9
|
<description>Gray box end-to-end testing and automation library for mobile apps</description>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6c53141aae1e1550c586efc36bb0dd0c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
740de0f44e34398d3f248ab00f9fd3c9b0886c9b
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9bbc99998c52463f7523b399ca94a59bf01ee8eff482ebc9b492b97e26e9295c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
eb9826a24c573fab3363c644b8557642fd8875fc64466d04c4600287d22d9c909d7b000aaafc159678b3ca444984d6525f3f047e4c700be3e28b9df2d4d28a16
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>com.wix</groupId>
|
|
4
4
|
<artifactId>detox</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>20.41.
|
|
7
|
-
<release>20.41.
|
|
6
|
+
<latest>20.41.3</latest>
|
|
7
|
+
<release>20.41.3</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>20.41.
|
|
9
|
+
<version>20.41.3</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250918141124</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
6f57826a3230198297bce5e007333fac
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c8416ca659f3d8c733dfa7b9f187558b8fd9c716
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
def56429b5323f8b16fe2d813001f68694bffe308821c3d3ecc28f4d5c04a679
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ae9fae3a019fdc3e7d87689f447e7817a942f68dbae4b3e6ce9fa395bab9cc017d1df68ae3af204275c10d553bb00c62aac54be18f2bcf06a58ae2c886ebbeaa
|
package/Detox-ios-framework.tbz
CHANGED
|
Binary file
|
package/Detox-ios-src.tbz
CHANGED
|
Binary file
|
package/Detox-ios-xcuitest.tbz
CHANGED
|
Binary file
|
package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/DetoxIdlingResource.kt
CHANGED
|
@@ -19,7 +19,6 @@ abstract class DetoxIdlingResource : DescriptiveIdlingResource {
|
|
|
19
19
|
paused.set(false)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {
|
|
24
23
|
this.callback = callback
|
|
25
24
|
}
|
|
@@ -37,7 +36,6 @@ abstract class DetoxIdlingResource : DescriptiveIdlingResource {
|
|
|
37
36
|
|
|
38
37
|
protected abstract fun checkIdle(): Boolean
|
|
39
38
|
|
|
40
|
-
|
|
41
39
|
fun notifyIdle() {
|
|
42
40
|
callback?.onTransitionToIdle()
|
|
43
41
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
package com.wix.detox.reactnative.idlingresources
|
|
2
|
+
|
|
3
|
+
import androidx.test.espresso.IdlingResource.ResourceCallback
|
|
4
|
+
/**
|
|
5
|
+
* A wrapper for idling resources that exhibit "flapping" behavior.
|
|
6
|
+
* This wrapper artificially stabilizes them by mindfully extending their "busy" state periods.
|
|
7
|
+
*
|
|
8
|
+
* #### What does flapping mean?
|
|
9
|
+
*
|
|
10
|
+
* Some idling resources have extremely short busy periods. While this shouldn't theoretically be an issue,
|
|
11
|
+
* in real-world scenarios (e.g., a React Native environment), the number of idling resources can accumulate.
|
|
12
|
+
* Unfortunately, the process of checking if all resources are idle (idle interrogation)
|
|
13
|
+
* isn't atomic. With many resources involved, this process might miss those brief busy periods
|
|
14
|
+
* of resources that "flap" (quickly switch between busy and idle) during the interrogation.
|
|
15
|
+
*
|
|
16
|
+
* #### How does this wrapper fix flapping?
|
|
17
|
+
*
|
|
18
|
+
* This wrapper requires the wrapped resource to report itself as "idle" multiple times consecutively
|
|
19
|
+
* before the wrapper itself is considered idle. This dramatically reduces the likelihood of it's busy phase being
|
|
20
|
+
* missed by the idle interrogation process.
|
|
21
|
+
*/
|
|
22
|
+
class StabilizedIdlingResource(
|
|
23
|
+
private val idlingResource: DetoxIdlingResource,
|
|
24
|
+
private val size: Int): DetoxIdlingResource(), ResourceCallback {
|
|
25
|
+
|
|
26
|
+
private val name = "${idlingResource.name} (stable@$size)"
|
|
27
|
+
private var idleCounter = 0
|
|
28
|
+
|
|
29
|
+
init {
|
|
30
|
+
if (size <= 1) {
|
|
31
|
+
throw IllegalArgumentException("Size must be > 1 in order for the usage of this class to make sense")
|
|
32
|
+
}
|
|
33
|
+
idlingResource.registerIdleTransitionCallback(this)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Implemented according to these 3 guiding principles:
|
|
38
|
+
* 1. As long as the actual resource is busy - we consider ourselves busy too.
|
|
39
|
+
* 2. Once actual resource is idle enough times in a row - we consider ourselves "idle", in a *sticky* way
|
|
40
|
+
* (until it returns "busy" in an interrogation).
|
|
41
|
+
* 3. Espresso requires that just before we officially transition ourselves -- idle -> busy, we actively notify it
|
|
42
|
+
* via the callback.
|
|
43
|
+
*/
|
|
44
|
+
@Synchronized
|
|
45
|
+
override fun checkIdle(): Boolean {
|
|
46
|
+
if (!idlingResource.isIdleNow) {
|
|
47
|
+
idleCounter = 0
|
|
48
|
+
return false
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (idleCounter < size) {
|
|
52
|
+
idleCounter++
|
|
53
|
+
|
|
54
|
+
if (idleCounter == size) {
|
|
55
|
+
notifyIdle()
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return (idleCounter == size)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Resets the counter to 0, assuming that Espresso will re-query this (among all other) resources
|
|
63
|
+
* immediately after this "I'm idle" notification.
|
|
64
|
+
*/
|
|
65
|
+
@Synchronized
|
|
66
|
+
override fun onTransitionToIdle() {
|
|
67
|
+
idleCounter = 0
|
|
68
|
+
notifyIdle()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
override fun getName(): String = name
|
|
72
|
+
override fun getDebugName(): String = idlingResource.getDebugName()
|
|
73
|
+
override fun getBusyHint(): Map<String, Any>? = idlingResource.getBusyHint()
|
|
74
|
+
}
|
|
@@ -2,44 +2,36 @@ package com.wix.detox.reactnative.idlingresources.animations
|
|
|
2
2
|
|
|
3
3
|
import android.util.Log
|
|
4
4
|
import android.view.Choreographer
|
|
5
|
+
import androidx.annotation.UiThread
|
|
5
6
|
import androidx.test.espresso.IdlingResource.ResourceCallback
|
|
6
7
|
import com.facebook.react.animated.NativeAnimatedModule
|
|
8
|
+
import com.facebook.react.animated.NativeAnimatedNodesManager
|
|
7
9
|
import com.facebook.react.bridge.ReactContext
|
|
10
|
+
import com.wix.detox.common.DetoxErrors
|
|
11
|
+
import com.wix.detox.common.DetoxLog.Companion.LOG_TAG
|
|
8
12
|
import com.wix.detox.reactnative.idlingresources.DetoxIdlingResource
|
|
13
|
+
import kotlin.reflect.full.memberFunctions
|
|
14
|
+
import kotlin.reflect.full.memberProperties
|
|
15
|
+
import kotlin.reflect.jvm.isAccessible
|
|
9
16
|
|
|
10
|
-
private const val LOG_TAG = "Detox"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Created by simonracz on 25/08/2017.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* Espresso IdlingResource for React Native's Animated Module.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Hooks up to React Native internals to monitor the state of the animations.
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
17
|
class AnimatedModuleIdlingResource(private val reactContext: ReactContext) : DetoxIdlingResource(),
|
|
25
18
|
Choreographer.FrameCallback {
|
|
26
19
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
override fun getDebugName(): String {
|
|
30
|
-
return "ui"
|
|
31
|
-
}
|
|
20
|
+
private var animatedModule: AnimatedModuleFacade? = null
|
|
32
21
|
|
|
33
|
-
override fun
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
override fun getName(): String = AnimatedModuleIdlingResource::class.java.name
|
|
23
|
+
override fun getDebugName() = "ui"
|
|
24
|
+
override fun getBusyHint(): Map<String, Any> = mapOf("reason" to "Animations running on screen")
|
|
36
25
|
|
|
37
26
|
override fun checkIdle(): Boolean {
|
|
38
|
-
val animatedModule =
|
|
39
|
-
|
|
27
|
+
val animatedModule = getAnimatedModule()
|
|
28
|
+
if (animatedModule == null) {
|
|
29
|
+
Log.w(LOG_TAG, "AnimatedModule is idle because the native-module is not available")
|
|
30
|
+
return false
|
|
31
|
+
}
|
|
40
32
|
|
|
41
|
-
if (
|
|
42
|
-
|
|
33
|
+
if (animatedModule.hasQueuedAnimations() ||
|
|
34
|
+
animatedModule.hasActiveAnimations()) {
|
|
43
35
|
Choreographer.getInstance().postFrameCallback(this)
|
|
44
36
|
return false
|
|
45
37
|
}
|
|
@@ -61,4 +53,60 @@ class AnimatedModuleIdlingResource(private val reactContext: ReactContext) : Det
|
|
|
61
53
|
override fun doFrame(frameTimeNanos: Long) {
|
|
62
54
|
isIdleNow
|
|
63
55
|
}
|
|
56
|
+
|
|
57
|
+
private fun getAnimatedModule(): AnimatedModuleFacade? =
|
|
58
|
+
if (animatedModule != null) {
|
|
59
|
+
animatedModule
|
|
60
|
+
} else {
|
|
61
|
+
reactContext.getNativeModule(NativeAnimatedModule::class.java)?.let {
|
|
62
|
+
AnimatedModuleFacade(it).also { nativeModule ->
|
|
63
|
+
animatedModule = nativeModule
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private class AnimatedModuleFacade(private val animatedModule: NativeAnimatedModule) {
|
|
70
|
+
private val operationsQueue: OperationsQueueReflected
|
|
71
|
+
private val preOperationsQueue: OperationsQueueReflected
|
|
72
|
+
private val nodesManager: NativeAnimatedNodesManager
|
|
73
|
+
|
|
74
|
+
init {
|
|
75
|
+
operationsQueue = (NativeAnimatedModule::class.memberProperties.find { it.name == "mOperations" } ?:
|
|
76
|
+
throw DetoxErrors.DetoxIllegalStateException("mOperations property cannot be accessed")).let {
|
|
77
|
+
|
|
78
|
+
it.isAccessible = true
|
|
79
|
+
OperationsQueueReflected(it.get(animatedModule) as Any)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
preOperationsQueue = (NativeAnimatedModule::class.memberProperties.find { it.name == "mPreOperations" } ?:
|
|
83
|
+
throw DetoxErrors.DetoxIllegalStateException("mPreOperations property cannot be accessed")).let {
|
|
84
|
+
|
|
85
|
+
it.isAccessible = true
|
|
86
|
+
OperationsQueueReflected(it.get(animatedModule) as Any)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
nodesManager = animatedModule.nodesManager ?:
|
|
90
|
+
throw DetoxErrors.DetoxIllegalStateException("AnimatedModule exists but nodesManager is null")
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@UiThread
|
|
94
|
+
fun hasQueuedAnimations(): Boolean =
|
|
95
|
+
!preOperationsQueue.isEmpty() ||
|
|
96
|
+
!operationsQueue.isEmpty()
|
|
97
|
+
|
|
98
|
+
@UiThread
|
|
99
|
+
fun hasActiveAnimations(): Boolean {
|
|
100
|
+
return nodesManager.hasActiveAnimations()
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
class OperationsQueueReflected(private val operationsQueue: Any) {
|
|
105
|
+
fun isEmpty(): Boolean {
|
|
106
|
+
val isEmptyMethod = operationsQueue::class.memberFunctions.find { it.name == "isEmpty" } ?:
|
|
107
|
+
throw DetoxErrors.DetoxIllegalStateException("isEmpty method cannot be reached")
|
|
108
|
+
|
|
109
|
+
isEmptyMethod.isAccessible = true
|
|
110
|
+
return isEmptyMethod.call(operationsQueue) as Boolean
|
|
111
|
+
}
|
|
64
112
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
package com.wix.detox.reactnative.idlingresources.factory
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.ReactApplication
|
|
4
|
-
import com.wix.detox.reactnative.getCurrentReactContext
|
|
5
4
|
import com.wix.detox.reactnative.getCurrentReactContextSafe
|
|
6
5
|
import com.wix.detox.reactnative.idlingresources.DetoxIdlingResource
|
|
6
|
+
import com.wix.detox.reactnative.idlingresources.StabilizedIdlingResource
|
|
7
7
|
import com.wix.detox.reactnative.idlingresources.animations.AnimatedModuleIdlingResource
|
|
8
8
|
import com.wix.detox.reactnative.idlingresources.network.NetworkIdlingResource
|
|
9
9
|
import com.wix.detox.reactnative.idlingresources.storage.AsyncStorageIdlingResource
|
|
@@ -23,7 +23,7 @@ class FabricDetoxIdlingResourceFactoryStrategy(private val reactApplication: Rea
|
|
|
23
23
|
IdlingResourcesName.Animations to AnimatedModuleIdlingResource(reactContext),
|
|
24
24
|
IdlingResourcesName.Timers to FabricTimersIdlingResource(reactContext),
|
|
25
25
|
IdlingResourcesName.Network to NetworkIdlingResource(reactContext),
|
|
26
|
-
IdlingResourcesName.AsyncStorage to AsyncStorageIdlingResource(reactContext)
|
|
26
|
+
IdlingResourcesName.AsyncStorage to StabilizedIdlingResource(AsyncStorageIdlingResource(reactContext), 2)
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
return@withContext result
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
package com.wix.detox.reactnative.idlingresources.storage
|
|
2
2
|
|
|
3
|
-
import android.util.Log
|
|
4
3
|
import androidx.test.espresso.IdlingResource
|
|
5
4
|
import com.facebook.react.bridge.NativeModule
|
|
6
5
|
import com.facebook.react.bridge.ReactContext
|
|
@@ -9,36 +8,17 @@ import com.wix.detox.reactnative.idlingresources.DetoxIdlingResource
|
|
|
9
8
|
import org.joor.Reflect
|
|
10
9
|
import java.util.concurrent.Executor
|
|
11
10
|
|
|
12
|
-
private const val LOG_TAG = "AsyncStorageIR"
|
|
13
|
-
|
|
14
11
|
private typealias SExecutorReflectedGenFnType = (executor: Executor) -> SerialExecutorReflected
|
|
15
12
|
|
|
16
13
|
private val defaultSExecutorReflectedGenFn: SExecutorReflectedGenFnType =
|
|
17
14
|
{ executor: Executor -> SerialExecutorReflected(executor) }
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
private val executorReflected: SerialExecutorReflected
|
|
21
|
-
|
|
22
|
-
init {
|
|
23
|
-
val reflected = Reflect.on(module)
|
|
24
|
-
val executor: Executor = reflected.field("executor").get()
|
|
25
|
-
executorReflected = sexecutorReflectedGen(executor)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
val sexecutor: SerialExecutorReflected
|
|
29
|
-
get() = executorReflected
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
class AsyncStorageIdlingResource
|
|
33
|
-
@JvmOverloads constructor(
|
|
16
|
+
class AsyncStorageIdlingResource @JvmOverloads constructor(
|
|
34
17
|
private val reactContext: ReactContext,
|
|
35
18
|
private val sexecutorReflectedGenFn: SExecutorReflectedGenFnType = defaultSExecutorReflectedGenFn,
|
|
36
|
-
private val rnHelpers: RNHelpers = RNHelpers()
|
|
19
|
+
private val rnHelpers: RNHelpers = RNHelpers(),
|
|
37
20
|
) : DetoxIdlingResource() {
|
|
38
21
|
|
|
39
|
-
val logTag: String
|
|
40
|
-
get() = LOG_TAG
|
|
41
|
-
|
|
42
22
|
private val moduleReflected: ModuleReflected? = null
|
|
43
23
|
private var idleCheckTask: Runnable? = null
|
|
44
24
|
private val idleCheckTaskImpl = Runnable {
|
|
@@ -86,13 +66,14 @@ class AsyncStorageIdlingResource
|
|
|
86
66
|
|
|
87
67
|
override fun registerIdleTransitionCallback(callback: IdlingResource.ResourceCallback?) {
|
|
88
68
|
super.registerIdleTransitionCallback(callback)
|
|
69
|
+
|
|
70
|
+
// TODO Don't do?
|
|
89
71
|
enqueueIdleCheckTask()
|
|
90
72
|
}
|
|
91
73
|
|
|
92
74
|
override fun checkIdle(): Boolean =
|
|
93
75
|
checkIdleInternal().also { idle ->
|
|
94
76
|
if (!idle) {
|
|
95
|
-
Log.d(logTag, "Async-storage is busy!")
|
|
96
77
|
enqueueIdleCheckTask()
|
|
97
78
|
}
|
|
98
79
|
}
|
|
@@ -117,3 +98,16 @@ class AsyncStorageIdlingResource
|
|
|
117
98
|
idleCheckTask = null
|
|
118
99
|
}
|
|
119
100
|
}
|
|
101
|
+
|
|
102
|
+
private class ModuleReflected(module: NativeModule, sexecutorReflectedGen: SExecutorReflectedGenFnType) {
|
|
103
|
+
private val executorReflected: SerialExecutorReflected
|
|
104
|
+
|
|
105
|
+
init {
|
|
106
|
+
val reflected = Reflect.on(module)
|
|
107
|
+
val executor: Executor = reflected.field("executor").get()
|
|
108
|
+
executorReflected = sexecutorReflectedGen(executor)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
val sexecutor: SerialExecutorReflected
|
|
112
|
+
get() = executorReflected
|
|
113
|
+
}
|
|
@@ -42,7 +42,7 @@ class FabricUIManagerIdlingResources(
|
|
|
42
42
|
return mapOf("mount_items" to getMountItemsSize(), "view_command_mount_items" to getViewCommandMountItemsSize())
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
override fun getName() = FabricUIManagerIdlingResources::class.java.name
|
|
45
|
+
override fun getName(): String = FabricUIManagerIdlingResources::class.java.name
|
|
46
46
|
|
|
47
47
|
override fun doFrame(frameTimeNanos: Long) {
|
|
48
48
|
isIdleNow()
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "detox",
|
|
3
3
|
"description": "E2E tests and automation for mobile",
|
|
4
|
-
"version": "20.41.
|
|
4
|
+
"version": "20.41.3",
|
|
5
5
|
"bin": {
|
|
6
6
|
"detox": "local-cli/cli.js"
|
|
7
7
|
},
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"browserslist": [
|
|
121
121
|
"node 14"
|
|
122
122
|
],
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "fc33401cc27b42f8a7c48f2d6d6e8cee65117476"
|
|
124
124
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
97968da55f240e611120a4ba7e897e6d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b912e6c17ef3218c8354acd79131de14e0448939
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
32dd60b47992976bdba3a16ca29aa41465fd55ca32b753eb199f7bf635da9e36
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
28bb95f127648d30674af1094f453878aa38110a343a736a79ed30afbcb77666b09734bb8f6cc6023cb2dfac29ed8ed37c22d465360fcc53d6d01b11db5c9487
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4bb098d649a4fdfa8da731a13328f37c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7eb7b72ea93111298c4bd1c7fc0dcf37af928f2b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b478899eb20e565464f25f111b670f8e4373a63ba61745ad6bb5107c30b9911e
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
089dfef507028175839a71599ed64d6c938c59336a41a0fa59d5069b1782eb33ad6d4ba1b5e0efaff3ce7d5f13dfc07646a59105df0df04e9bb8b63094d269e1
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1218ce00d445ca0ca30d8bc2dd59805e
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
20211dfcb93a60e9fcc3963f87a618b333c168cb
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b6b4542f4a3a9bc525ebb3b4f60cf42a6f9dd1c436be47a6f8527fe3bb1c0a28
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7ec3b3de35caff931d161876b62b8a5ae528d5d3dbe1d66b1edec0dc828df666e866c33b8cb00a1c12f48c3a9476fd2db794bcae1cb9238b39dcb85519774198
|