detox 19.9.0 → 21.0.0-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 → 21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar} +0 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-javadoc.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-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 → 21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar +0 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.aar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{19.9.0/detox-19.9.0.pom → 21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.pom} +2 -2
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-breaking.new-global-lifecycle.0.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-breaking.new-global-lifecycle.0/detox-21.0.0-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/build.gradle +2 -2
- package/android/detox/build.gradle +2 -2
- package/android/detox/publish-pom.gradle +1 -5
- package/android/detox/publishing.gradle +7 -9
- 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/adapters/server/WebSocketClient.java +1 -3
- package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java +3 -1
- package/android/detox/src/full/java/com/wix/detox/espresso/UiAutomatorHelper.java +1 -1
- package/android/detox/src/full/java/com/wix/detox/espresso/matcher/ViewMatchers.kt +23 -16
- package/android/detox/src/full/java/com/wix/detox/reactnative/ReactNativeLoadingMonitor.kt +8 -54
- package/android/detox/src/main/java/com/wix/detox/common/DetoxErrors.java +1 -4
- package/android/detox/src/main/java/com/wix/detox/espresso/UiControllerSpy.kt +1 -2
- package/android/detox/src/main/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt +36 -0
- package/android/detox/src/{full → main}/java/com/wix/detox/espresso/action/GetAttributesAction.kt +1 -13
- package/android/detox/src/main/java/com/wix/detox/espresso/action/common/utils/UiControllerUtils.kt +1 -1
- package/android/detox/src/testFull/java/com/wix/detox/espresso/action/AdjustSliderToPositionActionTest.kt +59 -0
- package/android/detox/src/testFull/java/com/wix/detox/espresso/action/GetAttributesActionTest.kt +3 -15
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -2
- package/android/gradlew +107 -181
- 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 +28 -22
- 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/log/android/ADBLogcatRecording.js +28 -11
- 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 +9 -67
- 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/android/genycloud/GenyAllocDriver.js +0 -1
- 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/exec/ADB.js +0 -5
- 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 +76 -29
- 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/ChromeTracingExporter.js +5 -6
- 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.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/android/detox/src/full/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt +0 -22
- package/android/detox/src/full/java/com/wix/detox/espresso/common/SliderHelper.kt +0 -75
- package/android/detox/src/main/java/com/wix/detox/espresso/action/common/ReflectUtils.kt +0 -10
- package/android/detox/src/testFull/java/com/wix/detox/espresso/common/SliderHelperTest.kt +0 -39
- 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
|
+
8475cf31ccd6d011b0006e3bb733eecc
|
@@ -0,0 +1 @@
|
|
1
|
+
886b14ddaa20a6f8c45591e264d9e4b37608c42c
|
@@ -0,0 +1 @@
|
|
1
|
+
acc211b70fb65685f6bc4485877bbbb2eff3bc39c6c827eb2e3c7718a4483f3f
|
@@ -0,0 +1 @@
|
|
1
|
+
a04e99a05821a7eee3dd52681ad4f5f90f79db30148dc725c0857dc6816d3a2321e0325301956b42135eeafba91730cbf1ea3e9bb2c7fd8907b6b3622554e681
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
1f34dcb78d3fca51336c8ef14e04d81a
|
@@ -0,0 +1 @@
|
|
1
|
+
ada07ced21d56acce0c81bd3a23f491e377f8039
|
@@ -0,0 +1 @@
|
|
1
|
+
aea2cd38e84670f4c1247a91ed192dfb7aa8e7b6b8caf0ab9e4653e9d3d534f3
|
@@ -0,0 +1 @@
|
|
1
|
+
bde9ea969c3dc598bd83269cb194a45b2541a72cfb957cb73739e6bcc696db72f03083bd89d5487165259a6ec69290efddfe686456c37a26a5b756f48d2c16f3
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
763fee6cb2b551c8163caecafb821478
|
@@ -0,0 +1 @@
|
|
1
|
+
a3d2827035258ddbd41de27ce4e25df2f3a5a2fd
|
@@ -0,0 +1 @@
|
|
1
|
+
87990259e9864e07f8a1ccde34e69dfcadfba39167d7384062c272e81b307231
|
@@ -0,0 +1 @@
|
|
1
|
+
34165b1c6d6ea54d5c3420bd7f387dfa9fc81f8a43d50c404d06c9d24a6d6377dc84ba4f0b699dda5780658fb8796d197f368ef396cbf29240270e9fea78bddc
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
2
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
3
3
|
<modelVersion>4.0.0</modelVersion>
|
4
4
|
<groupId>com.wix</groupId>
|
5
5
|
<artifactId>detox</artifactId>
|
6
|
-
<version>
|
6
|
+
<version>21.0.0-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
|
+
4873da6045eabca1e010029084da9b1a
|
@@ -0,0 +1 @@
|
|
1
|
+
fd2294f05635a75a1c049162064c751773d1acec
|
@@ -0,0 +1 @@
|
|
1
|
+
a815eb45d190075410faa418d75636120436338083a8c56b48c0314bf2370afe
|
@@ -0,0 +1 @@
|
|
1
|
+
9566b64dce8fc2983da565d015b787f1d13f1ea79c95f2062fcdb5ff06ef2c00c2fd96fc9680737d979c4f299570ef448ebac2489e5370f8efc94b08814e5f37
|
@@ -3,11 +3,11 @@
|
|
3
3
|
<groupId>com.wix</groupId>
|
4
4
|
<artifactId>detox</artifactId>
|
5
5
|
<versioning>
|
6
|
-
<latest>
|
7
|
-
<release>
|
6
|
+
<latest>21.0.0-breaking.new-global-lifecycle.0</latest>
|
7
|
+
<release>21.0.0-breaking.new-global-lifecycle.0</release>
|
8
8
|
<versions>
|
9
|
-
<version>
|
9
|
+
<version>21.0.0-breaking.new-global-lifecycle.0</version>
|
10
10
|
</versions>
|
11
|
-
<lastUpdated>
|
11
|
+
<lastUpdated>20220809170413</lastUpdated>
|
12
12
|
</versioning>
|
13
13
|
</metadata>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
b76ff5977da986622d62d440bbd1e6cf
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
4fce99f994573866a02b424e66adcaca41e598c0
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
e1e69da0a47bfaa02932aa46f65da8fd51ab7a0933e3465aaa8e2c84dcb11374
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3e619f25a2a9b9a8e45948eec0d8080b3e510e87f0d7dd9ae03288001b6b1eecee7f1da7476bf33885281f9b522708ee85a69a7bff8a626f8b7970617bc612c3
|
package/Detox-ios-src.tbz
CHANGED
Binary file
|
package/Detox-ios.tbz
CHANGED
Binary file
|
package/android/build.gradle
CHANGED
@@ -3,7 +3,7 @@ buildscript {
|
|
3
3
|
isOfficialDetoxLib = true
|
4
4
|
kotlinVersion = '1.2.0'
|
5
5
|
dokkaVersion = '1.6.0'
|
6
|
-
buildToolsVersion = '
|
6
|
+
buildToolsVersion = '30.0.2'
|
7
7
|
compileSdkVersion = 31
|
8
8
|
targetSdkVersion = 31
|
9
9
|
minSdkVersion = 21
|
@@ -15,7 +15,7 @@ buildscript {
|
|
15
15
|
google()
|
16
16
|
}
|
17
17
|
dependencies {
|
18
|
-
classpath 'com.android.tools.build:gradle:
|
18
|
+
classpath 'com.android.tools.build:gradle:4.2.2'
|
19
19
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
20
20
|
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
|
21
21
|
|
@@ -5,8 +5,8 @@ apply plugin: 'kotlin-android-extensions'
|
|
5
5
|
def _ext = rootProject.ext
|
6
6
|
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 31
|
7
7
|
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 31
|
8
|
-
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion :
|
9
|
-
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion :
|
8
|
+
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '30.0.2'
|
9
|
+
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 18
|
10
10
|
def _kotlinVersion = _ext.has('detoxKotlinVersion') ? _ext.detoxKotlinVersion : '1.2.0'
|
11
11
|
def _kotlinStdlib = _ext.has('detoxKotlinStdlib') ? _ext.detoxKotlinStdlib : 'kotlin-stdlib-jdk8'
|
12
12
|
|
@@ -4,12 +4,8 @@ project.ext.buildPomXmlDependencies = { pom, configurations ->
|
|
4
4
|
pom.withXml {
|
5
5
|
final rootNode = asNode().appendNode('dependencies')
|
6
6
|
addConfigurationDependencies(rootNode, configurations.api, 'compile')
|
7
|
+
addConfigurationDependencies(rootNode, configurations.compile, 'compile')
|
7
8
|
addConfigurationDependencies(rootNode, configurations.implementation, 'runtime')
|
8
|
-
|
9
|
-
// Legacy syntax
|
10
|
-
if (configurations.hasProperty('compile')) {
|
11
|
-
addConfigurationDependencies(rootNode, configurations.compile, 'compile')
|
12
|
-
}
|
13
9
|
}
|
14
10
|
}
|
15
11
|
|
@@ -140,15 +140,13 @@ signing {
|
|
140
140
|
|
141
141
|
project.afterEvaluate {
|
142
142
|
project.tasks.all { Task task ->
|
143
|
-
android {
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
onPrePublish()
|
151
|
-
}
|
143
|
+
android.libraryVariants.all { variant ->
|
144
|
+
String variantName = variant.name.capitalize()
|
145
|
+
if (task.name == "publishMaven${variantName}AarPublicationToMavenRepository") {
|
146
|
+
task.dependsOn "assemble${variantName}"
|
147
|
+
task.dependsOn project.tasks.signArchives
|
148
|
+
task.doFirst {
|
149
|
+
onPrePublish()
|
152
150
|
}
|
153
151
|
}
|
154
152
|
}
|
@@ -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,8 +2,6 @@ package com.wix.detox.adapters.server;
|
|
2
2
|
|
3
3
|
import android.util.Log;
|
4
4
|
|
5
|
-
import com.wix.detox.common.DetoxErrors;
|
6
|
-
|
7
5
|
import org.json.JSONException;
|
8
6
|
import org.json.JSONObject;
|
9
7
|
|
@@ -86,7 +84,7 @@ public class WebSocketClient {
|
|
86
84
|
wsEventsHandler.onAction(type, params.toString(), messageId);
|
87
85
|
}
|
88
86
|
} catch (JSONException e) {
|
89
|
-
|
87
|
+
Log.e(LOG_TAG, "Detox Error: receiveAction decode - " + e.toString());
|
90
88
|
}
|
91
89
|
}
|
92
90
|
|
@@ -2,6 +2,7 @@ package com.wix.detox.espresso;
|
|
2
2
|
|
3
3
|
import android.view.View;
|
4
4
|
|
5
|
+
import com.facebook.react.views.slider.ReactSliderManager;
|
5
6
|
import com.wix.detox.common.DetoxErrors.DetoxRuntimeException;
|
6
7
|
import com.wix.detox.common.DetoxErrors.StaleActionException;
|
7
8
|
import com.wix.detox.espresso.action.AdjustSliderToPositionAction;
|
@@ -150,7 +151,8 @@ public class DetoxAction {
|
|
150
151
|
}
|
151
152
|
|
152
153
|
public static ViewAction adjustSliderToPosition(final double newPosition) {
|
153
|
-
|
154
|
+
ReactSliderManager reactSliderManager = new ReactSliderManager();
|
155
|
+
return new AdjustSliderToPositionAction(newPosition, reactSliderManager);
|
154
156
|
}
|
155
157
|
|
156
158
|
public static ViewAction takeViewScreenshot() {
|
@@ -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.
|
8
|
+
import com.wix.detox.espresso.common.utils.UiControllerUtils;
|
9
9
|
|
10
10
|
import org.joor.Reflect;
|
11
11
|
import org.joor.ReflectException;
|
@@ -3,17 +3,15 @@
|
|
3
3
|
package com.wix.detox.espresso.matcher
|
4
4
|
|
5
5
|
import android.view.View
|
6
|
-
import androidx.appcompat.widget.AppCompatSeekBar
|
7
6
|
import androidx.test.espresso.matcher.BoundedMatcher
|
8
7
|
import androidx.test.espresso.matcher.ViewMatchers
|
9
8
|
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
|
10
|
-
import com.
|
9
|
+
import com.facebook.react.views.slider.ReactSlider
|
11
10
|
import org.hamcrest.BaseMatcher
|
12
11
|
import org.hamcrest.Description
|
13
12
|
import org.hamcrest.Matcher
|
14
13
|
import org.hamcrest.Matchers.allOf
|
15
14
|
import org.hamcrest.TypeSafeMatcher
|
16
|
-
import kotlin.math.abs
|
17
15
|
|
18
16
|
/*
|
19
17
|
* An extension of [androidx.test.espresso.matcher.ViewMatchers].
|
@@ -38,19 +36,6 @@ fun isOfClassName(className: String): Matcher<View> {
|
|
38
36
|
fun isMatchingAtIndex(index: Int, innerMatcher: Matcher<View>): Matcher<View> =
|
39
37
|
ViewAtIndexMatcher(index, innerMatcher)
|
40
38
|
|
41
|
-
fun toHaveSliderPosition(expectedValuePct: Double, tolerance: Double): Matcher<View?> =
|
42
|
-
object: BoundedMatcher<View?, AppCompatSeekBar>(AppCompatSeekBar::class.java) {
|
43
|
-
override fun describeTo(description: Description) {
|
44
|
-
description.appendText("sliderPositionPercent($expectedValuePct)")
|
45
|
-
}
|
46
|
-
|
47
|
-
override fun matchesSafely(view: AppCompatSeekBar): Boolean {
|
48
|
-
val sliderHelper = SliderHelper.create(view)
|
49
|
-
val progressPct = sliderHelper.getCurrentProgressPct()
|
50
|
-
return (abs(progressPct - expectedValuePct) <= tolerance)
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
39
|
/**
|
55
40
|
* Same as [androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom], but accepts any class. Needed
|
56
41
|
* in order to avoid warning when passing 'any' class.
|
@@ -62,3 +47,25 @@ private class IsAssignableFromMatcher(private val clazz: Class<*>) : TypeSafeMat
|
|
62
47
|
description.appendText("is assignable from class: $clazz")
|
63
48
|
}
|
64
49
|
}
|
50
|
+
|
51
|
+
fun toHaveSliderPosition(expectedValue: Double, tolerance: Double): Matcher<View?> {
|
52
|
+
return object : BoundedMatcher<View?, ReactSlider>(ReactSlider::class.java) {
|
53
|
+
override fun describeTo(description: Description) {
|
54
|
+
description.appendText("expected: $expectedValue")
|
55
|
+
}
|
56
|
+
|
57
|
+
override fun matchesSafely(slider: ReactSlider?): Boolean {
|
58
|
+
val currentProgress = slider?.progress
|
59
|
+
|
60
|
+
if (currentProgress != null) {
|
61
|
+
val realProgress = slider.toRealProgress(currentProgress)
|
62
|
+
val currentPctFactor = slider.max / currentProgress.toDouble()
|
63
|
+
val realTotal = realProgress * currentPctFactor
|
64
|
+
val actualValue = realProgress / realTotal
|
65
|
+
return Math.abs(actualValue - expectedValue) <= tolerance
|
66
|
+
}
|
67
|
+
|
68
|
+
return false
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
@@ -7,22 +7,17 @@ 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
|
12
10
|
import java.util.concurrent.CountDownLatch
|
13
11
|
import java.util.concurrent.TimeUnit
|
14
12
|
|
15
13
|
private const val LOG_TAG = "DetoxRNLoading"
|
16
14
|
|
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
|
-
|
20
15
|
open class ReactNativeLoadingMonitor(
|
21
16
|
private val instrumentation: Instrumentation,
|
22
17
|
private val rnApplication: ReactApplication,
|
23
18
|
private val previousReactContext: ReactContext?,
|
24
19
|
private val config: DetoxConfig = DetoxConfig.CONFIG) {
|
25
|
-
|
20
|
+
val countDownLatch = CountDownLatch(1)
|
26
21
|
|
27
22
|
fun getNewContext(): ReactContext? {
|
28
23
|
subscribeToNewRNContextUpdates()
|
@@ -40,9 +35,13 @@ open class ReactNativeLoadingMonitor(
|
|
40
35
|
return@Runnable
|
41
36
|
}
|
42
37
|
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
+
})
|
46
45
|
})
|
47
46
|
}
|
48
47
|
|
@@ -82,48 +81,3 @@ open class ReactNativeLoadingMonitor(
|
|
82
81
|
return rnInstanceManager.currentReactContext
|
83
82
|
}
|
84
83
|
}
|
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
|
-
}
|
@@ -5,6 +5,7 @@ public interface DetoxErrors {
|
|
5
5
|
public DetoxRuntimeException(Throwable cause) {
|
6
6
|
super(cause);
|
7
7
|
}
|
8
|
+
|
8
9
|
public DetoxRuntimeException(String message) {
|
9
10
|
super(message);
|
10
11
|
}
|
@@ -30,9 +31,5 @@ public interface DetoxErrors {
|
|
30
31
|
public DetoxIllegalArgumentException(String message) {
|
31
32
|
super(message);
|
32
33
|
}
|
33
|
-
|
34
|
-
public DetoxIllegalArgumentException(Throwable cause) {
|
35
|
-
super(cause);
|
36
|
-
}
|
37
34
|
}
|
38
35
|
}
|
@@ -1,11 +1,10 @@
|
|
1
|
-
|
2
1
|
package com.wix.detox.espresso
|
3
2
|
|
4
3
|
import androidx.test.espresso.UiController
|
5
4
|
import com.wix.detox.common.proxy.CallInfo
|
6
5
|
import com.wix.detox.common.proxy.SpyingInvocationHandler
|
7
6
|
import com.wix.detox.common.proxy.MethodsSpy
|
8
|
-
import com.wix.detox.espresso.
|
7
|
+
import com.wix.detox.espresso.common.utils.getUiController
|
9
8
|
import org.joor.Reflect
|
10
9
|
|
11
10
|
class UiControllerSpy: MethodsSpy("uiController") {
|
package/android/detox/src/main/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
package com.wix.detox.espresso.action
|
2
|
+
|
3
|
+
import android.view.View
|
4
|
+
import androidx.test.espresso.UiController
|
5
|
+
import androidx.test.espresso.ViewAction
|
6
|
+
import androidx.test.espresso.matcher.ViewMatchers
|
7
|
+
import com.facebook.react.bridge.JavaOnlyMap
|
8
|
+
import com.facebook.react.uimanager.ReactStylesDiffMap
|
9
|
+
import com.facebook.react.views.slider.ReactSlider
|
10
|
+
import com.facebook.react.views.slider.ReactSliderManager
|
11
|
+
import org.hamcrest.Matcher
|
12
|
+
import org.hamcrest.Matchers
|
13
|
+
|
14
|
+
class AdjustSliderToPositionAction(private val desiredPosition: Double, private val mManager: ReactSliderManager) : ViewAction {
|
15
|
+
override fun getConstraints(): Matcher<View?>? = Matchers.allOf(
|
16
|
+
ViewMatchers.isAssignableFrom(ReactSlider::class.java),
|
17
|
+
getIsDisplayed())
|
18
|
+
|
19
|
+
override fun getDescription() = "adjustSliderToPosition"
|
20
|
+
|
21
|
+
fun getIsDisplayed(): Matcher<View?> = ViewMatchers.isDisplayed()
|
22
|
+
|
23
|
+
private fun buildStyles(vararg keysAndValues: Any) = ReactStylesDiffMap(JavaOnlyMap.of(*keysAndValues))
|
24
|
+
|
25
|
+
private fun calculateProgressTarget(view: ReactSlider): Double {
|
26
|
+
val sliderProgress = view.toRealProgress(view.progress)
|
27
|
+
val sliderScrollFactor = view.max / view.progress.toDouble()
|
28
|
+
val sliderMaxValue = sliderProgress * sliderScrollFactor
|
29
|
+
return desiredPosition * sliderMaxValue
|
30
|
+
}
|
31
|
+
|
32
|
+
override fun perform(uiController: UiController?, view: View) {
|
33
|
+
val progressNewValue = calculateProgressTarget(view as ReactSlider)
|
34
|
+
mManager.updateProperties(view, buildStyles("value", progressNewValue))
|
35
|
+
}
|
36
|
+
}
|
package/android/detox/src/{full → main}/java/com/wix/detox/espresso/action/GetAttributesAction.kt
RENAMED
@@ -9,7 +9,6 @@ import android.widget.TextView
|
|
9
9
|
import androidx.test.espresso.UiController
|
10
10
|
import com.google.android.material.slider.Slider
|
11
11
|
import com.wix.detox.espresso.ViewActionWithResult
|
12
|
-
import com.wix.detox.espresso.common.SliderHelper
|
13
12
|
import org.hamcrest.Matcher
|
14
13
|
import org.hamcrest.Matchers
|
15
14
|
import org.hamcrest.Matchers.allOf
|
@@ -128,24 +127,13 @@ private class CheckBoxAttributes {
|
|
128
127
|
rootObject.put("value", view.isChecked)
|
129
128
|
}
|
130
129
|
|
131
|
-
/**
|
132
|
-
* Note: this applies also to [androidx.appcompat.widget.AppCompatSeekBar], which
|
133
|
-
* is anything RN-slider-ish.
|
134
|
-
*/
|
135
130
|
private class ProgressBarAttributes {
|
136
131
|
fun get(json: JSONObject, view: View) {
|
137
132
|
if (view is ProgressBar) {
|
138
|
-
|
139
|
-
getRNSliderValue(json, it)
|
140
|
-
} ?:
|
141
|
-
getProgressBarValue(json, view)
|
133
|
+
getProgressBarValue(json, view)
|
142
134
|
}
|
143
135
|
}
|
144
136
|
|
145
|
-
private fun getRNSliderValue(rootObject: JSONObject, sliderHelper: SliderHelper) {
|
146
|
-
rootObject.put("value", sliderHelper.getCurrentProgressPct())
|
147
|
-
}
|
148
|
-
|
149
137
|
private fun getProgressBarValue(rootObject: JSONObject, view: ProgressBar) =
|
150
138
|
rootObject.put("value", view.progress)
|
151
139
|
}
|