detox 20.41.2 → 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.
Files changed (41) hide show
  1. package/Detox-android/com/wix/detox/{20.41.2/detox-20.41.2-sources.jar → 20.41.3/detox-20.41.3-sources.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3-sources.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3-sources.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3-sources.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3-sources.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{20.41.2/detox-20.41.2.aar → 20.41.3/detox-20.41.3.aar} +0 -0
  7. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.aar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.aar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.aar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.aar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{20.41.2/detox-20.41.2.pom → 20.41.3/detox-20.41.3.pom} +1 -1
  12. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.pom.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.pom.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.pom.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.41.3/detox-20.41.3.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/DetoxIdlingResource.kt +0 -2
  25. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/ReactNativeIdlingResources.kt +0 -1
  26. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/StabilizedIdlingResource.kt +74 -0
  27. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/factory/FabricDetoxIdlingResourceFactoryStrategy.kt +2 -2
  28. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/storage/AsyncStorageIdlingResource.kt +17 -23
  29. package/package.json +2 -2
  30. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2-sources.jar.md5 +0 -1
  31. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2-sources.jar.sha1 +0 -1
  32. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2-sources.jar.sha256 +0 -1
  33. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2-sources.jar.sha512 +0 -1
  34. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.aar.md5 +0 -1
  35. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.aar.sha1 +0 -1
  36. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.aar.sha256 +0 -1
  37. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.aar.sha512 +0 -1
  38. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.pom.md5 +0 -1
  39. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.pom.sha1 +0 -1
  40. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.pom.sha256 +0 -1
  41. package/Detox-android/com/wix/detox/20.41.2/detox-20.41.2.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ d62daa3c6360e40eee316c7e7d391989
@@ -0,0 +1 @@
1
+ 7188b3152f33cad1dbd467ee2c9daa649f1482a7
@@ -0,0 +1 @@
1
+ b7a9075a28971504483bdca303e45acb179c2aa16583d03397496372f40aca8a
@@ -0,0 +1 @@
1
+ 83d09a205dd16e6d517249b663f56634604066ac3a974f018cdeed02c0868d4ce67db7b23015592d9a9c3692ec0339124df33644882824245b84413fb7b9ed81
@@ -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.2</version>
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.2</latest>
7
- <release>20.41.2</release>
6
+ <latest>20.41.3</latest>
7
+ <release>20.41.3</release>
8
8
  <versions>
9
- <version>20.41.2</version>
9
+ <version>20.41.3</version>
10
10
  </versions>
11
- <lastUpdated>20250916084648</lastUpdated>
11
+ <lastUpdated>20250918141124</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 78b2664291287ff2e98abc7833e1ff32
1
+ 6f57826a3230198297bce5e007333fac
@@ -1 +1 @@
1
- 3815f5ec320d3eb9cf95c90163e24c91f5120f41
1
+ c8416ca659f3d8c733dfa7b9f187558b8fd9c716
@@ -1 +1 @@
1
- 0ba98253bc44988f584d1c5dc53ef6da8485af9b8a1b208494bca124883669cd
1
+ def56429b5323f8b16fe2d813001f68694bffe308821c3d3ecc28f4d5c04a679
@@ -1 +1 @@
1
- 6b8f60519bdf9dd63e87f1493dd74c0489d23bec33784921069c0ead127ba66f546d1cc0ed2fa75c818f7f2f28b2a464242e20879ed12f130fdc3de42d442cc5
1
+ ae9fae3a019fdc3e7d87689f447e7817a942f68dbae4b3e6ce9fa395bab9cc017d1df68ae3af204275c10d553bb00c62aac54be18f2bcf06a58ae2c886ebbeaa
Binary file
package/Detox-ios-src.tbz CHANGED
Binary file
Binary file
@@ -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
  }
@@ -16,7 +16,6 @@ import com.wix.detox.reactnative.idlingresources.network.NetworkIdlingResource
16
16
  import kotlinx.coroutines.runBlocking
17
17
  import org.joor.Reflect
18
18
 
19
-
20
19
  private const val LOG_TAG = "DetoxRNIdleRes"
21
20
 
22
21
  class ReactNativeIdlingResources(
@@ -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
+ }
@@ -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
- private class ModuleReflected(module: NativeModule, sexecutorReflectedGen: SExecutorReflectedGenFnType) {
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
+ }
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.2",
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": "69e708aaa8c8dac999c8d442751865df66723cb9"
123
+ "gitHead": "fc33401cc27b42f8a7c48f2d6d6e8cee65117476"
124
124
  }
@@ -1 +0,0 @@
1
- 78e6a14fb3535afbf9e26a44532bad26
@@ -1 +0,0 @@
1
- 6608ad7ef3136c6a6a96d8c0196c015266fad90b
@@ -1 +0,0 @@
1
- 8cad5bb8dcadcb1489d21e9eb02b4e404ba142611cac6c9e0b5b870eabd02644
@@ -1 +0,0 @@
1
- 420217e7885b9b62f1345d4a75fa684508898a054f188e60816f6cdbfc95bc8ca4af71d09f60d81246fb723f551b52b211765c59f9edc10394b508387f1293d1
@@ -1 +0,0 @@
1
- 92af4eb56025da6478dcf052cc974ed9
@@ -1 +0,0 @@
1
- caa2f11c005b65f021c582cf67539513db45db0c
@@ -1 +0,0 @@
1
- 69db0de12353910d42ff6cfb919ff43ddfb3225f762463bc326f31741f20c118
@@ -1 +0,0 @@
1
- aa19d01f92ff6aa9724f8eba5d9b705e0d549105a08f11b643e5fcd530d292ee9be73a354a447d2d1377ed80ebe07cf7da405da06c6a382ea1127b69e105b543
@@ -1 +0,0 @@
1
- 03211aed18c8bbd28357bdbbc15b17ed
@@ -1 +0,0 @@
1
- 3d506946f8dd584cd3f5f849f81ce8badba26ff1
@@ -1 +0,0 @@
1
- 2b73ef91d19c21879c9f7562235484c19750e46011ba430b2255a50a6c23bc90
@@ -1 +0,0 @@
1
- 3cf68662b57730aa809c02a55762284adaae491b7ff7b96781630e7e2829c530d956f099d12bd5a27d45a72d995befd5b127c4d966ddfbd322dcf43715316d3d