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.
Files changed (202) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.js +1 -40
  3. 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
  4. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar.md5 +1 -0
  5. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar.sha1 +1 -0
  6. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar.sha256 +1 -0
  7. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-javadoc.jar.sha512 +1 -0
  8. 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
  9. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar.md5 +1 -0
  10. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar.sha1 +1 -0
  11. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar.sha256 +1 -0
  12. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10-sources.jar.sha512 +1 -0
  13. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar +0 -0
  14. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar.md5 +1 -0
  15. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar.sha1 +1 -0
  16. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar.sha256 +1 -0
  17. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.aar.sha512 +1 -0
  18. 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
  19. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.pom.md5 +1 -0
  20. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.pom.sha1 +1 -0
  21. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.pom.sha256 +1 -0
  22. package/Detox-android/com/wix/detox/21.0.0-rc.10/detox-21.0.0-rc.10.pom.sha512 +1 -0
  23. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  24. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  25. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  26. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  27. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  28. package/Detox-ios-framework.tbz +0 -0
  29. package/Detox-ios-src.tbz +0 -0
  30. package/Detox-ios-xcuitest.tbz +0 -0
  31. package/android/build.gradle +20 -10
  32. package/android/detox/build.gradle +24 -12
  33. package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAssertion.java +44 -25
  34. package/android/detox/src/full/java/com/wix/detox/espresso/DetoxMatcher.java +12 -12
  35. package/android/detox/src/full/java/com/wix/detox/espresso/EspressoDetox.java +6 -7
  36. package/android/detox/src/full/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt +2 -2
  37. package/android/detox/src/full/java/com/wix/detox/espresso/action/GetAttributesAction.kt +34 -35
  38. package/android/detox/src/full/java/com/wix/detox/espresso/common/MaterialSliderHelper.kt +21 -0
  39. package/android/detox/src/full/java/com/wix/detox/espresso/common/{SliderHelper.kt → ReactSliderHelper.kt} +7 -6
  40. package/android/detox/src/full/java/com/wix/detox/espresso/matcher/RegexMatcher.kt +56 -0
  41. package/android/detox/src/full/java/com/wix/detox/espresso/matcher/ViewMatchers.kt +18 -6
  42. package/android/detox/src/full/java/com/wix/detox/espresso/performer/MultipleViewsActionPerformer.kt +43 -0
  43. package/android/detox/src/full/java/com/wix/detox/espresso/performer/SingleViewActionPerformer.kt +19 -0
  44. package/android/detox/src/full/java/com/wix/detox/espresso/performer/ViewActionPerformer.kt +24 -0
  45. package/android/detox/src/full/java/com/wix/detox/espresso/web/WebElement.java +4 -4
  46. package/android/detox/src/full/java/com/wix/invoke/types/Invocation.java +7 -6
  47. package/android/detox/src/main/java/com/wix/detox/espresso/MultipleViewsAction.kt +4 -0
  48. package/android/detox/src/main/java/com/wix/detox/espresso/UiControllerSpy.kt +0 -1
  49. package/android/detox/src/main/java/com/wix/detox/espresso/ViewActionWithResult.kt +2 -1
  50. package/android/detox/src/main/java/com/wix/detox/espresso/action/common/MotionEvents.kt +60 -4
  51. package/android/detox/src/testFull/java/com/wix/detox/espresso/action/GetAttributesActionTest.kt +6 -5
  52. package/android/detox/src/testFull/java/com/wix/detox/espresso/common/MaterialSliderHelperTest.kt +33 -0
  53. package/android/detox/src/testFull/java/com/wix/detox/espresso/common/{SliderHelperTest.kt → ReactSliderHelperTest.kt} +3 -3
  54. package/android/detox/src/testFull/java/com/wix/detox/espresso/matcher/RegexMatcherTest.kt +52 -0
  55. package/android/detox/src/testFull/java/com/wix/detox/espresso/performer/ViewActionPerformerSpec.kt +37 -0
  56. package/android/detox/src/testFull/java/com/wix/invoke/JsonParserTest.java +23 -7
  57. package/android/detox/src/testFull/resources/targetInvocationEspressoWebDetoxScript.json +47 -0
  58. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  59. package/android/rninfo.gradle +25 -0
  60. package/android/settings.gradle +2 -1
  61. package/detox.d.ts +1840 -0
  62. package/globals.d.ts +23 -0
  63. package/index.d.ts +2 -1789
  64. package/internals.d.ts +11 -1
  65. package/jest.config.js +108 -0
  66. package/local-cli/reset-lock-file.js +5 -9
  67. package/local-cli/startCommand/AppStartCommand.js +4 -1
  68. package/local-cli/testCommand/TestRunnerCommand.js +26 -3
  69. package/local-cli/utils/interruptListeners.js +15 -0
  70. package/package.json +15 -108
  71. package/runners/jest/reporter.js +21 -1
  72. package/runners/jest/reporters/DetoxIPCReporter.js +34 -0
  73. package/runners/jest/reporters/DetoxReporterDispatcher.js +144 -0
  74. package/runners/jest/reporters/DetoxSummaryReporter.js +16 -0
  75. package/runners/jest/reporters/DetoxVerboseReporter.js +16 -0
  76. package/runners/jest/reporters/index.js +6 -0
  77. package/runners/jest/testEnvironment/index.js +11 -0
  78. package/src/DetoxWorker.js +5 -11
  79. package/src/android/core/NativeElement.js +26 -29
  80. package/src/android/core/WebElement.js +24 -6
  81. package/src/android/espressoapi/DetoxAssertion.js +16 -14
  82. package/src/android/espressoapi/DetoxMatcher.js +24 -8
  83. package/src/android/espressoapi/EspressoDetox.js +9 -2
  84. package/src/android/espressoapi/web/WebElement.js +1 -4
  85. package/src/android/interactions/native.js +2 -3
  86. package/src/android/matchers/index.js +4 -0
  87. package/src/android/matchers/native.js +9 -4
  88. package/src/android/matchers/web.js +26 -1
  89. package/src/artifacts/providers/index.js +3 -3
  90. package/src/artifacts/screenshot/SimulatorScreenshotPlugin.js +0 -17
  91. package/src/configuration/composeLoggerConfig.js +1 -0
  92. package/src/configuration/composeRunnerConfig.js +3 -1
  93. package/src/devices/allocation/DeviceAllocator.js +66 -20
  94. package/src/devices/allocation/DeviceList.js +44 -0
  95. package/src/devices/allocation/DeviceRegistry.js +189 -0
  96. package/src/devices/allocation/drivers/AllocationDriverBase.d.ts +15 -0
  97. package/src/devices/{common/drivers/android/tools → allocation/drivers/android}/FreeDeviceFinder.js +11 -10
  98. package/src/devices/allocation/drivers/android/attached/AttachedAndroidAllocDriver.js +22 -17
  99. package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +97 -38
  100. package/src/devices/allocation/drivers/android/emulator/EmulatorLauncher.js +32 -45
  101. package/src/devices/allocation/drivers/android/emulator/FreeEmulatorFinder.js +1 -1
  102. package/src/devices/allocation/drivers/android/emulator/FreePortFinder.js +37 -0
  103. package/src/devices/allocation/drivers/android/emulator/launchEmulatorProcess.js +3 -3
  104. package/src/devices/allocation/drivers/android/genycloud/GenyAllocDriver.js +104 -32
  105. package/src/devices/allocation/drivers/android/genycloud/GenyInstanceLauncher.js +40 -31
  106. package/src/devices/allocation/drivers/android/genycloud/GenyRegistry.js +121 -0
  107. package/src/devices/allocation/drivers/android/genycloud/services/GenyInstanceLifecycleService.js +24 -0
  108. package/src/devices/{common → allocation}/drivers/android/genycloud/services/GenyRecipesService.js +1 -1
  109. package/src/devices/allocation/drivers/android/genycloud/services/dto/GenyInstance.js +83 -0
  110. package/src/devices/allocation/drivers/android/genycloud/services/dto/GenyRecipe.js +25 -0
  111. package/src/devices/allocation/drivers/ios/SimulatorAllocDriver.js +95 -54
  112. package/src/devices/allocation/drivers/ios/SimulatorQuery.js +24 -0
  113. package/src/devices/allocation/factories/android.js +29 -35
  114. package/src/devices/allocation/factories/ios.js +6 -7
  115. package/src/devices/common/drivers/DeviceCookie.d.ts +12 -0
  116. package/src/devices/common/drivers/android/cookies.d.ts +11 -0
  117. package/src/devices/common/drivers/android/emulator/exec/EmulatorExec.js +17 -5
  118. package/src/devices/common/drivers/android/exec/ADB.js +1 -0
  119. package/src/devices/common/drivers/android/tools/instrumentationArgs.js +7 -1
  120. package/src/devices/common/drivers/ios/cookies.d.ts +9 -0
  121. package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +3 -1
  122. package/src/devices/cookies/index.js +0 -6
  123. package/src/devices/runtime/drivers/android/genycloud/GenyCloudDriver.js +7 -6
  124. package/src/devices/runtime/drivers/ios/SimulatorDriver.js +9 -24
  125. package/src/devices/runtime/drivers/ios/XCUITestUtils.js +33 -19
  126. package/src/devices/runtime/factories/android.js +3 -11
  127. package/src/devices/runtime/factories/ios.js +3 -4
  128. package/src/{servicelocator → devices/servicelocator}/android/emulatorServiceLocator.js +1 -1
  129. package/src/devices/servicelocator/android/genycloudServiceLocator.js +17 -0
  130. package/src/devices/servicelocator/android/index.js +23 -0
  131. package/src/{validation → devices/validation}/EnvironmentValidatorBase.js +1 -0
  132. package/src/{validation → devices/validation}/android/GenycloudEnvValidator.js +2 -2
  133. package/src/{validation → devices/validation}/factories/index.js +1 -1
  134. package/src/{validation → devices/validation}/ios/IosSimulatorEnvValidator.js +2 -2
  135. package/src/environmentFactory.js +1 -11
  136. package/src/invoke.js +0 -2
  137. package/src/ios/expectTwo.js +28 -11
  138. package/src/ios/web.js +302 -0
  139. package/src/ipc/IPCClient.js +22 -1
  140. package/src/ipc/IPCServer.js +42 -1
  141. package/src/ipc/SessionState.js +1 -0
  142. package/src/logger/DetoxLogger.js +2 -2
  143. package/src/realms/DetoxContext.js +8 -0
  144. package/src/realms/DetoxInternalsFacade.js +1 -0
  145. package/src/realms/DetoxPrimaryContext.js +49 -44
  146. package/src/realms/DetoxSecondaryContext.js +27 -0
  147. package/src/realms/symbols.js +6 -0
  148. package/src/utils/PIDService.js +27 -0
  149. package/src/utils/assertIsFunction.js +35 -0
  150. package/src/utils/environment.js +8 -15
  151. package/src/utils/errorUtils.js +3 -3
  152. package/src/utils/invocationTraceDescriptions.js +16 -0
  153. package/src/utils/isArrowFunction.js +24 -0
  154. package/src/utils/isRegExp.js +7 -0
  155. package/tsconfig.json +8 -3
  156. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar.md5 +0 -1
  157. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar.sha1 +0 -1
  158. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar.sha256 +0 -1
  159. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-javadoc.jar.sha512 +0 -1
  160. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar.md5 +0 -1
  161. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar.sha1 +0 -1
  162. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar.sha256 +0 -1
  163. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0-sources.jar.sha512 +0 -1
  164. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar +0 -0
  165. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar.md5 +0 -1
  166. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar.sha1 +0 -1
  167. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar.sha256 +0 -1
  168. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.aar.sha512 +0 -1
  169. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.pom.md5 +0 -1
  170. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.pom.sha1 +0 -1
  171. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.pom.sha256 +0 -1
  172. package/Detox-android/com/wix/detox/21.0.0-rc.0/detox-21.0.0-rc.0.pom.sha512 +0 -1
  173. package/runners/jest/reporters/DetoxReporter.js +0 -36
  174. package/src/devices/DeviceRegistry.js +0 -176
  175. package/src/devices/allocation/drivers/AllocationDriverBase.js +0 -30
  176. package/src/devices/allocation/drivers/android/attached/AttachedAndroidLauncher.js +0 -13
  177. package/src/devices/allocation/drivers/android/emulator/EmulatorAllocationHelper.js +0 -72
  178. package/src/devices/allocation/drivers/android/genycloud/GenyDeviceRegistryFactory.js +0 -16
  179. package/src/devices/allocation/drivers/android/genycloud/GenyInstanceAllocationHelper.js +0 -65
  180. package/src/devices/allocation/drivers/ios/SimulatorLauncher.js +0 -21
  181. package/src/devices/common/drivers/DeviceAllocationHelper.js +0 -20
  182. package/src/devices/common/drivers/DeviceLauncher.js +0 -19
  183. package/src/devices/common/drivers/android/genycloud/services/GenyInstanceLifecycleService.js +0 -25
  184. package/src/devices/common/drivers/android/genycloud/services/GenyInstanceLookupService.js +0 -38
  185. package/src/devices/common/drivers/android/genycloud/services/GenyInstanceNaming.js +0 -14
  186. package/src/devices/common/drivers/android/genycloud/services/dto/GenyInstance.js +0 -66
  187. package/src/devices/common/drivers/android/genycloud/services/dto/GenyRecipe.js +0 -13
  188. package/src/devices/cookies/AndroidDeviceCookie.js +0 -13
  189. package/src/devices/cookies/AndroidEmulatorCookie.js +0 -6
  190. package/src/devices/cookies/AttachedAndroidDeviceCookie.js +0 -12
  191. package/src/devices/cookies/DeviceCookie.js +0 -4
  192. package/src/devices/cookies/GenycloudEmulatorCookie.js +0 -20
  193. package/src/devices/cookies/IosCookie.js +0 -6
  194. package/src/devices/cookies/IosSimulatorCookie.js +0 -10
  195. package/src/devices/lifecycle/GenyGlobalLifecycleHandler.js +0 -71
  196. package/src/devices/lifecycle/factories/GenyGlobalLifecycleHandlerFactory.js +0 -18
  197. package/src/invoke/EarlGrey.js +0 -8
  198. package/src/servicelocator/android/genycloudServiceLocator.js +0 -21
  199. package/src/servicelocator/android/index.js +0 -25
  200. package/src/servicelocator/ios.js +0 -7
  201. /package/src/devices/{common → allocation}/drivers/android/genycloud/exec/GenyCloudExec.js +0 -0
  202. /package/src/devices/{common → allocation}/drivers/android/genycloud/services/GenyAuthService.js +0 -0
package/.eslintignore CHANGED
@@ -1,5 +1,8 @@
1
+ *.d.ts
1
2
  /src/android/espressoapi/**/*.js
2
3
  /coverage
3
4
  /ios
4
5
  /android
5
6
  /test
7
+ /allure-*
8
+ /artifacts
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:unicorn/recommended'
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: [
@@ -0,0 +1 @@
1
+ 48706278e092a6f517e6e83beca21147
@@ -0,0 +1 @@
1
+ 82c12b3212893c8768556b0418e28fe95d7a6fd4
@@ -0,0 +1 @@
1
+ 57fd87fd66e1c657fa76e04310b113b85527b696af9b718d367904e77ed68fcf
@@ -0,0 +1 @@
1
+ 73a1a64a145305954e6cc509f2a7df8e913ab4005f3ed3758058e65b2f9e14cfdae6ae78251a38eaec225a85360ef8713a45f6a58b8a13165b90a24b642a22a1
@@ -0,0 +1 @@
1
+ 05517df8e183207cffc98f840e9922d0
@@ -0,0 +1 @@
1
+ aa22298c5f2b1c767972b73cfa83a38cca6d431d
@@ -0,0 +1 @@
1
+ 31fc8e547cfa0c12a74b3519c815412c28193c5becd2b3e9093f19ee0090ec0e
@@ -0,0 +1 @@
1
+ 2c5206b54501a3a44a8675a7376908b3eff27e3d83ec8af8703665f788cc881b27ed2ddb5b714f4774586e223f3d9fb69a889b48476c6f0ef4b4bcd60f0376cb
@@ -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.0</version>
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.0</latest>
7
- <release>21.0.0-rc.0</release>
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.0</version>
9
+ <version>21.0.0-rc.10</version>
10
10
  </versions>
11
- <lastUpdated>20230511153710</lastUpdated>
11
+ <lastUpdated>20231207092956</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 7b6098f8f092f7bc592374cba63aad5e
1
+ 6597370f6ee5aa57c5389ee71efa15bf
@@ -1 +1 @@
1
- 1bea3260d9d2db371e06eece061a26c7746d7273
1
+ d11f27b33a397e92c47a8da33cb861464f81165c
@@ -1 +1 @@
1
- d5be2a929ea68d45baa34a5ae791de4757714b2bcf6d1701416f02d4f65e4552
1
+ d4bd56fbf2000595919b6e7213f1f6565350d3f349e4901a831ef5a5af93365b
@@ -1 +1 @@
1
- b8318205a970d79dd3ac0ae691e59115cc11466e851432df0d399117844a845f1cca601e562004654540eec787cede9dc3d66bfa1a95c292937a38bc0ed6f190
1
+ 088a1fa6fb7ad1fdd37a26606ac7cf308603e76b3edca575ba4bbb2810252490c29f6cd7ec8cc8b3160a4934235f2ce016cab119869255052180eecd21a5550f
Binary file
package/Detox-ios-src.tbz CHANGED
Binary file
Binary file
@@ -1,11 +1,13 @@
1
1
  buildscript {
2
+ apply from: './rninfo.gradle'
3
+
2
4
  ext {
3
5
  isOfficialDetoxLib = true
4
- kotlinVersion = '1.6.10' // Aligned with RN .69's version bump
6
+ kotlinVersion = '1.6.21'
5
7
  dokkaVersion = '1.6.0'
6
- buildToolsVersion = '31.0.0'
7
- compileSdkVersion = 31
8
- targetSdkVersion = 31
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
- classpath 'com.android.tools.build:gradle:7.2.1'
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
- maven {
41
- url "$projectDir/../../node_modules/react-native/android"
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
- compileSdkVersion _compileSdkVersion
17
- buildToolsVersion _buildToolsVersion
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.enabled true
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
- //noinspection GradleDynamicVersion
82
- compileOnly 'com.facebook.react:react-native:+'
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
- //noinspection GradleDynamicVersion
135
- testImplementation 'com.facebook.react:react-native:+'
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
- // static class
30
+ // This is a utility class and shouldn't be instantiated.
29
31
  }
30
32
 
31
- public static ViewInteraction assertMatcher(ViewInteraction i, Matcher<View> m) {
32
- return i.check(matches(m));
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
- public static ViewInteraction assertNotVisible(ViewInteraction i) {
36
- ViewInteraction ret;
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
- ret = i.check(doesNotExist());
39
- return ret;
46
+ result = viewInteraction.check(doesNotExist());
47
+ return result;
40
48
  } catch (AssertionFailedError e) {
41
- ret = i.check(matches(not(isDisplayed())));
42
- return ret;
49
+ result = viewInteraction.check(matches(not(isDisplayed())));
50
+ return result;
43
51
  }
44
52
  }
45
53
 
46
- public static ViewInteraction assertNotExists(ViewInteraction i) {
47
- return i.check(doesNotExist());
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
- public static void waitForAssertMatcher(final ViewInteraction i, final Matcher<View> m, double timeoutSeconds) {
51
- final long originTime = System.nanoTime();
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 elapsed = currentTime - originTime;
56
- double seconds = (double) elapsed / 1000000000.0;
57
- if (seconds >= timeoutSeconds) {
58
- throw new DetoxRuntimeException("" + timeoutSeconds + "sec timeout expired without matching of given matcher: " + m);
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
- i.check(matches(m));
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
- final ViewInteraction i,
72
- final Matcher<View> vm,
73
- final ViewAction searchAction,
74
- final Matcher<View> searchMatcher) {
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(i, vm);
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(i, vm);
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 androidx.test.espresso.matcher.ViewMatchers.withTagValue;
20
- import static androidx.test.espresso.matcher.ViewMatchers.withText;
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(is((Object) testId)), withEffectiveVisibility(Visibility.VISIBLE));
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(ViewInteraction interaction, ViewAction action) {
35
- interaction.perform(action);
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) {
@@ -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.SliderHelper
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 = SliderHelper.create(view)
19
+ val sliderHelper = ReactSliderHelper.create(view)
20
20
  sliderHelper.setProgressPct(targetPositionPct)
21
21
  }
22
22
  }