detox 20.41.1 → 20.41.2

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.
Files changed (38) hide show
  1. package/Detox-android/com/wix/detox/{20.41.1/detox-20.41.1-sources.jar → 20.41.2/detox-20.41.2-sources.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2-sources.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2-sources.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2-sources.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2-sources.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{20.41.1/detox-20.41.1.aar → 20.41.2/detox-20.41.2.aar} +0 -0
  7. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.aar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.aar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.aar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.aar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{20.41.1/detox-20.41.1.pom → 20.41.2/detox-20.41.2.pom} +1 -1
  12. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.pom.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.pom.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.pom.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.pom.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  17. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  18. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  19. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  20. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  21. package/Detox-ios-framework.tbz +0 -0
  22. package/Detox-ios-src.tbz +0 -0
  23. package/Detox-ios-xcuitest.tbz +0 -0
  24. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/animations/AnimatedModuleIdlingResource.kt +74 -26
  25. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/fabric/FabricUIManagerIdlingResources.kt +1 -1
  26. package/package.json +2 -2
  27. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1-sources.jar.md5 +0 -1
  28. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1-sources.jar.sha1 +0 -1
  29. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1-sources.jar.sha256 +0 -1
  30. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1-sources.jar.sha512 +0 -1
  31. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.aar.md5 +0 -1
  32. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.aar.sha1 +0 -1
  33. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.aar.sha256 +0 -1
  34. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.aar.sha512 +0 -1
  35. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.pom.md5 +0 -1
  36. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.pom.sha1 +0 -1
  37. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.pom.sha256 +0 -1
  38. package/Detox-android/com/wix/detox/20.41.1/detox-20.41.1.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ 78e6a14fb3535afbf9e26a44532bad26
@@ -0,0 +1 @@
1
+ 6608ad7ef3136c6a6a96d8c0196c015266fad90b
@@ -0,0 +1 @@
1
+ 8cad5bb8dcadcb1489d21e9eb02b4e404ba142611cac6c9e0b5b870eabd02644
@@ -0,0 +1 @@
1
+ 420217e7885b9b62f1345d4a75fa684508898a054f188e60816f6cdbfc95bc8ca4af71d09f60d81246fb723f551b52b211765c59f9edc10394b508387f1293d1
@@ -0,0 +1 @@
1
+ 92af4eb56025da6478dcf052cc974ed9
@@ -0,0 +1 @@
1
+ caa2f11c005b65f021c582cf67539513db45db0c
@@ -0,0 +1 @@
1
+ 69db0de12353910d42ff6cfb919ff43ddfb3225f762463bc326f31741f20c118
@@ -0,0 +1 @@
1
+ aa19d01f92ff6aa9724f8eba5d9b705e0d549105a08f11b643e5fcd530d292ee9be73a354a447d2d1377ed80ebe07cf7da405da06c6a382ea1127b69e105b543
@@ -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.1</version>
6
+ <version>20.41.2</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
+ 03211aed18c8bbd28357bdbbc15b17ed
@@ -0,0 +1 @@
1
+ 3d506946f8dd584cd3f5f849f81ce8badba26ff1
@@ -0,0 +1 @@
1
+ 2b73ef91d19c21879c9f7562235484c19750e46011ba430b2255a50a6c23bc90
@@ -0,0 +1 @@
1
+ 3cf68662b57730aa809c02a55762284adaae491b7ff7b96781630e7e2829c530d956f099d12bd5a27d45a72d995befd5b127c4d966ddfbd322dcf43715316d3d
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.41.1</latest>
7
- <release>20.41.1</release>
6
+ <latest>20.41.2</latest>
7
+ <release>20.41.2</release>
8
8
  <versions>
9
- <version>20.41.1</version>
9
+ <version>20.41.2</version>
10
10
  </versions>
11
- <lastUpdated>20250902150145</lastUpdated>
11
+ <lastUpdated>20250916084648</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 26255dfef3d35603ef3cc58d847b134b
1
+ 78b2664291287ff2e98abc7833e1ff32
@@ -1 +1 @@
1
- f74b348fd5620867b74020889fc42e7645de6b87
1
+ 3815f5ec320d3eb9cf95c90163e24c91f5120f41
@@ -1 +1 @@
1
- 02ccfce690001b13bb22a389daa3f5be077cd63d45034bc9cca5783a35a520e2
1
+ 0ba98253bc44988f584d1c5dc53ef6da8485af9b8a1b208494bca124883669cd
@@ -1 +1 @@
1
- fa3f21c0eef3aa60cc7231ce88e6323e2ba76b6fced9deb54cdbe5ec8d33c2c483fb09b4c49270dbf453178d197b68a469698a87886f84908f1c09dcc1893724
1
+ 6b8f60519bdf9dd63e87f1493dd74c0489d23bec33784921069c0ead127ba66f546d1cc0ed2fa75c818f7f2f28b2a464242e20879ed12f130fdc3de42d442cc5
Binary file
package/Detox-ios-src.tbz CHANGED
Binary file
Binary file
@@ -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
- override fun getName() = AnimatedModuleIdlingResource::class.java.name
28
-
29
- override fun getDebugName(): String {
30
- return "ui"
31
- }
20
+ private var animatedModule: AnimatedModuleFacade? = null
32
21
 
33
- override fun getBusyHint(): Map<String, Any> {
34
- return mapOf("reason" to "Animations running on screen")
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 = reactContext.getNativeModule(NativeAnimatedModule::class.java)
39
- val hasAnimations = animatedModule?.nodesManager?.hasActiveAnimations() ?: false
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 (hasAnimations) {
42
- Log.i(LOG_TAG, "AnimatedModule is busy.")
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
  }
@@ -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.1",
4
+ "version": "20.41.2",
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": "5f19fc2c3902a58d7ce2c7bb70ac5c4021dca6ea"
123
+ "gitHead": "69e708aaa8c8dac999c8d442751865df66723cb9"
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