detox 19.9.1 → 20.0.2-breaking.new-global-lifecycle.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. package/Detox-android/com/wix/detox/{19.9.1/detox-19.9.1-javadoc.jar → 20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-javadoc.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{19.9.1/detox-19.9.1-sources.jar → 20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar} +0 -0
  7. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0-sources.jar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar +0 -0
  12. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.aar.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/{19.9.1/detox-19.9.1.pom → 20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom} +1 -1
  17. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom.md5 +1 -0
  18. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom.sha1 +1 -0
  19. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-breaking.new-global-lifecycle.0.pom.sha256 +1 -0
  20. package/Detox-android/com/wix/detox/20.0.2-breaking.new-global-lifecycle.0/detox-20.0.2-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/index.d.ts +213 -186
  31. package/index.js +1 -0
  32. package/internals.d.ts +131 -0
  33. package/internals.js +4 -0
  34. package/local-cli/build-framework-cache.js +2 -2
  35. package/local-cli/build.js +7 -8
  36. package/local-cli/build.test.js +46 -40
  37. package/local-cli/clean-framework-cache.js +3 -3
  38. package/local-cli/cli.js +0 -1
  39. package/local-cli/init.js +20 -55
  40. package/local-cli/templates/jest.js +9 -34
  41. package/local-cli/test.js +18 -282
  42. package/local-cli/test.test.js +337 -672
  43. package/local-cli/testCommand/TestRunnerCommand.js +156 -0
  44. package/local-cli/{utils/testCommandArgs.js → testCommand/builder.js} +10 -35
  45. package/local-cli/testCommand/middlewares.js +75 -0
  46. package/local-cli/{utils → testCommand}/warnings.js +0 -10
  47. package/local-cli/utils/jestInternals.js +13 -2
  48. package/local-cli/utils/yargsUtils.js +67 -0
  49. package/package.json +26 -20
  50. package/runners/deprecation.js +47 -0
  51. package/runners/jest/JestCircusEnvironment.js +3 -38
  52. package/runners/jest/adapter.d.ts +4 -10
  53. package/runners/jest/adapter.js +3 -6
  54. package/runners/jest/assignReporter.d.ts +4 -1
  55. package/runners/jest/assignReporter.js +3 -6
  56. package/runners/jest/deprecation.js +25 -0
  57. package/runners/jest/globalSetup.js +1 -0
  58. package/runners/jest/globalTeardown.js +1 -0
  59. package/runners/jest/index.js +21 -0
  60. package/runners/jest/reporter.js +1 -0
  61. package/runners/jest/reporters/DetoxReporter.js +5 -0
  62. package/runners/jest/specReporter.d.ts +4 -9
  63. package/runners/jest/specReporter.js +3 -10
  64. package/runners/jest/streamlineReporter.js +3 -22
  65. package/runners/jest/testEnvironment/index.js +155 -0
  66. package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxCoreListener.js +36 -22
  67. package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxInitErrorListener.js +1 -1
  68. package/runners/jest/testEnvironment/listeners/DetoxPlatformFilterListener.js +27 -0
  69. package/runners/jest/{SpecReporterImpl.js → testEnvironment/listeners/SpecReporter.js} +61 -7
  70. package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +34 -0
  71. package/runners/jest/testEnvironment/listeners/index.js +13 -0
  72. package/runners/{jest-circus → jest/testEnvironment}/utils/assertExistingContext.js +2 -2
  73. package/runners/jest/testEnvironment/utils/assertJestCircus27.js +56 -0
  74. package/runners/jest/testEnvironment/utils/assertJestCircus27.test.js +23 -0
  75. package/runners/jest/{utils → testEnvironment/utils}/getFullTestName.js +0 -0
  76. package/runners/jest/{utils → testEnvironment/utils}/hasTimedOut.js +0 -0
  77. package/runners/jest/{utils → testEnvironment/utils}/index.js +0 -0
  78. package/runners/jest/{utils → testEnvironment/utils}/stdout.js +0 -0
  79. package/runners/jest-circus/environment/index.js +6 -0
  80. package/runners/jest-circus/index.js +1 -10
  81. package/runners/jest-circus/reporter.js +1 -0
  82. package/runners/migration.js +37 -0
  83. package/runners/mocha/DetoxMochaAdapter.js +3 -35
  84. package/runners/mocha/adapter.d.ts +4 -7
  85. package/runners/mocha/adapter.js +3 -5
  86. package/src/{Detox.js → DetoxWorker.js} +131 -164
  87. package/src/artifacts/ArtifactsManager.js +51 -2
  88. package/src/artifacts/providers/index.js +0 -4
  89. package/src/artifacts/utils/buildDefaultArtifactsRootDirpath.js +2 -4
  90. package/src/artifacts/utils/temporaryPath.js +2 -0
  91. package/src/client/AsyncWebSocket.js +1 -1
  92. package/src/client/actions/actions.js +2 -2
  93. package/src/configuration/collectCliConfig.js +2 -4
  94. package/src/configuration/composeAppsConfig.js +8 -66
  95. package/src/configuration/composeArtifactsConfig.js +6 -32
  96. package/src/configuration/composeBehaviorConfig.js +3 -13
  97. package/src/configuration/composeDeviceConfig.js +37 -62
  98. package/src/configuration/composeLoggerConfig.js +50 -0
  99. package/src/configuration/composeRunnerConfig.js +75 -14
  100. package/src/configuration/composeSessionConfig.js +1 -3
  101. package/src/configuration/index.js +24 -23
  102. package/src/configuration/utils/deviceAppTypes.js +0 -1
  103. package/src/devices/allocation/DeviceAllocator.js +3 -3
  104. package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +4 -3
  105. package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +2 -6
  106. package/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js +1 -1
  107. package/src/devices/allocation/drivers/ios/SimulatorLauncher.js +3 -3
  108. package/src/devices/allocation/factories/index.js +0 -1
  109. package/src/devices/common/drivers/DeviceLauncher.js +2 -2
  110. package/src/devices/common/drivers/android/emulator/exec/EmulatorExec.js +1 -1
  111. package/src/devices/common/drivers/android/genycloud/services/GenyInstanceNaming.js +4 -9
  112. package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +34 -9
  113. package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +1 -1
  114. package/src/devices/runtime/RuntimeDevice.js +69 -81
  115. package/src/devices/runtime/drivers/index.js +0 -1
  116. package/src/devices/runtime/drivers/ios/SimulatorDriver.js +3 -2
  117. package/src/devices/runtime/factories/ios.js +1 -8
  118. package/src/devices/runtime/utils/LaunchArgsEditor.js +4 -59
  119. package/src/devices/runtime/utils/Storage.js +4 -0
  120. package/src/environmentFactory.js +0 -8
  121. package/src/errors/DetoxConfigErrorComposer.js +77 -30
  122. package/src/errors/DetoxError.js +4 -0
  123. package/src/errors/DetoxRuntimeError.js +5 -5
  124. package/src/errors/index.js +2 -0
  125. package/src/ipc/IPCClient.js +118 -0
  126. package/src/ipc/IPCServer.js +94 -0
  127. package/src/ipc/state.js +89 -0
  128. package/src/logger/DetoxLogger.js +244 -0
  129. package/src/logger/DetoxTraceEventBuilder.js +21 -0
  130. package/src/logger/DetoxTracer.js +133 -0
  131. package/src/logger/TraceThreadDispatcher.js +52 -0
  132. package/src/{utils → logger}/customConsoleLogger.js +1 -1
  133. package/src/realms/DetoxConstants.js +13 -0
  134. package/src/realms/DetoxContext.js +170 -0
  135. package/src/realms/DetoxInternalsFacade.js +35 -0
  136. package/src/realms/DetoxPrimaryContext.js +229 -0
  137. package/src/realms/DetoxSecondaryContext.js +94 -0
  138. package/src/realms/index.js +10 -0
  139. package/src/realms/primary.js +3 -0
  140. package/src/realms/secondary.js +3 -0
  141. package/src/server/DetoxConnection.js +1 -1
  142. package/src/symbols.js +56 -0
  143. package/src/utils/Timer.js +14 -6
  144. package/{local-cli/utils/misc.js → src/utils/envUtils.js} +0 -9
  145. package/src/utils/logger.js +2 -162
  146. package/src/utils/shellUtils.js +18 -0
  147. package/src/utils/streamUtils.js +214 -0
  148. package/src/utils/trace.js +9 -44
  149. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-javadoc.jar.md5 +0 -1
  150. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-javadoc.jar.sha1 +0 -1
  151. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-javadoc.jar.sha256 +0 -1
  152. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-javadoc.jar.sha512 +0 -1
  153. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-sources.jar.md5 +0 -1
  154. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-sources.jar.sha1 +0 -1
  155. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-sources.jar.sha256 +0 -1
  156. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-sources.jar.sha512 +0 -1
  157. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar +0 -0
  158. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar.md5 +0 -1
  159. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar.sha1 +0 -1
  160. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar.sha256 +0 -1
  161. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar.sha512 +0 -1
  162. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.pom.md5 +0 -1
  163. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.pom.sha1 +0 -1
  164. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.pom.sha256 +0 -1
  165. package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.pom.sha512 +0 -1
  166. package/local-cli/templates/mocha.js +0 -32
  167. package/local-cli/utils/splitArgv.js +0 -107
  168. package/runners/integration.js +0 -16
  169. package/runners/jest/DetoxAdapterCircus.js +0 -60
  170. package/runners/jest/DetoxAdapterImpl.js +0 -81
  171. package/runners/jest/DetoxAdapterJasmine.js +0 -67
  172. package/runners/jest/DetoxStreamlineJestReporter.js +0 -98
  173. package/runners/jest/FailingTestsReporter.js +0 -16
  174. package/runners/jest/SpecReporterCircus.js +0 -51
  175. package/runners/jest/SpecReporterJasmine.js +0 -39
  176. package/runners/jest/WorkerAssignReporterCircus.js +0 -17
  177. package/runners/jest/WorkerAssignReporterImpl.js +0 -21
  178. package/runners/jest/WorkerAssignReporterJasmine.js +0 -15
  179. package/runners/jest/runnerInfo.js +0 -9
  180. package/runners/jest-circus/environment.js +0 -206
  181. package/runners/jest-circus/utils/assertJestCircus26.js +0 -39
  182. package/runners/jest-circus/utils/wrapErrorWithNoopLifecycle.js +0 -14
  183. package/src/DetoxConstants.js +0 -13
  184. package/src/DetoxExportWrapper.js +0 -140
  185. package/src/artifacts/timeline/TimelineArtifactPlugin.js +0 -95
  186. package/src/devices/allocation/drivers/NoneAllocDriver.js +0 -10
  187. package/src/devices/allocation/factories/none.js +0 -11
  188. package/src/index.js +0 -6
  189. package/src/utils/MissingDetox.js +0 -78
  190. package/src/utils/fakeTimestampsProvider.js +0 -9
  191. package/src/utils/getWorkerId.js +0 -5
  192. package/src/utils/lastFailedTests.js +0 -38
  193. package/src/utils/sh.js +0 -18
@@ -0,0 +1 @@
1
+ 269c444435ef2d7f7267d243b84beefc38508b035df782e1a60eb25b3882a30d
@@ -0,0 +1 @@
1
+ f6d54f916e9b35f686f67a63fe072ffc0781ae7da27daf39a0dce5145fa75de5a240402f10d48df88710730fe40d847e87f7194d999359322e97f483f815496e
@@ -0,0 +1 @@
1
+ b21e2858bc218ca7402b48d759c6277fce832c73915c874b36d319fe4be2c2d7
@@ -0,0 +1 @@
1
+ ccbe51ebb24ad5b665f2d4a9d212701096e77f14d9cf04ac8ff6b2b9a452f8fdcf4b2319060bbdc6512b1cbc11846995af3955ac63bd6ea6b75f64c9dd399c24
@@ -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.1</version>
6
+ <version>20.0.2-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
+ 23b6942ae16e58bb84494f4080b72ef018817833f5a3af6971844ca7d35854ba
@@ -0,0 +1 @@
1
+ 461b3793c3c8fe77b4d7c1494716ae1ce17bf133c99b637f639f176e52c72fdfcf1a2621ce18136f151aa50798007cc68e0eee46a87674a0a22e68534b5f43f6
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>19.9.1</latest>
7
- <release>19.9.1</release>
6
+ <latest>20.0.2-breaking.new-global-lifecycle.0</latest>
7
+ <release>20.0.2-breaking.new-global-lifecycle.0</release>
8
8
  <versions>
9
- <version>19.9.1</version>
9
+ <version>20.0.2-breaking.new-global-lifecycle.0</version>
10
10
  </versions>
11
- <lastUpdated>20220807120731</lastUpdated>
11
+ <lastUpdated>20220812072754</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- c201535bc3982a6cef0872d857c0c4bf
1
+ 66edf73eb985206d4b25467aaf398b5b
@@ -1 +1 @@
1
- 66a7cc0c38d85cccbc0b607eb75238b44ada15bc
1
+ f08d44468bdd0e4ae5efdcfe2ce7607e2b89b953
@@ -1 +1 @@
1
- a95acefab84a8a7cb2701c3c0a100133d0625768be570315f92001d45f5c4659
1
+ d51a7e909a7633013fa58ab30ca34ed484b2b67acbd7f0484c923f04bdeb2ec6
@@ -1 +1 @@
1
- f554fcccfffa1f5f7388865cd6ad13dd3a3dfa2c2df7f7f506afb88049871ba295dd79cef884af3601230c226814ddc1d61a29a7325e88b1d53ed2a4c094f4de
1
+ 04a047b23b9ed5229c4f124c08719bb7e1b468cc5fab450a9403adfd7f7c109ebae29182f6c3763e9b7915c4ff60c5971ea8f8417e8d5b8b7877961310c1f484
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
  }