detox 21.0.0-rc.0 → 21.0.0-rc.10
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintignore +3 -0
- package/.eslintrc.js +1 -40
- package/Detox-android/com/wix/detox/{21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar → 21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar} +0 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar → 21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar +0 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{21.0.0-rc.0/detox-21.0.0-rc.0.pom → 21.0.0-rc.10/detox-21.0.0-rc.10.pom} +1 -7
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.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-framework.tbz +0 -0
- package/Detox-ios-src.tbz +0 -0
- package/Detox-ios-xcuitest.tbz +0 -0
- package/android/build.gradle +20 -10
- package/android/detox/build.gradle +24 -12
- package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAssertion.java +44 -25
- package/android/detox/src/full/java/com/wix/detox/espresso/DetoxMatcher.java +12 -12
- package/android/detox/src/full/java/com/wix/detox/espresso/EspressoDetox.java +6 -7
- package/android/detox/src/full/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt +2 -2
- package/android/detox/src/full/java/com/wix/detox/espresso/action/GetAttributesAction.kt +34 -35
- package/android/detox/src/full/java/com/wix/detox/espresso/common/MaterialSliderHelper.kt +21 -0
- package/android/detox/src/full/java/com/wix/detox/espresso/common/{SliderHelper.kt → ReactSliderHelper.kt} +7 -6
- package/android/detox/src/full/java/com/wix/detox/espresso/matcher/RegexMatcher.kt +56 -0
- package/android/detox/src/full/java/com/wix/detox/espresso/matcher/ViewMatchers.kt +18 -6
- package/android/detox/src/full/java/com/wix/detox/espresso/performer/MultipleViewsActionPerformer.kt +43 -0
- package/android/detox/src/full/java/com/wix/detox/espresso/performer/SingleViewActionPerformer.kt +19 -0
- package/android/detox/src/full/java/com/wix/detox/espresso/performer/ViewActionPerformer.kt +24 -0
- package/android/detox/src/full/java/com/wix/detox/espresso/web/WebElement.java +4 -4
- package/android/detox/src/full/java/com/wix/invoke/types/Invocation.java +7 -6
- package/android/detox/src/main/java/com/wix/detox/espresso/MultipleViewsAction.kt +4 -0
- package/android/detox/src/main/java/com/wix/detox/espresso/UiControllerSpy.kt +0 -1
- package/android/detox/src/main/java/com/wix/detox/espresso/ViewActionWithResult.kt +2 -1
- package/android/detox/src/main/java/com/wix/detox/espresso/action/common/MotionEvents.kt +60 -4
- package/android/detox/src/testFull/java/com/wix/detox/espresso/action/GetAttributesActionTest.kt +6 -5
- package/android/detox/src/testFull/java/com/wix/detox/espresso/common/MaterialSliderHelperTest.kt +33 -0
- package/android/detox/src/testFull/java/com/wix/detox/espresso/common/{SliderHelperTest.kt → ReactSliderHelperTest.kt} +3 -3
- package/android/detox/src/testFull/java/com/wix/detox/espresso/matcher/RegexMatcherTest.kt +52 -0
- package/android/detox/src/testFull/java/com/wix/detox/espresso/performer/ViewActionPerformerSpec.kt +37 -0
- package/android/detox/src/testFull/java/com/wix/invoke/JsonParserTest.java +23 -7
- package/android/detox/src/testFull/resources/targetInvocationEspressoWebDetoxScript.json +47 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/rninfo.gradle +25 -0
- package/android/settings.gradle +2 -1
- package/detox.d.ts +1840 -0
- package/globals.d.ts +23 -0
- package/index.d.ts +2 -1789
- package/internals.d.ts +11 -1
- package/jest.config.js +108 -0
- package/local-cli/reset-lock-file.js +5 -9
- package/local-cli/startCommand/AppStartCommand.js +4 -1
- package/local-cli/testCommand/TestRunnerCommand.js +26 -3
- package/local-cli/utils/interruptListeners.js +15 -0
- package/package.json +15 -108
- package/runners/jest/reporter.js +21 -1
- package/runners/jest/reporters/DetoxIPCReporter.js +34 -0
- package/runners/jest/reporters/DetoxReporterDispatcher.js +144 -0
- package/runners/jest/reporters/DetoxSummaryReporter.js +16 -0
- package/runners/jest/reporters/DetoxVerboseReporter.js +16 -0
- package/runners/jest/reporters/index.js +6 -0
- package/runners/jest/testEnvironment/index.js +11 -0
- package/src/DetoxWorker.js +5 -11
- package/src/android/core/NativeElement.js +26 -29
- package/src/android/core/WebElement.js +24 -6
- package/src/android/espressoapi/DetoxAssertion.js +16 -14
- package/src/android/espressoapi/DetoxMatcher.js +24 -8
- package/src/android/espressoapi/EspressoDetox.js +9 -2
- package/src/android/espressoapi/web/WebElement.js +1 -4
- package/src/android/interactions/native.js +2 -3
- package/src/android/matchers/index.js +4 -0
- package/src/android/matchers/native.js +9 -4
- package/src/android/matchers/web.js +26 -1
- package/src/artifacts/providers/index.js +3 -3
- package/src/artifacts/screenshot/SimulatorScreenshotPlugin.js +0 -17
- package/src/configuration/composeLoggerConfig.js +1 -0
- package/src/configuration/composeRunnerConfig.js +3 -1
- package/src/devices/allocation/DeviceAllocator.js +66 -20
- package/src/devices/allocation/DeviceList.js +44 -0
- package/src/devices/allocation/DeviceRegistry.js +189 -0
- package/src/devices/allocation/drivers/AllocationDriverBase.d.ts +15 -0
- package/src/devices/{common/drivers/android/tools → allocation/drivers/android}/FreeDeviceFinder.js +11 -10
- package/src/devices/allocation/drivers/android/attached/AttachedAndroidAllocDriver.js +22 -17
- package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +97 -38
- package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +32 -45
- package/src/devices/allocation/drivers/android/emulator/FreeEmulatorFinder.js +1 -1
- package/src/devices/allocation/drivers/android/emulator/FreePortFinder.js +37 -0
- package/src/devices/allocation/drivers/android/emulator/launchEmulatorProcess.js +3 -3
- package/src/devices/allocation/drivers/android/genycloud/GenyAllocDriver.js +104 -32
- package/src/devices/allocation/drivers/android/genycloud/GenyInstanceLauncher.js +40 -31
- package/src/devices/allocation/drivers/android/genycloud/GenyRegistry.js +121 -0
- package/src/devices/allocation/drivers/android/genycloud/services/GenyInstanceLifecycleService.js +24 -0
- package/src/devices/{common → allocation}/drivers/android/genycloud/services/GenyRecipesService.js +1 -1
- package/src/devices/allocation/drivers/android/genycloud/services/dto/GenyInstance.js +83 -0
- package/src/devices/allocation/drivers/android/genycloud/services/dto/GenyRecipe.js +25 -0
- package/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js +95 -54
- package/src/devices/allocation/drivers/ios/SimulatorQuery.js +24 -0
- package/src/devices/allocation/factories/android.js +29 -35
- package/src/devices/allocation/factories/ios.js +6 -7
- package/src/devices/common/drivers/DeviceCookie.d.ts +12 -0
- package/src/devices/common/drivers/android/cookies.d.ts +11 -0
- package/src/devices/common/drivers/android/emulator/exec/EmulatorExec.js +17 -5
- package/src/devices/common/drivers/android/exec/ADB.js +1 -0
- package/src/devices/common/drivers/android/tools/instrumentationArgs.js +7 -1
- package/src/devices/common/drivers/ios/cookies.d.ts +9 -0
- package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +3 -1
- package/src/devices/cookies/index.js +0 -6
- package/src/devices/runtime/drivers/android/genycloud/GenyCloudDriver.js +7 -6
- package/src/devices/runtime/drivers/ios/SimulatorDriver.js +9 -24
- package/src/devices/runtime/drivers/ios/XCUITestUtils.js +33 -19
- package/src/devices/runtime/factories/android.js +3 -11
- package/src/devices/runtime/factories/ios.js +3 -4
- package/src/{servicelocator → devices/servicelocator}/android/emulatorServiceLocator.js +1 -1
- package/src/devices/servicelocator/android/genycloudServiceLocator.js +17 -0
- package/src/devices/servicelocator/android/index.js +23 -0
- package/src/{validation → devices/validation}/EnvironmentValidatorBase.js +1 -0
- package/src/{validation → devices/validation}/android/GenycloudEnvValidator.js +2 -2
- package/src/{validation → devices/validation}/factories/index.js +1 -1
- package/src/{validation → devices/validation}/ios/IosSimulatorEnvValidator.js +2 -2
- package/src/environmentFactory.js +1 -11
- package/src/invoke.js +0 -2
- package/src/ios/expectTwo.js +28 -11
- package/src/ios/web.js +302 -0
- package/src/ipc/IPCClient.js +22 -1
- package/src/ipc/IPCServer.js +42 -1
- package/src/ipc/SessionState.js +1 -0
- package/src/logger/DetoxLogger.js +2 -2
- package/src/realms/DetoxContext.js +8 -0
- package/src/realms/DetoxInternalsFacade.js +1 -0
- package/src/realms/DetoxPrimaryContext.js +49 -44
- package/src/realms/DetoxSecondaryContext.js +27 -0
- package/src/realms/symbols.js +6 -0
- package/src/utils/PIDService.js +27 -0
- package/src/utils/assertIsFunction.js +35 -0
- package/src/utils/environment.js +8 -15
- package/src/utils/errorUtils.js +3 -3
- package/src/utils/invocationTraceDescriptions.js +16 -0
- package/src/utils/isArrowFunction.js +24 -0
- package/src/utils/isRegExp.js +7 -0
- package/tsconfig.json +8 -3
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar +0 -0
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar.md5 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar.sha1 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar.sha256 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar.sha512 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.pom.sha512 +0 -1
- package/runners/jest/reporters/DetoxReporter.js +0 -36
- package/src/devices/DeviceRegistry.js +0 -176
- package/src/devices/allocation/drivers/AllocationDriverBase.js +0 -30
- package/src/devices/allocation/drivers/android/attached/AttachedAndroidLauncher.js +0 -13
- package/src/devices/allocation/drivers/android/emulator/EmulatorAllocationHelper.js +0 -72
- package/src/devices/allocation/drivers/android/genycloud/GenyDeviceRegistryFactory.js +0 -16
- package/src/devices/allocation/drivers/android/genycloud/GenyInstanceAllocationHelper.js +0 -65
- package/src/devices/allocation/drivers/ios/SimulatorLauncher.js +0 -21
- package/src/devices/common/drivers/DeviceAllocationHelper.js +0 -20
- package/src/devices/common/drivers/DeviceLauncher.js +0 -19
- package/src/devices/common/drivers/android/genycloud/services/GenyInstanceLifecycleService.js +0 -25
- package/src/devices/common/drivers/android/genycloud/services/GenyInstanceLookupService.js +0 -38
- package/src/devices/common/drivers/android/genycloud/services/GenyInstanceNaming.js +0 -14
- package/src/devices/common/drivers/android/genycloud/services/dto/GenyInstance.js +0 -66
- package/src/devices/common/drivers/android/genycloud/services/dto/GenyRecipe.js +0 -13
- package/src/devices/cookies/AndroidDeviceCookie.js +0 -13
- package/src/devices/cookies/AndroidEmulatorCookie.js +0 -6
- package/src/devices/cookies/AttachedAndroidDeviceCookie.js +0 -12
- package/src/devices/cookies/DeviceCookie.js +0 -4
- package/src/devices/cookies/GenycloudEmulatorCookie.js +0 -20
- package/src/devices/cookies/IosCookie.js +0 -6
- package/src/devices/cookies/IosSimulatorCookie.js +0 -10
- package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +0 -71
- package/src/devices/lifecycle/factories/GenyGlobalLifecycleHandlerFactory.js +0 -18
- package/src/invoke/EarlGrey.js +0 -8
- package/src/servicelocator/android/genycloudServiceLocator.js +0 -21
- package/src/servicelocator/android/index.js +0 -25
- package/src/servicelocator/ios.js +0 -7
- /package/src/devices/{common → allocation}/drivers/android/genycloud/exec/GenyCloudExec.js +0 -0
- /package/src/devices/{common → allocation}/drivers/android/genycloud/services/GenyAuthService.js +0 -0
package/.eslintignore
CHANGED
package/.eslintrc.js
CHANGED
@@ -4,7 +4,7 @@ module.exports = {
|
|
4
4
|
'eslint:recommended',
|
5
5
|
'plugin:import/recommended',
|
6
6
|
'plugin:node/recommended',
|
7
|
-
'plugin:
|
7
|
+
'plugin:ecmascript-compat/recommended'
|
8
8
|
],
|
9
9
|
parser: '@typescript-eslint/parser',
|
10
10
|
plugins: [
|
@@ -73,45 +73,6 @@ module.exports = {
|
|
73
73
|
allowWarningComments: false,
|
74
74
|
}
|
75
75
|
],
|
76
|
-
// TODO: enable some of unicorn rules
|
77
|
-
'unicorn/better-regex': 'off',
|
78
|
-
'unicorn/catch-error-name': 'off',
|
79
|
-
'unicorn/consistent-destructuring': 'off',
|
80
|
-
'unicorn/consistent-function-scoping': 'off',
|
81
|
-
'unicorn/empty-brace-spaces': 'off',
|
82
|
-
'unicorn/error-message': 'off',
|
83
|
-
'unicorn/explicit-length-check': 'off',
|
84
|
-
'unicorn/filename-case': 'off',
|
85
|
-
'unicorn/import-style': 'off',
|
86
|
-
'unicorn/new-for-builtins': 'off',
|
87
|
-
'unicorn/no-abusive-eslint-disable': 'off',
|
88
|
-
'unicorn/no-array-callback-reference': 'off',
|
89
|
-
'unicorn/no-array-for-each': 'off',
|
90
|
-
'unicorn/no-array-reduce': 'off',
|
91
|
-
'unicorn/no-await-expression-member': 'off',
|
92
|
-
'unicorn/no-lonely-if': 'off',
|
93
|
-
'unicorn/no-nested-ternary': 'off',
|
94
|
-
'unicorn/no-new-array': 'off',
|
95
|
-
'unicorn/no-null': 'off',
|
96
|
-
'unicorn/no-object-as-default-parameter': 'off',
|
97
|
-
'unicorn/no-useless-undefined': 'off',
|
98
|
-
'unicorn/number-literal-case': 'off',
|
99
|
-
'unicorn/numeric-separators-style': 'off',
|
100
|
-
'unicorn/prefer-add-event-listener': 'off',
|
101
|
-
'unicorn/prefer-array-some': 'off',
|
102
|
-
'unicorn/prefer-array-flat': 'off',
|
103
|
-
'unicorn/prefer-includes': 'off',
|
104
|
-
'unicorn/prefer-module': 'off',
|
105
|
-
'unicorn/prefer-number-properties': 'off',
|
106
|
-
'unicorn/prefer-object-from-entries': 'off',
|
107
|
-
'unicorn/prefer-optional-catch-binding': 'off',
|
108
|
-
'unicorn/prefer-regexp-test': 'off',
|
109
|
-
'unicorn/prefer-spread': 'off',
|
110
|
-
'unicorn/prefer-string-slice': 'off',
|
111
|
-
'unicorn/prefer-string-starts-ends-with': 'off',
|
112
|
-
'unicorn/prefer-string-trim-start-end': 'off',
|
113
|
-
'unicorn/prefer-ternary': 'off',
|
114
|
-
'unicorn/prevent-abbreviations': 'off',
|
115
76
|
},
|
116
77
|
|
117
78
|
overrides: [
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
48706278e092a6f517e6e83beca21147
|
@@ -0,0 +1 @@
|
|
1
|
+
82c12b3212893c8768556b0418e28fe95d7a6fd4
|
@@ -0,0 +1 @@
|
|
1
|
+
57fd87fd66e1c657fa76e04310b113b85527b696af9b718d367904e77ed68fcf
|
@@ -0,0 +1 @@
|
|
1
|
+
73a1a64a145305954e6cc509f2a7df8e913ab4005f3ed3758058e65b2f9e14cfdae6ae78251a38eaec225a85360ef8713a45f6a58b8a13165b90a24b642a22a1
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
05517df8e183207cffc98f840e9922d0
|
@@ -0,0 +1 @@
|
|
1
|
+
aa22298c5f2b1c767972b73cfa83a38cca6d431d
|
@@ -0,0 +1 @@
|
|
1
|
+
31fc8e547cfa0c12a74b3519c815412c28193c5becd2b3e9093f19ee0090ec0e
|
@@ -0,0 +1 @@
|
|
1
|
+
2c5206b54501a3a44a8675a7376908b3eff27e3d83ec8af8703665f788cc881b27ed2ddb5b714f4774586e223f3d9fb69a889b48476c6f0ef4b4bcd60f0376cb
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
5037d89ac5d98e47d69d63b8731e7e3a
|
@@ -0,0 +1 @@
|
|
1
|
+
b4a0f9db575d92cb2da51c617e0ff531330cc2c6
|
@@ -0,0 +1 @@
|
|
1
|
+
1fa253115965db1c97bc6c8b0c1ab0dff9ac9f8714e063dc972332cc6798b63a
|
@@ -0,0 +1 @@
|
|
1
|
+
8174914ad6abe68c79f4812a32d292e80d922239045a30401bc39f43801f3cd2ea2807786248ffb58e84dfcdb8eddc00c7f606a874eb216def9350d325442af3
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<modelVersion>4.0.0</modelVersion>
|
4
4
|
<groupId>com.wix</groupId>
|
5
5
|
<artifactId>detox</artifactId>
|
6
|
-
<version>21.0.0-rc.
|
6
|
+
<version>21.0.0-rc.10</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>
|
@@ -84,12 +84,6 @@
|
|
84
84
|
<version>1.2.0</version>
|
85
85
|
<scope>runtime</scope>
|
86
86
|
</dependency>
|
87
|
-
<dependency>
|
88
|
-
<groupId>com.google.android.material</groupId>
|
89
|
-
<artifactId>material</artifactId>
|
90
|
-
<version>1.2.1</version>
|
91
|
-
<scope>runtime</scope>
|
92
|
-
</dependency>
|
93
87
|
<dependency>
|
94
88
|
<groupId>org.apache.commons</groupId>
|
95
89
|
<artifactId>commons-lang3</artifactId>
|
@@ -0,0 +1 @@
|
|
1
|
+
47e4d64d1352852554561536b72838ef
|
@@ -0,0 +1 @@
|
|
1
|
+
23e5953835f84f41476fc3b8c14348a5db1d5217
|
@@ -0,0 +1 @@
|
|
1
|
+
c92500968cb54c7261f1c1c6c183fcd63d1c73138bcdfe8d395be43d0b066d0a
|
@@ -0,0 +1 @@
|
|
1
|
+
25ec34190798f99281324f81f9f245adfbfa408533e55eeb8f40605e916346e25811212ed6cdd1a08c7467f6d5b693ac7539574af335da40ec4b4ee2dd875b2a
|
@@ -3,11 +3,11 @@
|
|
3
3
|
<groupId>com.wix</groupId>
|
4
4
|
<artifactId>detox</artifactId>
|
5
5
|
<versioning>
|
6
|
-
<latest>21.0.0-rc.
|
7
|
-
<release>21.0.0-rc.
|
6
|
+
<latest>21.0.0-rc.10</latest>
|
7
|
+
<release>21.0.0-rc.10</release>
|
8
8
|
<versions>
|
9
|
-
<version>21.0.0-rc.
|
9
|
+
<version>21.0.0-rc.10</version>
|
10
10
|
</versions>
|
11
|
-
<lastUpdated>
|
11
|
+
<lastUpdated>20231207092956</lastUpdated>
|
12
12
|
</versioning>
|
13
13
|
</metadata>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6597370f6ee5aa57c5389ee71efa15bf
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
d11f27b33a397e92c47a8da33cb861464f81165c
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
d4bd56fbf2000595919b6e7213f1f6565350d3f349e4901a831ef5a5af93365b
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
088a1fa6fb7ad1fdd37a26606ac7cf308603e76b3edca575ba4bbb2810252490c29f6cd7ec8cc8b3160a4934235f2ce016cab119869255052180eecd21a5550f
|
package/Detox-ios-framework.tbz
CHANGED
Binary file
|
package/Detox-ios-src.tbz
CHANGED
Binary file
|
package/Detox-ios-xcuitest.tbz
CHANGED
Binary file
|
package/android/build.gradle
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
buildscript {
|
2
|
+
apply from: './rninfo.gradle'
|
3
|
+
|
2
4
|
ext {
|
3
5
|
isOfficialDetoxLib = true
|
4
|
-
kotlinVersion = '1.6.
|
6
|
+
kotlinVersion = '1.6.21'
|
5
7
|
dokkaVersion = '1.6.0'
|
6
|
-
buildToolsVersion = '
|
7
|
-
compileSdkVersion =
|
8
|
-
targetSdkVersion =
|
8
|
+
buildToolsVersion = '33.0.0'
|
9
|
+
compileSdkVersion = 33
|
10
|
+
targetSdkVersion = 33
|
9
11
|
minSdkVersion = 21
|
10
12
|
|
11
13
|
if (System.properties['os.arch'] == "aarch64") {
|
@@ -19,11 +21,14 @@ buildscript {
|
|
19
21
|
ext.detoxKotlinVersion = ext.kotlinVersion
|
20
22
|
|
21
23
|
repositories {
|
22
|
-
mavenCentral()
|
23
24
|
google()
|
25
|
+
mavenCentral()
|
24
26
|
}
|
25
27
|
dependencies {
|
26
|
-
|
28
|
+
if (!rnInfo.isRN71OrNewer) {
|
29
|
+
classpath "com.facebook.react:react-native-gradle-plugin"
|
30
|
+
}
|
31
|
+
classpath 'com.android.tools.build:gradle:7.3.1'
|
27
32
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
28
33
|
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
|
29
34
|
|
@@ -34,11 +39,16 @@ buildscript {
|
|
34
39
|
|
35
40
|
allprojects {
|
36
41
|
repositories {
|
37
|
-
mavenLocal()
|
38
|
-
mavenCentral()
|
39
42
|
google()
|
40
|
-
|
41
|
-
|
43
|
+
mavenCentral()
|
44
|
+
mavenLocal()
|
45
|
+
|
46
|
+
// In RN's below 71, the native code comes from within node_modules/ rather
|
47
|
+
// than from maven-central.
|
48
|
+
if (!rnInfo.isRN71OrNewer) {
|
49
|
+
maven {
|
50
|
+
url "$projectDir/../../node_modules/react-native/android"
|
51
|
+
}
|
42
52
|
}
|
43
53
|
}
|
44
54
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
apply plugin: 'com.android.library'
|
2
2
|
apply plugin: 'kotlin-android'
|
3
|
+
apply from: '../rninfo.gradle'
|
3
4
|
|
4
5
|
def _kotlinMinVersion = '1.2.0'
|
5
6
|
def _materialMinVersion = '1.2.1'
|
@@ -12,9 +13,20 @@ def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 21
|
|
12
13
|
def _kotlinVersion = _ext.has('detoxKotlinVersion') ? _ext.detoxKotlinVersion : _kotlinMinVersion
|
13
14
|
def _kotlinStdlib = _ext.has('detoxKotlinStdlib') ? _ext.detoxKotlinStdlib : 'kotlin-stdlib-jdk8'
|
14
15
|
|
16
|
+
// RN native code comes from either maven-central (in which case, need the *exact* version),
|
17
|
+
// or otherwise from node_modules/, where the version is already aligned, by definition.
|
18
|
+
// noinspection GradleDynamicVersion
|
19
|
+
def _rnNativeArtifact = rnInfo.isRN71OrHigher
|
20
|
+
? "com.facebook.react:react-android:${rnInfo.version}"
|
21
|
+
: 'com.facebook.react:react-native:+'
|
22
|
+
|
15
23
|
android {
|
16
|
-
|
17
|
-
|
24
|
+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
|
25
|
+
if (agpVersion >= 7) {
|
26
|
+
namespace "com.wix.detox"
|
27
|
+
}
|
28
|
+
compileSdk _compileSdkVersion
|
29
|
+
buildToolsVersion = _buildToolsVersion
|
18
30
|
|
19
31
|
defaultConfig {
|
20
32
|
minSdkVersion _minSdkVersion
|
@@ -25,7 +37,7 @@ android {
|
|
25
37
|
consumerProguardFiles 'proguard-rules.pro'
|
26
38
|
}
|
27
39
|
|
28
|
-
flavorDimensions 'detox'
|
40
|
+
flavorDimensions = ['detox']
|
29
41
|
productFlavors {
|
30
42
|
full {
|
31
43
|
dimension 'detox'
|
@@ -40,7 +52,7 @@ android {
|
|
40
52
|
unitTests.returnDefaultValues = true
|
41
53
|
unitTests.all { t ->
|
42
54
|
reports {
|
43
|
-
html.
|
55
|
+
html.required = true
|
44
56
|
}
|
45
57
|
testLogging {
|
46
58
|
events "passed", "skipped", "failed", "standardOut", "standardError"
|
@@ -78,8 +90,8 @@ android {
|
|
78
90
|
// Fundamental deps.
|
79
91
|
dependencies {
|
80
92
|
implementation "org.jetbrains.kotlin:$_kotlinStdlib:$_kotlinMinVersion"
|
81
|
-
|
82
|
-
compileOnly
|
93
|
+
|
94
|
+
compileOnly "${_rnNativeArtifact}"
|
83
95
|
}
|
84
96
|
|
85
97
|
// androidx.test deps.
|
@@ -118,9 +130,6 @@ dependencies {
|
|
118
130
|
|
119
131
|
// Third-party/extension deps.
|
120
132
|
dependencies {
|
121
|
-
implementation("com.google.android.material:material:$_materialMinVersion") {
|
122
|
-
because 'Material components are mentioned explicitly (e.g. Slider in get-attributes handler)'
|
123
|
-
}
|
124
133
|
implementation('org.apache.commons:commons-lang3:3.7') {
|
125
134
|
because 'Needed by invoke. Warning: Upgrading to newer versions is not seamless.'
|
126
135
|
}
|
@@ -131,9 +140,8 @@ dependencies {
|
|
131
140
|
|
132
141
|
// Unit-testing deps.
|
133
142
|
dependencies {
|
134
|
-
|
135
|
-
testImplementation '
|
136
|
-
testImplementation 'org.json:json:20140107'
|
143
|
+
testImplementation "${_rnNativeArtifact}"
|
144
|
+
testImplementation 'org.json:json:20230227'
|
137
145
|
|
138
146
|
// https://github.com/spekframework/spek/issues/232#issuecomment-610732158
|
139
147
|
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.7.2'
|
@@ -143,6 +151,10 @@ dependencies {
|
|
143
151
|
testImplementation 'org.apache.commons:commons-io:1.3.2'
|
144
152
|
testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0'
|
145
153
|
testImplementation 'org.robolectric:robolectric:4.4'
|
154
|
+
|
155
|
+
testImplementation("com.google.android.material:material:$_materialMinVersion") {
|
156
|
+
because 'Material components are mentioned explicitly (e.g. Slider in get-attributes handler)'
|
157
|
+
}
|
146
158
|
}
|
147
159
|
|
148
160
|
// Spek (https://spekframework.org/setup-android)
|
@@ -24,42 +24,57 @@ import static org.hamcrest.Matchers.not;
|
|
24
24
|
|
25
25
|
public class DetoxAssertion {
|
26
26
|
|
27
|
+
private static final double NANOSECONDS_IN_A_SECOND = 1_000_000_000.0;
|
28
|
+
|
27
29
|
private DetoxAssertion() {
|
28
|
-
//
|
30
|
+
// This is a utility class and shouldn't be instantiated.
|
29
31
|
}
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
+
/**
|
34
|
+
* Asserts the given matcher for the provided view interaction.
|
35
|
+
*/
|
36
|
+
public static ViewInteraction assertMatcher(ViewInteraction viewInteraction, Matcher<View> viewMatcher) {
|
37
|
+
return viewInteraction.check(matches(viewMatcher));
|
33
38
|
}
|
34
39
|
|
35
|
-
|
36
|
-
|
40
|
+
/**
|
41
|
+
* Asserts that the given view interaction is not visible.
|
42
|
+
*/
|
43
|
+
public static ViewInteraction assertNotVisible(ViewInteraction viewInteraction) {
|
44
|
+
ViewInteraction result;
|
37
45
|
try {
|
38
|
-
|
39
|
-
return
|
46
|
+
result = viewInteraction.check(doesNotExist());
|
47
|
+
return result;
|
40
48
|
} catch (AssertionFailedError e) {
|
41
|
-
|
42
|
-
return
|
49
|
+
result = viewInteraction.check(matches(not(isDisplayed())));
|
50
|
+
return result;
|
43
51
|
}
|
44
52
|
}
|
45
53
|
|
46
|
-
|
47
|
-
|
54
|
+
/**
|
55
|
+
* Asserts that the given view interaction does not exist.
|
56
|
+
*/
|
57
|
+
public static ViewInteraction assertNotExists(ViewInteraction viewInteraction) {
|
58
|
+
return viewInteraction.check(doesNotExist());
|
48
59
|
}
|
49
60
|
|
50
|
-
|
51
|
-
|
61
|
+
/**
|
62
|
+
* Waits until the provided matcher matches the view interaction or a timeout occurs.
|
63
|
+
*/
|
64
|
+
public static void waitForAssertMatcher(final ViewInteraction viewInteraction, final Matcher<View> viewMatcher, double timeoutSeconds) {
|
65
|
+
final long startTime = System.nanoTime();
|
52
66
|
|
53
67
|
while (true) {
|
54
68
|
long currentTime = System.nanoTime();
|
55
|
-
long
|
56
|
-
double
|
57
|
-
if (
|
58
|
-
throw new DetoxRuntimeException(
|
69
|
+
long elapsedTime = currentTime - startTime;
|
70
|
+
double elapsedSeconds = (double) elapsedTime / NANOSECONDS_IN_A_SECOND;
|
71
|
+
if (elapsedSeconds >= timeoutSeconds) {
|
72
|
+
throw new DetoxRuntimeException(
|
73
|
+
"" + timeoutSeconds + "sec timeout expired without matching of given matcher: " + viewMatcher);
|
59
74
|
}
|
60
75
|
|
61
76
|
try {
|
62
|
-
|
77
|
+
viewInteraction.check(matches(viewMatcher));
|
63
78
|
break;
|
64
79
|
} catch (AssertionFailedError err) {
|
65
80
|
UiAutomatorHelper.espressoSync(20);
|
@@ -67,21 +82,25 @@ public class DetoxAssertion {
|
|
67
82
|
}
|
68
83
|
}
|
69
84
|
|
85
|
+
/**
|
86
|
+
* Continually asserts the provided matcher until a search action returns a matching view or a
|
87
|
+
* `StaleActionException` error is thrown.
|
88
|
+
*/
|
70
89
|
public static void waitForAssertMatcherWithSearchAction(
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
90
|
+
final ViewInteraction viewInteraction,
|
91
|
+
final Matcher<View> viewMatcher,
|
92
|
+
final ViewAction searchAction,
|
93
|
+
final Matcher<View> searchMatcher
|
94
|
+
) {
|
76
95
|
while (true) {
|
77
96
|
try {
|
78
|
-
assertMatcher(
|
97
|
+
assertMatcher(viewInteraction, viewMatcher);
|
79
98
|
break;
|
80
99
|
} catch (AssertionFailedError err) {
|
81
100
|
try {
|
82
101
|
onView(searchMatcher).perform(searchAction);
|
83
102
|
} catch (StaleActionException exStaleAction) {
|
84
|
-
assertMatcher(
|
103
|
+
assertMatcher(viewInteraction, viewMatcher);
|
85
104
|
break;
|
86
105
|
}
|
87
106
|
}
|
@@ -14,10 +14,10 @@ import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
|
14
14
|
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast;
|
15
15
|
import static androidx.test.espresso.matcher.ViewMatchers.isFocused;
|
16
16
|
import static androidx.test.espresso.matcher.ViewMatchers.isNotChecked;
|
17
|
-
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
|
18
17
|
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
|
19
|
-
import static
|
20
|
-
import static
|
18
|
+
import static com.wix.detox.espresso.matcher.ViewMatchers.withTagValue;
|
19
|
+
import static com.wix.detox.espresso.matcher.ViewMatchers.withContentDescription;
|
20
|
+
import static com.wix.detox.espresso.matcher.ViewMatchers.withText;
|
21
21
|
import static com.wix.detox.espresso.matcher.ViewMatchers.isMatchingAtIndex;
|
22
22
|
import static com.wix.detox.espresso.matcher.ViewMatchers.isOfClassName;
|
23
23
|
import static com.wix.detox.espresso.matcher.ViewMatchers.toHaveSliderPosition;
|
@@ -40,25 +40,25 @@ public class DetoxMatcher {
|
|
40
40
|
// static class
|
41
41
|
}
|
42
42
|
|
43
|
-
public static Matcher<View> matcherForText(String text) {
|
43
|
+
public static Matcher<View> matcherForText(String text, boolean isRegex) {
|
44
44
|
// return anyOf(withText(text), withContentDescription(text));
|
45
|
-
return allOf(withText(text), withEffectiveVisibility(Visibility.VISIBLE));
|
45
|
+
return allOf(withText(text, isRegex), withEffectiveVisibility(Visibility.VISIBLE));
|
46
46
|
}
|
47
47
|
|
48
|
-
public static Matcher<View> matcherForAccessibilityLabel(String label) {
|
49
|
-
return allOf(withAccessibilityLabel(label), withEffectiveVisibility(Visibility.VISIBLE));
|
48
|
+
public static Matcher<View> matcherForAccessibilityLabel(String label, boolean isRegex) {
|
49
|
+
return allOf(withAccessibilityLabel(label, isRegex), withEffectiveVisibility(Visibility.VISIBLE));
|
50
50
|
}
|
51
51
|
|
52
|
-
public static Matcher<View> matcherForShallowAccessibilityLabel(String label) {
|
53
|
-
return allOf(withShallowAccessibilityLabel(label), withEffectiveVisibility(Visibility.VISIBLE));
|
52
|
+
public static Matcher<View> matcherForShallowAccessibilityLabel(String label, boolean isRegex) {
|
53
|
+
return allOf(withShallowAccessibilityLabel(label, isRegex), withEffectiveVisibility(Visibility.VISIBLE));
|
54
54
|
}
|
55
55
|
|
56
56
|
public static Matcher<View> matcherForContentDescription(String contentDescription) {
|
57
|
-
return allOf(withContentDescription(contentDescription), withEffectiveVisibility(Visibility.VISIBLE));
|
57
|
+
return allOf(withContentDescription(contentDescription, false), withEffectiveVisibility(Visibility.VISIBLE));
|
58
58
|
}
|
59
59
|
|
60
|
-
public static Matcher<View> matcherForTestId(String testId) {
|
61
|
-
return allOf(withTagValue(
|
60
|
+
public static Matcher<View> matcherForTestId(String testId, boolean isRegex) {
|
61
|
+
return allOf(withTagValue(testId, isRegex), withEffectiveVisibility(Visibility.VISIBLE));
|
62
62
|
}
|
63
63
|
|
64
64
|
public static Matcher<View> matcherForToggleable(boolean value) {
|
@@ -1,5 +1,7 @@
|
|
1
1
|
package com.wix.detox.espresso;
|
2
2
|
|
3
|
+
import com.wix.detox.espresso.performer.ViewActionPerformer;
|
4
|
+
|
3
5
|
import android.app.Activity;
|
4
6
|
import android.content.Context;
|
5
7
|
import android.content.ContextWrapper;
|
@@ -20,6 +22,7 @@ import java.util.ArrayList;
|
|
20
22
|
import androidx.test.espresso.UiController;
|
21
23
|
import androidx.test.espresso.ViewAction;
|
22
24
|
import androidx.test.espresso.ViewInteraction;
|
25
|
+
import androidx.test.espresso.NoMatchingViewException;
|
23
26
|
import androidx.test.platform.app.InstrumentationRegistry;
|
24
27
|
|
25
28
|
import static androidx.test.espresso.Espresso.onView;
|
@@ -31,13 +34,9 @@ import static androidx.test.espresso.matcher.ViewMatchers.isRoot;
|
|
31
34
|
public class EspressoDetox {
|
32
35
|
private static final String LOG_TAG = "detox";
|
33
36
|
|
34
|
-
public static Object perform(
|
35
|
-
|
36
|
-
|
37
|
-
if (action instanceof ViewActionWithResult) {
|
38
|
-
return ((ViewActionWithResult) action).getResult();
|
39
|
-
}
|
40
|
-
return null;
|
37
|
+
public static Object perform(Matcher<View> matcher, ViewAction action) {
|
38
|
+
ViewActionPerformer performer = ViewActionPerformer.forAction(action);
|
39
|
+
return performer.performOn(matcher);
|
41
40
|
}
|
42
41
|
|
43
42
|
public static Activity getActivity(Context context) {
|
package/android/detox/src/full/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt
CHANGED
@@ -6,7 +6,7 @@ import androidx.test.espresso.UiController
|
|
6
6
|
import androidx.test.espresso.ViewAction
|
7
7
|
import androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom
|
8
8
|
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
9
|
-
import com.wix.detox.espresso.common.
|
9
|
+
import com.wix.detox.espresso.common.ReactSliderHelper
|
10
10
|
import org.hamcrest.Matcher
|
11
11
|
import org.hamcrest.Matchers
|
12
12
|
|
@@ -16,7 +16,7 @@ class AdjustSliderToPositionAction(private val targetPositionPct: Double) : View
|
|
16
16
|
Matchers.allOf( isDisplayed(), isAssignableFrom(AppCompatSeekBar::class.java) )
|
17
17
|
|
18
18
|
override fun perform(uiController: UiController?, view: View) {
|
19
|
-
val sliderHelper =
|
19
|
+
val sliderHelper = ReactSliderHelper.create(view)
|
20
20
|
sliderHelper.setProgressPct(targetPositionPct)
|
21
21
|
}
|
22
22
|
}
|