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.
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/RN66Workaround.kt +13 -4
- package/index.d.ts +208 -186
- package/index.js +1 -0
- package/internals.d.ts +124 -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 +332 -673
- package/local-cli/testCommand/TestRunnerCommand.js +157 -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 +35 -17
- 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 +74 -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 +117 -0
- package/src/ipc/IPCServer.js +87 -0
- package/src/ipc/state.js +76 -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/environment.js +30 -15
- 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.0/detox-19.9.0-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar +0 -0
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/19.9.0/detox-19.9.0.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
|
+
937f993292c31bbc63081e5948da3f98
|
@@ -0,0 +1 @@
|
|
1
|
+
1241bd41fd22394ae5188a93cbfc937e3d7e1a7f
|
@@ -0,0 +1 @@
|
|
1
|
+
cea1094d1b55bc0da25e7d50cb0ab6c46054e43bd7466923c9ec3306675d5bba
|
@@ -0,0 +1 @@
|
|
1
|
+
76e5f493a41f718bff430572aa2215675e5767827dc44f6f44dda78d64768e124c9b2078d4b1669537fa00e3f34b045eadc22168fb210cab2fbc976470431913
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
b9a7e18eb5db9c29387800d177dc855e
|
@@ -0,0 +1 @@
|
|
1
|
+
e315ec89f403a1b0c2261c72bb6a614752aea946
|
@@ -0,0 +1 @@
|
|
1
|
+
081bddb05b360d8ff578b2dafa006f38bf2e52dd7e0cd7b942764a4ecf391e86
|
@@ -0,0 +1 @@
|
|
1
|
+
616c8bf9cecb7f03331a785c32f1449672e8179c849e997e5ef9ab210d25a95e16efc618c1660757dc0da90b1e09fc90df6cf1e68a0f92a6c33f331f02d74ba2
|
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.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
|
+
409fa95566cf0ec6633fce554ae87b8b
|
@@ -0,0 +1 @@
|
|
1
|
+
8086a11b6780db7eb68ab43d29e7680b01e72479
|
@@ -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>
|
7
|
-
<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>
|
9
|
+
<version>20.0.1-breaking.new-global-lifecycle.0</version>
|
10
10
|
</versions>
|
11
|
-
<lastUpdated>
|
11
|
+
<lastUpdated>20220810074907</lastUpdated>
|
12
12
|
</versioning>
|
13
13
|
</metadata>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
b2585c88d6aa7316562eefd1276b22b8
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
a08cf502a9a0fd7b00c98d8ac7406f638489da61
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
5afa6a8108d9375f9e5ede74faae8dd51d73ae25dab9e7915cfe11503c0f4a36
|
@@ -1 +1 @@
|
|
1
|
-
|
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).
|
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
|
}
|
@@ -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
|
-
|
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
|
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 {
|