detox 19.8.1 → 19.8.4

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 (51) hide show
  1. package/Detox-android/com/wix/detox/{19.8.1/detox-19.8.1-javadoc.jar → 19.8.4/detox-19.8.4-javadoc.jar} +0 -0
  2. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-javadoc.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-javadoc.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-javadoc.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-javadoc.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{19.8.1/detox-19.8.1-sources.jar → 19.8.4/detox-19.8.4-sources.jar} +0 -0
  7. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-sources.jar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-sources.jar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-sources.jar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-sources.jar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar +0 -0
  12. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar.md5 +1 -0
  13. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/{19.8.1/detox-19.8.1.pom → 19.8.4/detox-19.8.4.pom} +1 -1
  17. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.pom.md5 +1 -0
  18. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.pom.sha1 +1 -0
  19. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.pom.sha256 +1 -0
  20. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.pom.sha512 +1 -0
  21. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  22. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  23. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  24. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  25. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  26. package/Detox-ios-src.tbz +0 -0
  27. package/Detox-ios.tbz +0 -0
  28. package/android/detox/src/full/java/com/wix/detox/adapters/server/WebSocketClient.java +3 -1
  29. package/android/detox/src/full/java/com/wix/detox/espresso/UiAutomatorHelper.java +1 -1
  30. package/android/detox/src/full/java/com/wix/detox/reactnative/ReactNativeLoadingMonitor.kt +54 -8
  31. package/android/detox/src/main/java/com/wix/detox/common/DetoxErrors.java +4 -0
  32. package/android/detox/src/main/java/com/wix/detox/espresso/UiControllerSpy.kt +2 -1
  33. package/android/detox/src/main/java/com/wix/detox/espresso/action/common/utils/UiControllerUtils.kt +1 -1
  34. package/package.json +2 -2
  35. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1-javadoc.jar.md5 +0 -1
  36. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1-javadoc.jar.sha1 +0 -1
  37. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1-javadoc.jar.sha256 +0 -1
  38. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1-javadoc.jar.sha512 +0 -1
  39. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1-sources.jar.md5 +0 -1
  40. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1-sources.jar.sha1 +0 -1
  41. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1-sources.jar.sha256 +0 -1
  42. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1-sources.jar.sha512 +0 -1
  43. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.aar +0 -0
  44. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.aar.md5 +0 -1
  45. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.aar.sha1 +0 -1
  46. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.aar.sha256 +0 -1
  47. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.aar.sha512 +0 -1
  48. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.pom.md5 +0 -1
  49. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.pom.sha1 +0 -1
  50. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.pom.sha256 +0 -1
  51. package/Detox-android/com/wix/detox/19.8.1/detox-19.8.1.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ f1eff49df29549c4f094b94f820d8659
@@ -0,0 +1 @@
1
+ 00703d0219b1e8ad51dfe52206f2ff795956136d
@@ -0,0 +1 @@
1
+ c40e8c0d55385f0ee35aec198dcf9ae2a63c4279786603aa9294436384fb3dcd
@@ -0,0 +1 @@
1
+ 00742f6f56f5314f0a1ffa99e4e831615a926fe8e9e32d94725903e23ee6ed8067682d0bedd19350f092aebbe2a90c705e050a20967103e6599ae237a0882baf
@@ -0,0 +1 @@
1
+ 7070b5efa82ce7926d40972ca14ec8fd
@@ -0,0 +1 @@
1
+ f6c4c5b5f2eb5d89f6605df7b09f7b2689bd132d
@@ -0,0 +1 @@
1
+ 558d13035ea21c4f584b8463cfd923bbcfcfd0ef904ec4e9d45b17bff8aa5cea
@@ -0,0 +1 @@
1
+ 631b37c92c17dd5158e8b72b305ba18adc69b71a7a72449c00fd9cffa36d7627a341f6825d1c809a77c9dfecd5ffe3a795d23f3f48be3081f2a6cce4a5bd2d8e
@@ -0,0 +1 @@
1
+ 6d3f9250a50b2297577f126aa0253833
@@ -0,0 +1 @@
1
+ e8a6d8b30ca550020ddcc21a061ea5cb360515d8
@@ -0,0 +1 @@
1
+ bc528b332ad97156496b6d44e60005884f2d9ffe79808319e4a844b65cad9810
@@ -0,0 +1 @@
1
+ d3b944c0bedc48769416f46594853b759776b04befafc96314f2023f01f94607b43a22f2ebffe2ccd2c1c9144357d8e8888b600bfed1c8550263ff1c63d1f22f
@@ -3,7 +3,7 @@
3
3
  <modelVersion>4.0.0</modelVersion>
4
4
  <groupId>com.wix</groupId>
5
5
  <artifactId>detox</artifactId>
6
- <version>19.8.1</version>
6
+ <version>19.8.4</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
+ 73a0b8c6ccc7b6f6eb6b3cc381eafba5
@@ -0,0 +1 @@
1
+ 9212f8d378d2bb72115181b5e2c4d086eaa7ba2f
@@ -0,0 +1 @@
1
+ 4a350adbac62859765229611809d3cd99eec3c0d3d46c8dcf49916c9cb53fe34
@@ -0,0 +1 @@
1
+ 3fd69cb6ccc763c9bae624716a6e76bcafafd0946c9562505ab5c3592c27ab6873f1f2adaa6d30fc89549f3b50ca451e902559ef290596b903beb696ac883d4e
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>19.8.1</latest>
7
- <release>19.8.1</release>
6
+ <latest>19.8.4</latest>
7
+ <release>19.8.4</release>
8
8
  <versions>
9
- <version>19.8.1</version>
9
+ <version>19.8.4</version>
10
10
  </versions>
11
- <lastUpdated>20220721104600</lastUpdated>
11
+ <lastUpdated>20220727140215</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- b9232282dd2ac6e3b284ee0779590fa4
1
+ c501ff858a7bb71d219fa1e0504ac399
@@ -1 +1 @@
1
- fb8701a5ff95ecd1cfb766682081bf40c9b6d93e
1
+ 418f60ae638bc1cf710675ae55dfedfb4a5705a2
@@ -1 +1 @@
1
- 514e070dfdcc572437293385f135e06606bebe45db356d8624e1b499cc315c20
1
+ 4be1847db0453c931c85f1e489b98839b139e7a7f1cf0a261735d2ba594a0830
@@ -1 +1 @@
1
- 00d9223a84d99ecc9f4ffedb14b23f5fd70d14b7a1476043b33f072e54c055c80f0679984eb58b7dbcd94a7795f285782e8713a5e491413c2ccfa55197216565
1
+ b5ed6a0e3a4116823cd62582a4bfd638beffbf4400bb5338f882da0ef102ed9c3892df6bc8e963ba94b559d384c25533da0d4e053068aadeee81fa124d94df4e
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
@@ -2,6 +2,8 @@ package com.wix.detox.adapters.server;
2
2
 
3
3
  import android.util.Log;
4
4
 
5
+ import com.wix.detox.common.DetoxErrors;
6
+
5
7
  import org.json.JSONException;
6
8
  import org.json.JSONObject;
7
9
 
@@ -84,7 +86,7 @@ public class WebSocketClient {
84
86
  wsEventsHandler.onAction(type, params.toString(), messageId);
85
87
  }
86
88
  } catch (JSONException e) {
87
- Log.e(LOG_TAG, "Detox Error: receiveAction decode - " + e.toString());
89
+ throw new DetoxErrors.DetoxIllegalArgumentException(e);
88
90
  }
89
91
  }
90
92
 
@@ -5,7 +5,7 @@ import android.util.Log;
5
5
  import android.view.Choreographer;
6
6
 
7
7
  import com.wix.detox.common.UIThread;
8
- import com.wix.detox.espresso.common.utils.UiControllerUtils;
8
+ import com.wix.detox.espresso.action.common.utils.UiControllerUtils;
9
9
 
10
10
  import org.joor.Reflect;
11
11
  import org.joor.ReflectException;
@@ -7,17 +7,22 @@ import com.facebook.react.ReactInstanceManager
7
7
  import com.facebook.react.bridge.ReactContext
8
8
  import com.wix.detox.common.DetoxErrors
9
9
  import com.wix.detox.config.DetoxConfig
10
+ import org.joor.Reflect
11
+ import java.lang.reflect.Proxy
10
12
  import java.util.concurrent.CountDownLatch
11
13
  import java.util.concurrent.TimeUnit
12
14
 
13
15
  private const val LOG_TAG = "DetoxRNLoading"
14
16
 
17
+ private const val REACT_INSTANCE_EVENT_LISTENER_CLASS = "com.facebook.react.ReactInstanceEventListener"
18
+ private const val REACT_INSTANCE_EVENT_LISTENER_CLASS_COMPAT = "com.facebook.react.ReactInstanceManager\$ReactInstanceEventListener"
19
+
15
20
  open class ReactNativeLoadingMonitor(
16
21
  private val instrumentation: Instrumentation,
17
22
  private val rnApplication: ReactApplication,
18
23
  private val previousReactContext: ReactContext?,
19
24
  private val config: DetoxConfig = DetoxConfig.CONFIG) {
20
- val countDownLatch = CountDownLatch(1)
25
+ private val countDownLatch = CountDownLatch(1)
21
26
 
22
27
  fun getNewContext(): ReactContext? {
23
28
  subscribeToNewRNContextUpdates()
@@ -35,13 +40,9 @@ open class ReactNativeLoadingMonitor(
35
40
  return@Runnable
36
41
  }
37
42
 
38
- rnInstanceManager.addReactInstanceEventListener(object : ReactInstanceManager.ReactInstanceEventListener {
39
- override fun onReactContextInitialized(context: ReactContext) {
40
- Log.i(LOG_TAG, "Got new RN-context async'ly through listener")
41
- rnInstanceManager.removeReactInstanceEventListener(this)
42
- countDownLatch.countDown()
43
- }
44
- })
43
+ subscribeAsyncRNContextHandler(rnInstanceManager) {
44
+ countDownLatch.countDown()
45
+ }
45
46
  })
46
47
  }
47
48
 
@@ -81,3 +82,48 @@ open class ReactNativeLoadingMonitor(
81
82
  return rnInstanceManager.currentReactContext
82
83
  }
83
84
  }
85
+
86
+ private interface DummyListenerIdentifier
87
+
88
+ /**
89
+ * This baby bridges over RN's breaking change introduced in version 0.68:
90
+ * `ReactInstanceManager$ReactInstanceEventListener` was extracted onto a separate interface, having
91
+ * `ReactInstanceManager.{add|remove}ReactInstanceEventLister()` changing their signature to use it, accordingly.
92
+ *
93
+ * This made us resort to a solution based on dynamic proxies, because - depending on RN's version (at runtime), we
94
+ * need to dynamically decide what interface we "extend" (or actually shadow) via the proxy.
95
+ *
96
+ * @see RNDiff https://github.com/facebook/react-native/compare/v0.67.4..v0.68.0#diff-2f01f0cd7ff8c9ea58f12ef0eff5fa8250cad144dd5490598d80d8e9e743458aR1009
97
+ * @see DynamicProxies https://docs.oracle.com/javase/8/docs/technotes/guides/reflection/proxy.html
98
+ */
99
+ private fun subscribeAsyncRNContextHandler(rnInstanceManager: ReactInstanceManager, onReactContextInitialized: () -> Any) {
100
+ val listenerClass = resolveListenerClass()
101
+ val proxyInterfaces = arrayOf(
102
+ listenerClass,
103
+ DummyListenerIdentifier::class.java // In order to be able to implement equals()
104
+ )
105
+ val listener = Proxy.newProxyInstance(listenerClass.classLoader, proxyInterfaces) { listener, method, args ->
106
+ Log.d(LOG_TAG, "Listener-proxy method called: ${method.name}")
107
+
108
+ val result = when (method.name) {
109
+ "onReactContextInitialized" -> {
110
+ Log.i(LOG_TAG, "Got new RN-context async'ly through listener")
111
+ Reflect.on(rnInstanceManager).call("removeReactInstanceEventListener", listener)
112
+ onReactContextInitialized()
113
+ }
114
+ "equals" -> {
115
+ val candidate = args[0]
116
+ candidate is DummyListenerIdentifier
117
+ }
118
+ else -> Any()
119
+ }
120
+
121
+ result
122
+ }
123
+ Reflect.on(rnInstanceManager).call("addReactInstanceEventListener", listener)
124
+ }
125
+
126
+ private fun resolveListenerClass(): Class<*> {
127
+ val className = if (ReactNativeInfo.rnVersion().minor >= 68) REACT_INSTANCE_EVENT_LISTENER_CLASS else REACT_INSTANCE_EVENT_LISTENER_CLASS_COMPAT
128
+ return Class.forName(className)
129
+ }
@@ -30,5 +30,9 @@ public interface DetoxErrors {
30
30
  public DetoxIllegalArgumentException(String message) {
31
31
  super(message);
32
32
  }
33
+
34
+ public DetoxIllegalArgumentException(Throwable cause) {
35
+ super(cause);
36
+ }
33
37
  }
34
38
  }
@@ -1,10 +1,11 @@
1
+
1
2
  package com.wix.detox.espresso
2
3
 
3
4
  import androidx.test.espresso.UiController
4
5
  import com.wix.detox.common.proxy.CallInfo
5
6
  import com.wix.detox.common.proxy.SpyingInvocationHandler
6
7
  import com.wix.detox.common.proxy.MethodsSpy
7
- import com.wix.detox.espresso.common.utils.getUiController
8
+ import com.wix.detox.espresso.action.common.utils.getUiController
8
9
  import org.joor.Reflect
9
10
 
10
11
  class UiControllerSpy: MethodsSpy("uiController") {
@@ -1,6 +1,6 @@
1
1
  @file:JvmName("UiControllerUtils")
2
2
 
3
- package com.wix.detox.espresso.common.utils
3
+ package com.wix.detox.espresso.action.common.utils
4
4
 
5
5
  import androidx.test.espresso.Espresso
6
6
  import androidx.test.espresso.UiController
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": "19.8.1",
4
+ "version": "19.8.4",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -177,5 +177,5 @@
177
177
  }
178
178
  }
179
179
  },
180
- "gitHead": "c9238e3c552cf09d7b2f6e025be75a5191127f68"
180
+ "gitHead": "9229e64ec8f95574aab5beeeb4fa6bcc84844f69"
181
181
  }
@@ -1 +0,0 @@
1
- 889689a7258712f3f8a78b0b58e18407
@@ -1 +0,0 @@
1
- a8e9462451138e6246420ceeb6f0b3253ba20900
@@ -1 +0,0 @@
1
- 9c2eab1160ebc7db3bad49e1a3ceecfec68b6efe3d770bc41336d26dbd4b99dd
@@ -1 +0,0 @@
1
- 1dbf7974910ddb9e6913fae5c2aabe338ab93e5578d2d0488102331386f9ad8067dc2c99b4fa2bc524fceef267d3e0ac78fa3869792021d45696cb0f24c28609
@@ -1 +0,0 @@
1
- 74d38e26b8323b063cd8b345c6e7eea8
@@ -1 +0,0 @@
1
- c9701f1dc7cb4194907697c0eb51745245c75e86
@@ -1 +0,0 @@
1
- 029d34de60168f776352e89a3551c2944df019296ce4ba4a050719bdc0bc2802
@@ -1 +0,0 @@
1
- c5875389f2b54dc26d972f3dca7085960e4f76acf99b5aac9f3e8c113bfd802e9c9408f667af2499a9fed044f921386b9952ac772d37bea7f7fbee0a687c3321
@@ -1 +0,0 @@
1
- d917b7718226f34030f46c4b026e4ec9
@@ -1 +0,0 @@
1
- c084ed52fda73550a84156e3b12ee9653d5504d5
@@ -1 +0,0 @@
1
- 5b1f624700780ed7ce29c17e7a1f03ab055a146b929a493ad85a8c80654f5a15
@@ -1 +0,0 @@
1
- 1241ef5dddb6a729fe134f23baa80cf2ad6f688a064899e3fe7072312c5703924c25f223862d9a065569d89f4a4d6e5820a3cd7c56b5c5fb5ad8e7549c455d93
@@ -1 +0,0 @@
1
- 60852703de496a40398c2b3d014a5910
@@ -1 +0,0 @@
1
- f33e5459e225efe6ddd4f0f303b6fbfa73ac03a4
@@ -1 +0,0 @@
1
- af6dd4d88ed854a036d26f3dc6b828a4a313b0755f8e46068ac9ceecff2b4757
@@ -1 +0,0 @@
1
- a2baa30301d5d639e3496f30948466aab344f921448cc050e4bc940eac9b99978ec1397f0476386d191b837150a0073755e3e156e9f25ed7958fd279353759f0