detox 20.44.0-smoke.0 → 20.44.0-smoke.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 (44) hide show
  1. package/Detox-android/com/wix/detox/{20.44.0-smoke.0/detox-20.44.0-smoke.0-sources.jar → 20.44.0-smoke.2/detox-20.44.0-smoke.2-sources.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2-sources.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2-sources.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2-sources.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2-sources.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2.aar +0 -0
  7. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2.aar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2.aar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2.aar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2.aar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{20.44.0-smoke.0/detox-20.44.0-smoke.0.pom → 20.44.0-smoke.2/detox-20.44.0-smoke.2.pom} +1 -1
  12. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2.pom.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2.pom.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.2.pom.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.44.0-smoke.2/detox-20.44.0-smoke.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/adapters/server/DetoxActionHandlers.kt +1 -7
  25. package/android/detox/src/full/java/com/wix/detox/espresso/hierarchy/ViewHierarchyGenerator.kt +14 -63
  26. package/android/detox/src/full/java/com/wix/detox/inquiry/FabricAnimationsInquirer.kt +430 -0
  27. package/android/detox/src/full/java/com/wix/detox/inquiry/ViewLifecycleRegistry.kt +83 -173
  28. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/animations/AnimatedModuleIdlingResource.kt +7 -2
  29. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/fabric/FabricUIManagerIdlingResources.kt +1 -207
  30. package/package.json +2 -2
  31. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0-sources.jar.md5 +0 -1
  32. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0-sources.jar.sha1 +0 -1
  33. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0-sources.jar.sha256 +0 -1
  34. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0-sources.jar.sha512 +0 -1
  35. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.aar +0 -0
  36. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.aar.md5 +0 -1
  37. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.aar.sha1 +0 -1
  38. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.aar.sha256 +0 -1
  39. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.aar.sha512 +0 -1
  40. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.pom.md5 +0 -1
  41. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.pom.sha1 +0 -1
  42. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.pom.sha256 +0 -1
  43. package/Detox-android/com/wix/detox/20.44.0-smoke.0/detox-20.44.0-smoke.0.pom.sha512 +0 -1
  44. package/android/detox/src/full/java/com/wix/detox/inquiry/DetoxFabricAnimationHook.kt +0 -192
@@ -1,192 +0,0 @@
1
- package com.wix.detox.inquiry
2
-
3
- import android.util.Log
4
- import android.view.View
5
- import com.facebook.react.bridge.ReadableMap
6
- import com.facebook.react.fabric.mounting.SurfaceMountingManager
7
- import com.wix.detox.inquiry.ViewLifecycleRegistry.markAnimated
8
- import com.wix.detox.inquiry.ViewLifecycleRegistry.markMounted
9
- import com.wix.detox.inquiry.ViewLifecycleRegistry.markUpdated
10
- import com.wix.detox.inquiry.ViewLifecycleRegistry.markCustomEvent
11
-
12
- /**
13
- * Hook into React Native's Fabric new architecture to track view lifecycle events.
14
- * This hooks into the exact points where views are mounted, updated, and animated.
15
- */
16
- object DetoxFabricAnimationHook {
17
- private const val LOG_TAG = "DetoxFabricHook"
18
-
19
- /**
20
- * Hook into IntBufferBatchMountItem.execute() to track animated view updates.
21
- * This is called when animated props are applied to views in Fabric.
22
- */
23
- fun hookIntBufferBatchMountItem(
24
- viewTag: Int,
25
- props: ReadableMap?,
26
- surfaceMountingManager: SurfaceMountingManager
27
- ) {
28
- try {
29
- // Get the actual Android View
30
- val androidView = getViewByTag(surfaceMountingManager, viewTag)
31
- if (androidView == null) {
32
- Log.d(LOG_TAG, "View not found for tag: $viewTag")
33
- return
34
- }
35
-
36
- // Check if this is an animated update
37
- if (isAnimatedPropsUpdate(props)) {
38
- Log.d(LOG_TAG, "Animated props update for view tag: $viewTag")
39
- markAnimated(androidView)
40
-
41
- // Log problematic animations
42
- if (isProblematicAnimation(props)) {
43
- Log.w(LOG_TAG, "Problematic animation detected for view tag: $viewTag")
44
- markCustomEvent(androidView, "problematic_animation")
45
- }
46
- } else {
47
- // Regular props update
48
- markUpdated(androidView)
49
- }
50
-
51
- } catch (e: Exception) {
52
- Log.w(LOG_TAG, "Failed to hook animated view update", e)
53
- }
54
- }
55
-
56
- /**
57
- * Hook into view mount operations to track when views are created.
58
- */
59
- fun hookViewMount(
60
- viewTag: Int,
61
- surfaceMountingManager: SurfaceMountingManager
62
- ) {
63
- try {
64
- val androidView = getViewByTag(surfaceMountingManager, viewTag)
65
- if (androidView != null) {
66
- Log.d(LOG_TAG, "View mounted with tag: $viewTag")
67
- markMounted(androidView)
68
- }
69
- } catch (e: Exception) {
70
- Log.w(LOG_TAG, "Failed to hook view mount", e)
71
- }
72
- }
73
-
74
- /**
75
- * Get Android View by React Native view tag using reflection.
76
- * This works around the fact that SurfaceMountingManager doesn't expose a direct getView method.
77
- */
78
- private fun getViewByTag(
79
- surfaceMountingManager: SurfaceMountingManager,
80
- viewTag: Int
81
- ): View? {
82
- return try {
83
- // Use reflection to access the internal view registry
84
- val viewRegistryField = surfaceMountingManager.javaClass.getDeclaredField("mViewRegistry")
85
- viewRegistryField.isAccessible = true
86
- val viewRegistry = viewRegistryField.get(surfaceMountingManager)
87
-
88
- // Get the view from the registry
89
- val getViewMethod = viewRegistry.javaClass.getMethod("getView", Int::class.java)
90
- getViewMethod.invoke(viewRegistry, viewTag) as? View
91
- } catch (e: Exception) {
92
- Log.w(LOG_TAG, "Failed to get view by tag: $viewTag", e)
93
- null
94
- }
95
- }
96
-
97
- /**
98
- * Check if this is an animated props update by looking for animated properties.
99
- */
100
- private fun isAnimatedPropsUpdate(props: ReadableMap?): Boolean {
101
- if (props == null) return false
102
-
103
- val animatedKeys = setOf(
104
- "transform", "opacity", "scaleX", "scaleY", "scale",
105
- "translateX", "translateY", "rotateX", "rotateY", "rotateZ",
106
- "backgroundColor", "borderRadius", "borderWidth"
107
- )
108
-
109
- val iterator = props.keySetIterator()
110
- while (iterator.hasNextKey()) {
111
- val key = iterator.nextKey()
112
- if (animatedKeys.any { key.contains(it, ignoreCase = true) }) {
113
- return true
114
- }
115
- }
116
-
117
- return false
118
- }
119
-
120
- /**
121
- * Check if this animation might be problematic (infinite loops, conflicting animations, etc.).
122
- */
123
- private fun isProblematicAnimation(props: ReadableMap?): Boolean {
124
- if (props == null) return false
125
-
126
- // Check for potential infinite loop patterns
127
- val transformKeys = mutableSetOf<String>()
128
- val iterator = props.keySetIterator()
129
-
130
- while (iterator.hasNextKey()) {
131
- val key = iterator.nextKey()
132
- if (key.contains("transform", ignoreCase = true)) {
133
- transformKeys.add(key)
134
- }
135
- }
136
-
137
- // Multiple transform properties might indicate conflicting animations
138
- if (transformKeys.size > 3) {
139
- Log.w(LOG_TAG, "Multiple transform properties detected: $transformKeys")
140
- return true
141
- }
142
-
143
- // Check for opacity animations that might cause issues
144
- if (props.hasKey("opacity")) {
145
- val opacity = props.getDouble("opacity")
146
- if (opacity < 0.0 || opacity > 1.0) {
147
- Log.w(LOG_TAG, "Invalid opacity value: $opacity")
148
- return true
149
- }
150
- }
151
-
152
- return false
153
- }
154
-
155
- /**
156
- * Get view coordinates for highlighting
157
- */
158
- fun getViewCoordinates(view: View): IntArray {
159
- val coords = intArrayOf(0, 0, 0, 0)
160
- try {
161
- view.getLocationOnScreen(coords)
162
- coords[2] = view.width
163
- coords[3] = view.height
164
- } catch (e: Exception) {
165
- Log.w(LOG_TAG, "Failed to get view coordinates", e)
166
- }
167
- return coords
168
- }
169
-
170
- /**
171
- * Get view coordinates relative to root view
172
- */
173
- fun getViewCoordinatesRelativeToRoot(view: View, rootView: View): IntArray {
174
- val viewCoords = getViewCoordinates(view)
175
- val rootCoords = getViewCoordinates(rootView)
176
-
177
- return intArrayOf(
178
- viewCoords[0] - rootCoords[0], // Relative X
179
- viewCoords[1] - rootCoords[1], // Relative Y
180
- viewCoords[2], // Width
181
- viewCoords[3] // Height
182
- )
183
- }
184
-
185
- /**
186
- * Log current registry statistics
187
- */
188
- fun logRegistryStats() {
189
- val stats = ViewLifecycleRegistry.getStats()
190
- Log.i(LOG_TAG, "ViewLifecycleRegistry stats: $stats")
191
- }
192
- }