detox 19.9.0 → 20.0.1-breaking.new-global-lifecycle.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. package/Detox-android/com/wix/detox/{19.9.0/detox-19.9.0-javadoc.jar → 20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-javadoc.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-javadoc.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-javadoc.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-javadoc.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-javadoc.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{19.9.0/detox-19.9.0-sources.jar → 20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-sources.jar} +0 -0
  7. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-sources.jar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-sources.jar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-sources.jar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0-sources.jar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.aar +0 -0
  12. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.aar.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.aar.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.aar.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.aar.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/{19.9.0/detox-19.9.0.pom → 20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.pom} +1 -1
  17. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.pom.md5 +1 -0
  18. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.pom.sha1 +1 -0
  19. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.pom.sha256 +1 -0
  20. package/Detox-android/com/wix/detox/20.0.1-breaking.new-global-lifecycle.0/detox-20.0.1-breaking.new-global-lifecycle.0.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/Detox.java +2 -59
  29. package/android/detox/src/full/java/com/wix/detox/NotificationDataParser.kt +3 -3
  30. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/RN66Workaround.kt +13 -4
  31. package/index.d.ts +208 -186
  32. package/index.js +1 -0
  33. package/internals.d.ts +124 -0
  34. package/internals.js +4 -0
  35. package/local-cli/build-framework-cache.js +2 -2
  36. package/local-cli/build.js +7 -8
  37. package/local-cli/build.test.js +46 -40
  38. package/local-cli/clean-framework-cache.js +3 -3
  39. package/local-cli/cli.js +0 -1
  40. package/local-cli/init.js +20 -55
  41. package/local-cli/templates/jest.js +9 -34
  42. package/local-cli/test.js +18 -282
  43. package/local-cli/test.test.js +332 -673
  44. package/local-cli/testCommand/TestRunnerCommand.js +157 -0
  45. package/local-cli/{utils/testCommandArgs.js → testCommand/builder.js} +10 -35
  46. package/local-cli/testCommand/middlewares.js +75 -0
  47. package/local-cli/{utils → testCommand}/warnings.js +0 -10
  48. package/local-cli/utils/jestInternals.js +13 -2
  49. package/local-cli/utils/yargsUtils.js +67 -0
  50. package/package.json +26 -20
  51. package/runners/deprecation.js +47 -0
  52. package/runners/jest/JestCircusEnvironment.js +3 -38
  53. package/runners/jest/adapter.d.ts +4 -10
  54. package/runners/jest/adapter.js +3 -6
  55. package/runners/jest/assignReporter.d.ts +4 -1
  56. package/runners/jest/assignReporter.js +3 -6
  57. package/runners/jest/deprecation.js +25 -0
  58. package/runners/jest/globalSetup.js +1 -0
  59. package/runners/jest/globalTeardown.js +1 -0
  60. package/runners/jest/index.js +21 -0
  61. package/runners/jest/reporter.js +1 -0
  62. package/runners/jest/reporters/DetoxReporter.js +5 -0
  63. package/runners/jest/specReporter.d.ts +4 -9
  64. package/runners/jest/specReporter.js +3 -10
  65. package/runners/jest/streamlineReporter.js +3 -22
  66. package/runners/jest/testEnvironment/index.js +155 -0
  67. package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxCoreListener.js +35 -17
  68. package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxInitErrorListener.js +1 -1
  69. package/runners/jest/testEnvironment/listeners/DetoxPlatformFilterListener.js +27 -0
  70. package/runners/jest/{SpecReporterImpl.js → testEnvironment/listeners/SpecReporter.js} +61 -7
  71. package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +34 -0
  72. package/runners/jest/testEnvironment/listeners/index.js +13 -0
  73. package/runners/{jest-circus → jest/testEnvironment}/utils/assertExistingContext.js +2 -2
  74. package/runners/jest/testEnvironment/utils/assertJestCircus27.js +56 -0
  75. package/runners/jest/testEnvironment/utils/assertJestCircus27.test.js +23 -0
  76. package/runners/jest/{utils → testEnvironment/utils}/getFullTestName.js +0 -0
  77. package/runners/jest/{utils → testEnvironment/utils}/hasTimedOut.js +0 -0
  78. package/runners/jest/{utils → testEnvironment/utils}/index.js +0 -0
  79. package/runners/jest/{utils → testEnvironment/utils}/stdout.js +0 -0
  80. package/runners/jest-circus/environment/index.js +6 -0
  81. package/runners/jest-circus/index.js +1 -10
  82. package/runners/jest-circus/reporter.js +1 -0
  83. package/runners/migration.js +37 -0
  84. package/runners/mocha/DetoxMochaAdapter.js +3 -35
  85. package/runners/mocha/adapter.d.ts +4 -7
  86. package/runners/mocha/adapter.js +3 -5
  87. package/src/{Detox.js → DetoxWorker.js} +131 -164
  88. package/src/artifacts/ArtifactsManager.js +51 -2
  89. package/src/artifacts/providers/index.js +0 -4
  90. package/src/artifacts/utils/buildDefaultArtifactsRootDirpath.js +2 -4
  91. package/src/artifacts/utils/temporaryPath.js +2 -0
  92. package/src/client/AsyncWebSocket.js +1 -1
  93. package/src/client/actions/actions.js +2 -2
  94. package/src/configuration/collectCliConfig.js +2 -4
  95. package/src/configuration/composeAppsConfig.js +8 -66
  96. package/src/configuration/composeArtifactsConfig.js +6 -32
  97. package/src/configuration/composeBehaviorConfig.js +3 -13
  98. package/src/configuration/composeDeviceConfig.js +37 -62
  99. package/src/configuration/composeLoggerConfig.js +50 -0
  100. package/src/configuration/composeRunnerConfig.js +74 -14
  101. package/src/configuration/composeSessionConfig.js +1 -3
  102. package/src/configuration/index.js +24 -23
  103. package/src/configuration/utils/deviceAppTypes.js +0 -1
  104. package/src/devices/allocation/DeviceAllocator.js +3 -3
  105. package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +4 -3
  106. package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +2 -6
  107. package/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js +1 -1
  108. package/src/devices/allocation/drivers/ios/SimulatorLauncher.js +3 -3
  109. package/src/devices/allocation/factories/index.js +0 -1
  110. package/src/devices/common/drivers/DeviceLauncher.js +2 -2
  111. package/src/devices/common/drivers/android/emulator/exec/EmulatorExec.js +1 -1
  112. package/src/devices/common/drivers/android/genycloud/services/GenyInstanceNaming.js +4 -9
  113. package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +34 -9
  114. package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +1 -1
  115. package/src/devices/runtime/RuntimeDevice.js +69 -81
  116. package/src/devices/runtime/drivers/index.js +0 -1
  117. package/src/devices/runtime/drivers/ios/SimulatorDriver.js +3 -2
  118. package/src/devices/runtime/factories/ios.js +1 -8
  119. package/src/devices/runtime/utils/LaunchArgsEditor.js +4 -59
  120. package/src/devices/runtime/utils/Storage.js +4 -0
  121. package/src/environmentFactory.js +0 -8
  122. package/src/errors/DetoxConfigErrorComposer.js +77 -30
  123. package/src/errors/DetoxError.js +4 -0
  124. package/src/errors/DetoxRuntimeError.js +5 -5
  125. package/src/errors/index.js +2 -0
  126. package/src/ipc/IPCClient.js +117 -0
  127. package/src/ipc/IPCServer.js +87 -0
  128. package/src/ipc/state.js +76 -0
  129. package/src/logger/DetoxLogger.js +244 -0
  130. package/src/logger/DetoxTraceEventBuilder.js +21 -0
  131. package/src/logger/DetoxTracer.js +133 -0
  132. package/src/logger/TraceThreadDispatcher.js +52 -0
  133. package/src/{utils → logger}/customConsoleLogger.js +1 -1
  134. package/src/realms/DetoxConstants.js +13 -0
  135. package/src/realms/DetoxContext.js +170 -0
  136. package/src/realms/DetoxInternalsFacade.js +35 -0
  137. package/src/realms/DetoxPrimaryContext.js +229 -0
  138. package/src/realms/DetoxSecondaryContext.js +94 -0
  139. package/src/realms/index.js +10 -0
  140. package/src/realms/primary.js +3 -0
  141. package/src/realms/secondary.js +3 -0
  142. package/src/server/DetoxConnection.js +1 -1
  143. package/src/symbols.js +56 -0
  144. package/src/utils/Timer.js +14 -6
  145. package/{local-cli/utils/misc.js → src/utils/envUtils.js} +0 -9
  146. package/src/utils/environment.js +30 -15
  147. package/src/utils/logger.js +2 -162
  148. package/src/utils/shellUtils.js +18 -0
  149. package/src/utils/streamUtils.js +214 -0
  150. package/src/utils/trace.js +9 -44
  151. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.md5 +0 -1
  152. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha1 +0 -1
  153. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha256 +0 -1
  154. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha512 +0 -1
  155. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.md5 +0 -1
  156. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha1 +0 -1
  157. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha256 +0 -1
  158. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha512 +0 -1
  159. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar +0 -0
  160. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.md5 +0 -1
  161. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha1 +0 -1
  162. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha256 +0 -1
  163. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha512 +0 -1
  164. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.md5 +0 -1
  165. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.sha1 +0 -1
  166. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.sha256 +0 -1
  167. package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.sha512 +0 -1
  168. package/local-cli/templates/mocha.js +0 -32
  169. package/local-cli/utils/splitArgv.js +0 -107
  170. package/runners/integration.js +0 -16
  171. package/runners/jest/DetoxAdapterCircus.js +0 -60
  172. package/runners/jest/DetoxAdapterImpl.js +0 -81
  173. package/runners/jest/DetoxAdapterJasmine.js +0 -67
  174. package/runners/jest/DetoxStreamlineJestReporter.js +0 -98
  175. package/runners/jest/FailingTestsReporter.js +0 -16
  176. package/runners/jest/SpecReporterCircus.js +0 -51
  177. package/runners/jest/SpecReporterJasmine.js +0 -39
  178. package/runners/jest/WorkerAssignReporterCircus.js +0 -17
  179. package/runners/jest/WorkerAssignReporterImpl.js +0 -21
  180. package/runners/jest/WorkerAssignReporterJasmine.js +0 -15
  181. package/runners/jest/runnerInfo.js +0 -9
  182. package/runners/jest-circus/environment.js +0 -206
  183. package/runners/jest-circus/utils/assertJestCircus26.js +0 -39
  184. package/runners/jest-circus/utils/wrapErrorWithNoopLifecycle.js +0 -14
  185. package/src/DetoxConstants.js +0 -13
  186. package/src/DetoxExportWrapper.js +0 -140
  187. package/src/artifacts/timeline/TimelineArtifactPlugin.js +0 -95
  188. package/src/devices/allocation/drivers/NoneAllocDriver.js +0 -10
  189. package/src/devices/allocation/factories/none.js +0 -11
  190. package/src/index.js +0 -6
  191. package/src/utils/MissingDetox.js +0 -78
  192. package/src/utils/fakeTimestampsProvider.js +0 -9
  193. package/src/utils/getWorkerId.js +0 -5
  194. package/src/utils/lastFailedTests.js +0 -38
  195. package/src/utils/sh.js +0 -18
@@ -0,0 +1 @@
1
+ cea1094d1b55bc0da25e7d50cb0ab6c46054e43bd7466923c9ec3306675d5bba
@@ -0,0 +1 @@
1
+ 76e5f493a41f718bff430572aa2215675e5767827dc44f6f44dda78d64768e124c9b2078d4b1669537fa00e3f34b045eadc22168fb210cab2fbc976470431913
@@ -0,0 +1 @@
1
+ 081bddb05b360d8ff578b2dafa006f38bf2e52dd7e0cd7b942764a4ecf391e86
@@ -0,0 +1 @@
1
+ 616c8bf9cecb7f03331a785c32f1449672e8179c849e997e5ef9ab210d25a95e16efc618c1660757dc0da90b1e09fc90df6cf1e68a0f92a6c33f331f02d74ba2
@@ -0,0 +1 @@
1
+ 7828ffdff493f8a856efad9b7db540e4e6b13b91260292efe98791013ba2db04
@@ -0,0 +1 @@
1
+ a57448b5eec5edfb2b45b99b9c8a6714b3384f71ade0f25da7b453d14c29597e818690b293cefa9be9362be29efb2c420664283cb1fc994883cd143d46506a2f
@@ -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.9.0</version>
6
+ <version>20.0.1-breaking.new-global-lifecycle.0</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
+ 4a844b7f2bf2ff0c50a742633c34e8e477e45bae50a2a0126ca2ebdbfd6ee213
@@ -0,0 +1 @@
1
+ 22ccfbb1ddd925f4892bed13b9bbb5061f20a022155d0c8d79bc78c993e1d3f326c67560d92f25223d9de30d7e0432af4f09ed35db9f36282bf2b790c6d215fb
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>19.9.0</latest>
7
- <release>19.9.0</release>
6
+ <latest>20.0.1-breaking.new-global-lifecycle.0</latest>
7
+ <release>20.0.1-breaking.new-global-lifecycle.0</release>
8
8
  <versions>
9
- <version>19.9.0</version>
9
+ <version>20.0.1-breaking.new-global-lifecycle.0</version>
10
10
  </versions>
11
- <lastUpdated>20220803110708</lastUpdated>
11
+ <lastUpdated>20220810074907</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 86ca4dbbdfc29a8581f2c10836c468e6
1
+ b2585c88d6aa7316562eefd1276b22b8
@@ -1 +1 @@
1
- 9a236d336900276e15d096cf02260d5b65c5b6b0
1
+ a08cf502a9a0fd7b00c98d8ac7406f638489da61
@@ -1 +1 @@
1
- 9b4381ec63fe2ce4866684603717c97be6cfcb7a0feab7ff3b53f221cbe87890
1
+ 5afa6a8108d9375f9e5ede74faae8dd51d73ae25dab9e7915cfe11503c0f4a36
@@ -1 +1 @@
1
- db3116343e09de63d475c873e8ea5226cf4298fb4e0ae482fbc5ced2655398825e0b4d1987d2805c2c8d0c6a5ec400fd80e7a062c563c1fe7af1ae8ba91de204
1
+ 701eeb42080f3cc2cf38ddb06f0a1185633a958dac2325d7225fc5a3aefcd982def05877242c10cec1bd569d8ac2f600f7b8f0d85c4399ccd61fdeb9e0d8f6b2
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
@@ -9,10 +9,7 @@ import android.os.Bundle;
9
9
  import com.wix.detox.config.DetoxConfig;
10
10
  import com.wix.detox.espresso.UiControllerSpy;
11
11
 
12
- import java.util.concurrent.TimeUnit;
13
-
14
12
  import androidx.annotation.NonNull;
15
- import androidx.test.espresso.IdlingPolicies;
16
13
  import androidx.test.platform.app.InstrumentationRegistry;
17
14
  import androidx.test.rule.ActivityTestRule;
18
15
 
@@ -77,28 +74,6 @@ public final class Detox {
77
74
  private static final LaunchIntentsFactory sIntentsFactory = new LaunchIntentsFactory();
78
75
  private static ActivityTestRule sActivityTestRule;
79
76
 
80
- /**
81
- * Specification of values to use for Espresso's {@link IdlingPolicies} timeouts.
82
- * <br/>Overrides Espresso's defaults as they tend to be too short (e.g. when running a heavy-load app
83
- * on suboptimal CI machines).
84
- *
85
- * @deprecated Use {@link com.wix.detox.config.DetoxConfig}.
86
- */
87
- @Deprecated
88
- public static class DetoxIdlePolicyConfig {
89
- /** Directly binds to {@link IdlingPolicies#setMasterPolicyTimeout(long, TimeUnit)}. Applied in seconds. */
90
- public Integer masterTimeoutSec = 120;
91
- /** Directly binds to {@link IdlingPolicies#setIdlingResourceTimeout(long, TimeUnit)}. Applied in seconds. */
92
- public Integer idleResourceTimeoutSec = 60;
93
-
94
- private com.wix.detox.config.DetoxIdlePolicyConfig toNewConfig() {
95
- com.wix.detox.config.DetoxIdlePolicyConfig newConfig = new com.wix.detox.config.DetoxIdlePolicyConfig();
96
- newConfig.masterTimeoutSec = masterTimeoutSec;
97
- newConfig.idleResourceTimeoutSec = idleResourceTimeoutSec;
98
- return newConfig;
99
- }
100
- }
101
-
102
77
  private Detox() {
103
78
  }
104
79
 
@@ -128,20 +103,6 @@ public final class Detox {
128
103
  runTests(activityTestRule, getAppContext(), detoxConfig);
129
104
  }
130
105
 
131
- /**
132
- * Same as the default {@link #runTests(ActivityTestRule)} method, but allows for the explicit specification of
133
- * a custom idle-policy configuration. Note: review {@link DetoxIdlePolicyConfig} for defaults.
134
- *
135
- * @param idlePolicyConfig The custom idle-policy configuration to pass in; Will be applied into Espresso via
136
- * the {@link IdlingPolicies} API.
137
- *
138
- * @deprecated Use {@link #runTests(ActivityTestRule, DetoxConfig)}
139
- */
140
- @Deprecated
141
- public static void runTests(ActivityTestRule activityTestRule, DetoxIdlePolicyConfig idlePolicyConfig) {
142
- runTests(activityTestRule, getAppContext(), idlePolicyConfig);
143
- }
144
-
145
106
  /**
146
107
  * <p>
147
108
  * Use this method only if you have a React Native application and it
@@ -161,24 +122,6 @@ public final class Detox {
161
122
  runTests(activityTestRule, context, new DetoxConfig());
162
123
  }
163
124
 
164
- /**
165
- * Same as {@link #runTests(ActivityTestRule, Context)}, but allows for the explicit specification of
166
- * a custom idle-policy configuration. Note: review {@link DetoxIdlePolicyConfig} for defaults.
167
- *
168
- *
169
- * @param idlePolicyConfig The custom idle-policy configuration to pass in; Will be applied into Espresso via
170
- * the {@link IdlingPolicies} API.
171
- *
172
- * @deprecated Use {@link #runTests(ActivityTestRule, Context, DetoxConfig)}
173
- */
174
- @Deprecated
175
- public static void runTests(ActivityTestRule activityTestRule, @NonNull final Context context, DetoxIdlePolicyConfig idlePolicyConfig) {
176
- DetoxConfig config = new DetoxConfig();
177
- config.idlePolicyConfig = idlePolicyConfig.toNewConfig();
178
-
179
- runTests(activityTestRule, context, config);
180
- }
181
-
182
125
  /**
183
126
  * Same as {@link #runTests(ActivityTestRule, Context)}, but allows for the explicit specification of
184
127
  * various configurations. Note: review {@link DetoxConfig} for defaults.
@@ -214,7 +157,7 @@ public final class Detox {
214
157
  }
215
158
 
216
159
  public static void startActivityFromNotification(String dataFilePath) {
217
- Bundle notificationData = new NotificationDataParser(dataFilePath).parseNotificationData();
160
+ Bundle notificationData = new NotificationDataParser(dataFilePath).toBundle();
218
161
  Intent intent = sIntentsFactory.intentWithNotificationData(getAppContext(), notificationData, false);
219
162
  launchActivitySync(intent);
220
163
  }
@@ -225,7 +168,7 @@ public final class Detox {
225
168
  if (sLaunchArgs.hasUrlOverride()) {
226
169
  intent = sIntentsFactory.intentWithUrl(sLaunchArgs.getUrlOverride(), true);
227
170
  } else if (sLaunchArgs.hasNotificationPath()) {
228
- Bundle notificationData = new NotificationDataParser(sLaunchArgs.getNotificationPath()).parseNotificationData();
171
+ Bundle notificationData = new NotificationDataParser(sLaunchArgs.getNotificationPath()).toBundle();
229
172
  intent = sIntentsFactory.intentWithNotificationData(getAppContext(), notificationData, true);
230
173
  } else {
231
174
  intent = sIntentsFactory.cleanIntent();
@@ -6,13 +6,13 @@ import com.wix.detox.common.TextFileReader
6
6
  import org.json.JSONObject
7
7
 
8
8
  internal class NotificationDataParser(private val notificationPath: String) {
9
- fun parseNotificationData(): Bundle {
10
- val rawData = readNotificationData()
9
+ fun toBundle(): Bundle {
10
+ val rawData = readNotificationFromFile()
11
11
  val json = JSONObject(rawData)
12
12
  val payload = json.getJSONObject("payload")
13
13
  return JsonConverter(payload).toBundle()
14
14
  }
15
15
 
16
- private fun readNotificationData()
16
+ private fun readNotificationFromFile()
17
17
  = TextFileReader(notificationPath).read()
18
18
  }
@@ -2,6 +2,7 @@ package com.wix.detox.reactnative.idlingresources.uimodule
2
2
 
3
3
  import android.util.Log
4
4
  import android.view.View
5
+ import com.facebook.react.uimanager.IllegalViewOperationException
5
6
  import com.wix.detox.common.DetoxLog.Companion.LOG_TAG
6
7
  import com.wix.detox.reactnative.ReactNativeInfo
7
8
  import java.lang.ref.WeakReference
@@ -19,9 +20,7 @@ class RN66Workaround {
19
20
  fun isScarceUISwitchCommandStuckInQueue(uiManagerModuleReflected: UIManagerModuleReflected): Boolean {
20
21
  var isStuckSwitchOperation = false
21
22
 
22
- val rnVersion = ReactNativeInfo.rnVersion()
23
-
24
- if (rnVersion.minor >= 66 && uiManagerModuleReflected.getUIOpsCount() >= 1) {
23
+ if (isRelevantRNVersion() && uiManagerModuleReflected.getUIOpsCount() >= 1) {
25
24
  val nextUIOperation = uiManagerModuleReflected.getNextUIOpReflected()
26
25
  val view = getUIOpView(uiManagerModuleReflected, nextUIOperation)
27
26
  val isReactSwitch = isReactSwitch(view)
@@ -46,10 +45,20 @@ class RN66Workaround {
46
45
  return isStuckSwitchOperation
47
46
  }
48
47
 
48
+ private fun isRelevantRNVersion(): Boolean {
49
+ val rnVersion = ReactNativeInfo.rnVersion()
50
+ return rnVersion.minor == 66 || (rnVersion.minor == 67 && rnVersion.patch < 4)
51
+ }
52
+
49
53
  private fun getUIOpView(uiManagerModuleReflected: UIManagerModuleReflected, uiOperation: DispatchCommandOperationReflected?): View? {
50
54
  val nativeViewHierarchyManager = uiManagerModuleReflected.nativeViewHierarchyManager() ?: return null
51
55
  val tag = uiOperation?.tag ?: return null
52
- return nativeViewHierarchyManager.getViewClass(tag)
56
+ return try {
57
+ nativeViewHierarchyManager.getViewClass(tag)
58
+ } catch(e: IllegalViewOperationException) {
59
+ Log.e(LOG_TAG, "failed to get view from tag ", e.cause)
60
+ null
61
+ }
53
62
  }
54
63
 
55
64
  private fun isReactSwitch(view: View?) = try {