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.
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
- package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
- package/Detox-ios-src.tbz +0 -0
- package/Detox-ios.tbz +0 -0
- package/android/detox/src/full/java/com/wix/detox/Detox.java +2 -59
- package/android/detox/src/full/java/com/wix/detox/NotificationDataParser.kt +3 -3
- package/index.d.ts +213 -186
- package/index.js +1 -0
- package/internals.d.ts +131 -0
- package/internals.js +4 -0
- package/local-cli/build-framework-cache.js +2 -2
- package/local-cli/build.js +7 -8
- package/local-cli/build.test.js +46 -40
- package/local-cli/clean-framework-cache.js +3 -3
- package/local-cli/cli.js +0 -1
- package/local-cli/init.js +20 -55
- package/local-cli/templates/jest.js +9 -34
- package/local-cli/test.js +18 -282
- package/local-cli/test.test.js +337 -672
- package/local-cli/testCommand/TestRunnerCommand.js +156 -0
- package/local-cli/{utils/testCommandArgs.js → testCommand/builder.js} +10 -35
- package/local-cli/testCommand/middlewares.js +75 -0
- package/local-cli/{utils → testCommand}/warnings.js +0 -10
- package/local-cli/utils/jestInternals.js +13 -2
- package/local-cli/utils/yargsUtils.js +67 -0
- package/package.json +26 -20
- package/runners/deprecation.js +47 -0
- package/runners/jest/JestCircusEnvironment.js +3 -38
- package/runners/jest/adapter.d.ts +4 -10
- package/runners/jest/adapter.js +3 -6
- package/runners/jest/assignReporter.d.ts +4 -1
- package/runners/jest/assignReporter.js +3 -6
- package/runners/jest/deprecation.js +25 -0
- package/runners/jest/globalSetup.js +1 -0
- package/runners/jest/globalTeardown.js +1 -0
- package/runners/jest/index.js +21 -0
- package/runners/jest/reporter.js +1 -0
- package/runners/jest/reporters/DetoxReporter.js +5 -0
- package/runners/jest/specReporter.d.ts +4 -9
- package/runners/jest/specReporter.js +3 -10
- package/runners/jest/streamlineReporter.js +3 -22
- package/runners/jest/testEnvironment/index.js +155 -0
- package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxCoreListener.js +36 -22
- package/runners/{jest-circus → jest/testEnvironment}/listeners/DetoxInitErrorListener.js +1 -1
- package/runners/jest/testEnvironment/listeners/DetoxPlatformFilterListener.js +27 -0
- package/runners/jest/{SpecReporterImpl.js → testEnvironment/listeners/SpecReporter.js} +61 -7
- package/runners/jest/testEnvironment/listeners/WorkerAssignReporter.js +34 -0
- package/runners/jest/testEnvironment/listeners/index.js +13 -0
- package/runners/{jest-circus → jest/testEnvironment}/utils/assertExistingContext.js +2 -2
- package/runners/jest/testEnvironment/utils/assertJestCircus27.js +56 -0
- package/runners/jest/testEnvironment/utils/assertJestCircus27.test.js +23 -0
- package/runners/jest/{utils → testEnvironment/utils}/getFullTestName.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/hasTimedOut.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/index.js +0 -0
- package/runners/jest/{utils → testEnvironment/utils}/stdout.js +0 -0
- package/runners/jest-circus/environment/index.js +6 -0
- package/runners/jest-circus/index.js +1 -10
- package/runners/jest-circus/reporter.js +1 -0
- package/runners/migration.js +37 -0
- package/runners/mocha/DetoxMochaAdapter.js +3 -35
- package/runners/mocha/adapter.d.ts +4 -7
- package/runners/mocha/adapter.js +3 -5
- package/src/{Detox.js → DetoxWorker.js} +131 -164
- package/src/artifacts/ArtifactsManager.js +51 -2
- package/src/artifacts/providers/index.js +0 -4
- package/src/artifacts/utils/buildDefaultArtifactsRootDirpath.js +2 -4
- package/src/artifacts/utils/temporaryPath.js +2 -0
- package/src/client/AsyncWebSocket.js +1 -1
- package/src/client/actions/actions.js +2 -2
- package/src/configuration/collectCliConfig.js +2 -4
- package/src/configuration/composeAppsConfig.js +8 -66
- package/src/configuration/composeArtifactsConfig.js +6 -32
- package/src/configuration/composeBehaviorConfig.js +3 -13
- package/src/configuration/composeDeviceConfig.js +37 -62
- package/src/configuration/composeLoggerConfig.js +50 -0
- package/src/configuration/composeRunnerConfig.js +75 -14
- package/src/configuration/composeSessionConfig.js +1 -3
- package/src/configuration/index.js +24 -23
- package/src/configuration/utils/deviceAppTypes.js +0 -1
- package/src/devices/allocation/DeviceAllocator.js +3 -3
- package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +4 -3
- package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +2 -6
- package/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js +1 -1
- package/src/devices/allocation/drivers/ios/SimulatorLauncher.js +3 -3
- package/src/devices/allocation/factories/index.js +0 -1
- package/src/devices/common/drivers/DeviceLauncher.js +2 -2
- package/src/devices/common/drivers/android/emulator/exec/EmulatorExec.js +1 -1
- package/src/devices/common/drivers/android/genycloud/services/GenyInstanceNaming.js +4 -9
- package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +34 -9
- package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +1 -1
- package/src/devices/runtime/RuntimeDevice.js +69 -81
- package/src/devices/runtime/drivers/index.js +0 -1
- package/src/devices/runtime/drivers/ios/SimulatorDriver.js +3 -2
- package/src/devices/runtime/factories/ios.js +1 -8
- package/src/devices/runtime/utils/LaunchArgsEditor.js +4 -59
- package/src/devices/runtime/utils/Storage.js +4 -0
- package/src/environmentFactory.js +0 -8
- package/src/errors/DetoxConfigErrorComposer.js +77 -30
- package/src/errors/DetoxError.js +4 -0
- package/src/errors/DetoxRuntimeError.js +5 -5
- package/src/errors/index.js +2 -0
- package/src/ipc/IPCClient.js +118 -0
- package/src/ipc/IPCServer.js +94 -0
- package/src/ipc/state.js +89 -0
- package/src/logger/DetoxLogger.js +244 -0
- package/src/logger/DetoxTraceEventBuilder.js +21 -0
- package/src/logger/DetoxTracer.js +133 -0
- package/src/logger/TraceThreadDispatcher.js +52 -0
- package/src/{utils → logger}/customConsoleLogger.js +1 -1
- package/src/realms/DetoxConstants.js +13 -0
- package/src/realms/DetoxContext.js +170 -0
- package/src/realms/DetoxInternalsFacade.js +35 -0
- package/src/realms/DetoxPrimaryContext.js +229 -0
- package/src/realms/DetoxSecondaryContext.js +94 -0
- package/src/realms/index.js +10 -0
- package/src/realms/primary.js +3 -0
- package/src/realms/secondary.js +3 -0
- package/src/server/DetoxConnection.js +1 -1
- package/src/symbols.js +56 -0
- package/src/utils/Timer.js +14 -6
- package/{local-cli/utils/misc.js → src/utils/envUtils.js} +0 -9
- package/src/utils/logger.js +2 -162
- package/src/utils/shellUtils.js +18 -0
- package/src/utils/streamUtils.js +214 -0
- package/src/utils/trace.js +9 -44
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar +0 -0
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.1/detox-19.9.1.pom.sha512 +0 -1
- package/local-cli/templates/mocha.js +0 -32
- package/local-cli/utils/splitArgv.js +0 -107
- package/runners/integration.js +0 -16
- package/runners/jest/DetoxAdapterCircus.js +0 -60
- package/runners/jest/DetoxAdapterImpl.js +0 -81
- package/runners/jest/DetoxAdapterJasmine.js +0 -67
- package/runners/jest/DetoxStreamlineJestReporter.js +0 -98
- package/runners/jest/FailingTestsReporter.js +0 -16
- package/runners/jest/SpecReporterCircus.js +0 -51
- package/runners/jest/SpecReporterJasmine.js +0 -39
- package/runners/jest/WorkerAssignReporterCircus.js +0 -17
- package/runners/jest/WorkerAssignReporterImpl.js +0 -21
- package/runners/jest/WorkerAssignReporterJasmine.js +0 -15
- package/runners/jest/runnerInfo.js +0 -9
- package/runners/jest-circus/environment.js +0 -206
- package/runners/jest-circus/utils/assertJestCircus26.js +0 -39
- package/runners/jest-circus/utils/wrapErrorWithNoopLifecycle.js +0 -14
- package/src/DetoxConstants.js +0 -13
- package/src/DetoxExportWrapper.js +0 -140
- package/src/artifacts/timeline/TimelineArtifactPlugin.js +0 -95
- package/src/devices/allocation/drivers/NoneAllocDriver.js +0 -10
- package/src/devices/allocation/factories/none.js +0 -11
- package/src/index.js +0 -6
- package/src/utils/MissingDetox.js +0 -78
- package/src/utils/fakeTimestampsProvider.js +0 -9
- package/src/utils/getWorkerId.js +0 -5
- package/src/utils/lastFailedTests.js +0 -38
- package/src/utils/sh.js +0 -18
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
91f1e6b3345b09b266fc6b1f4387d693
|
@@ -0,0 +1 @@
|
|
1
|
+
a2d07ea0b1bd401ae5cd41fc9f07bbbfb4fee96f
|
@@ -0,0 +1 @@
|
|
1
|
+
269c444435ef2d7f7267d243b84beefc38508b035df782e1a60eb25b3882a30d
|
@@ -0,0 +1 @@
|
|
1
|
+
f6d54f916e9b35f686f67a63fe072ffc0781ae7da27daf39a0dce5145fa75de5a240402f10d48df88710730fe40d847e87f7194d999359322e97f483f815496e
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
613e288168a5ebe791c1b253a0aac51c
|
@@ -0,0 +1 @@
|
|
1
|
+
112918ac48c1f2763d5f0fddfa8aba44a35a0c57
|
@@ -0,0 +1 @@
|
|
1
|
+
b21e2858bc218ca7402b48d759c6277fce832c73915c874b36d319fe4be2c2d7
|
@@ -0,0 +1 @@
|
|
1
|
+
ccbe51ebb24ad5b665f2d4a9d212701096e77f14d9cf04ac8ff6b2b9a452f8fdcf4b2319060bbdc6512b1cbc11846995af3955ac63bd6ea6b75f64c9dd399c24
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
e7043eb4fd0dfa3c309fd8cd35ee68e5
|
@@ -0,0 +1 @@
|
|
1
|
+
80bef0c22a710dabb0e72b8d15c59125db1bd58b
|
@@ -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>
|
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
|
+
e68998c30e0c3aefe7cdc34b641fd5e2
|
@@ -0,0 +1 @@
|
|
1
|
+
4afd3a2fcdb10c26d6a56a9b8f5c64a05b0152b5
|
@@ -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>
|
7
|
-
<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>
|
9
|
+
<version>20.0.2-breaking.new-global-lifecycle.0</version>
|
10
10
|
</versions>
|
11
|
-
<lastUpdated>
|
11
|
+
<lastUpdated>20220812072754</lastUpdated>
|
12
12
|
</versioning>
|
13
13
|
</metadata>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
66edf73eb985206d4b25467aaf398b5b
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
f08d44468bdd0e4ae5efdcfe2ce7607e2b89b953
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
d51a7e909a7633013fa58ab30ca34ed484b2b67acbd7f0484c923f04bdeb2ec6
|
@@ -1 +1 @@
|
|
1
|
-
|
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).
|
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()).
|
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
|
10
|
-
val rawData =
|
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
|
16
|
+
private fun readNotificationFromFile()
|
17
17
|
= TextFileReader(notificationPath).read()
|
18
18
|
}
|