detox 20.17.1 → 20.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/Detox-android/com/wix/detox/{20.17.1/detox-20.17.1-sources.jar → 20.18.1/detox-20.18.1-sources.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1-sources.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1-sources.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1-sources.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1-sources.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.aar +0 -0
  7. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.aar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.aar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.aar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.aar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{20.17.1/detox-20.17.1.pom → 20.18.1/detox-20.18.1.pom} +1 -1
  12. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.pom.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.pom.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.pom.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.18.1/detox-20.18.1.pom.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  17. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  18. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  19. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  20. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  21. package/Detox-ios-src.tbz +0 -0
  22. package/Detox-ios.tbz +0 -0
  23. package/android/build.gradle +4 -4
  24. package/android/detox/build.gradle +23 -3
  25. package/android/detox/proguard-rules-app.pro +4 -0
  26. package/android/detox/proguard-rules.pro +3 -0
  27. package/android/detox/publishing.gradle +2 -2
  28. package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java +1 -1
  29. package/android/detox/src/full/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt +1 -1
  30. package/android/detox/src/full/java/com/wix/detox/espresso/common/ReactSliderHelper.kt +6 -6
  31. package/android/detox/src/testFull/java/com/wix/detox/adapters/server/QueryStatusActionHandlerSpec.kt +12 -10
  32. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  33. package/android/gradle/wrapper/gradle-wrapper.properties +3 -3
  34. package/android/gradlew +24 -9
  35. package/android/gradlew.bat +92 -90
  36. package/android/rninfo.gradle +1 -0
  37. package/package.json +11 -9
  38. package/runners/jest/testEnvironment/index.js +2 -1
  39. package/scripts/postinstall.js +3 -0
  40. package/scripts/updateGradle.js +47 -0
  41. package/src/android/espressoapi/DetoxAction.js +1 -2
  42. package/src/artifacts/uiHierarchy/IosUIHierarchyPlugin.js +2 -0
  43. package/src/utils/rn-consts/rn-consts.js +15 -0
  44. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-javadoc.jar +0 -0
  45. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-javadoc.jar.md5 +0 -1
  46. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-javadoc.jar.sha1 +0 -1
  47. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-javadoc.jar.sha256 +0 -1
  48. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-javadoc.jar.sha512 +0 -1
  49. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-sources.jar.md5 +0 -1
  50. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-sources.jar.sha1 +0 -1
  51. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-sources.jar.sha256 +0 -1
  52. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1-sources.jar.sha512 +0 -1
  53. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.aar +0 -0
  54. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.aar.md5 +0 -1
  55. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.aar.sha1 +0 -1
  56. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.aar.sha256 +0 -1
  57. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.aar.sha512 +0 -1
  58. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.pom.md5 +0 -1
  59. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.pom.sha1 +0 -1
  60. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.pom.sha256 +0 -1
  61. package/Detox-android/com/wix/detox/20.17.1/detox-20.17.1.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ c164b85605ab451a8264339136ab7515
@@ -0,0 +1 @@
1
+ c0458f1c1a890a407f68cdc86948d8a3c0692b03
@@ -0,0 +1 @@
1
+ 7ab31f42474f721b1002201e416904aa1804b9119b550d187098697c5a5e2ea4
@@ -0,0 +1 @@
1
+ 0953ca49ab67708bbfcc64545084577a6be24f0aa63d8e1a1edee659df478785207327ae2f25e803c39e08cda7f45d3250a4c9990ba0d27e4a6e0981f68c75f1
@@ -0,0 +1 @@
1
+ 221afe495c4ff28f344cff35e41e566a
@@ -0,0 +1 @@
1
+ 9657a291e6e1725adb2a3e333248ad4a05892015
@@ -0,0 +1 @@
1
+ 23a9f6a86b0fb26b426f6188be04dc98eed5edeaa7f77c6e682bae9b80906312
@@ -0,0 +1 @@
1
+ a43c0a36b2b519a777662f087ba88e2bf781613ec86633434499ba70483fe072ebbbff6507f3ec3cb1cff7bfd5326af172d6fe7dcdc7990790796fe97d9c1519
@@ -3,7 +3,7 @@
3
3
  <modelVersion>4.0.0</modelVersion>
4
4
  <groupId>com.wix</groupId>
5
5
  <artifactId>detox</artifactId>
6
- <version>20.17.1</version>
6
+ <version>20.18.1</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
+ 641806679125eb5647b88084efa48378
@@ -0,0 +1 @@
1
+ 7a802fe47b5af9ea6a4605f263a4d6dd4c6cdd50
@@ -0,0 +1 @@
1
+ 1267f8c9d8c86d162ee4379848fbacc8f83f463ac706b17161bdc01f38494181
@@ -0,0 +1 @@
1
+ d9dd50f4f22f572bce5481ccc1a1d3150cb0ef263d2f38f1c22068c87f6a6922eb8447304662b3390451cd2a31abe56e77706cea5e7280b7120b8ba756e922fc
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.17.1</latest>
7
- <release>20.17.1</release>
6
+ <latest>20.18.1</latest>
7
+ <release>20.18.1</release>
8
8
  <versions>
9
- <version>20.17.1</version>
9
+ <version>20.18.1</version>
10
10
  </versions>
11
- <lastUpdated>20240207084645</lastUpdated>
11
+ <lastUpdated>20240211204223</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- a9c3a4136bf4c9e40ded8ec0d96e18f5
1
+ ef8e35c6c96b209a24b4c0f0f2a809fd
@@ -1 +1 @@
1
- 8800a7c30b91de89a16ece970bc0959562e8143b
1
+ efd9cada46d479e0c5400cbb12dd9d273fab0882
@@ -1 +1 @@
1
- 7e5ef051ef994eff64c72f01afac51109c009762f1ab45654114d2e5f8993b6d
1
+ 36d150b8d1bc8ea9a1f21638e7be5735563360e657960bc8dd3caffcaf3cd082
@@ -1 +1 @@
1
- d3290b1475ae0d47df879ba34f1fd3af4e791e0d03ef5d51d9c66c25c83d2aba01972a08bb091921895b216bca8a1e4dd335edbe37eb4c78d044a3edd1ba4cad
1
+ b5fd96ead15ad8617f0dde3a54c7507335c68023e39740b8979528e3eec0eaed4734ffc4e0abba740b422d07ebe27cc89da7bb3c68d6d066e41d473a57c125e8
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
@@ -3,11 +3,11 @@ buildscript {
3
3
 
4
4
  ext {
5
5
  isOfficialDetoxLib = true
6
- kotlinVersion = '1.6.21'
6
+ kotlinVersion = '1.8.0'
7
7
  dokkaVersion = '1.9.10'
8
- buildToolsVersion = '33.0.0'
9
- compileSdkVersion = 33
10
- targetSdkVersion = 33
8
+ buildToolsVersion = '34.0.0'
9
+ compileSdkVersion = 34
10
+ targetSdkVersion = 34
11
11
  minSdkVersion = 21
12
12
  }
13
13
  ext.detoxKotlinVersion = ext.kotlinVersion
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply from: '../rninfo.gradle'
4
4
 
5
5
  def _kotlinMinVersion = '1.2.0'
6
- def _materialMinVersion = '1.2.1'
6
+ def _materialMinVersion = '1.11.0'
7
7
 
8
8
  def _ext = rootProject.ext
9
9
  def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 31
@@ -65,7 +65,7 @@ android {
65
65
  def repeatLength = output.length()
66
66
  println '\n' + ('-' * repeatLength) + '\n' + output + '\n' + ('-' * repeatLength) + '\n'
67
67
 
68
- println "see report at file://${t.reports.html.destination}/index.html"
68
+ println "see report at file://${t.reports.html.outputLocation}/index.html"
69
69
  }
70
70
  }
71
71
  }
@@ -82,6 +82,26 @@ android {
82
82
  lintOptions {
83
83
  abortOnError false
84
84
  }
85
+
86
+ if (rnInfo.isRN72OrHigher) {
87
+ compileOptions {
88
+ sourceCompatibility JavaVersion.VERSION_17
89
+ targetCompatibility JavaVersion.VERSION_17
90
+ }
91
+
92
+ kotlinOptions {
93
+ jvmTarget = '17'
94
+ }
95
+ } else {
96
+ compileOptions {
97
+ sourceCompatibility JavaVersion.VERSION_11
98
+ targetCompatibility JavaVersion.VERSION_11
99
+ }
100
+
101
+ kotlinOptions {
102
+ jvmTarget = '11'
103
+ }
104
+ }
85
105
  }
86
106
 
87
107
  // In a nutshell:
@@ -151,7 +171,7 @@ dependencies {
151
171
  testImplementation 'org.assertj:assertj-core:3.16.1'
152
172
  testImplementation "org.jetbrains.kotlin:kotlin-test:$_kotlinVersion"
153
173
  testImplementation 'org.apache.commons:commons-io:1.3.2'
154
- testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0'
174
+ testImplementation 'org.mockito.kotlin:mockito-kotlin:5.2.1'
155
175
  testImplementation 'org.robolectric:robolectric:4.11.1'
156
176
 
157
177
  testImplementation("com.google.android.material:material:$_materialMinVersion") {
@@ -21,3 +21,7 @@
21
21
  -keep class okhttp3.** { *; }
22
22
 
23
23
  -keep class androidx.concurrent.futures.** { *; }
24
+
25
+ -dontwarn androidx.appcompat.**
26
+ -dontwarn javax.lang.model.element.**
27
+
@@ -20,3 +20,6 @@
20
20
 
21
21
  -keep class com.wix.detoxprofiler.** { *; }
22
22
  -dontnote com.wix.detox.instruments.reflected.**
23
+
24
+ -dontwarn androidx.appcompat.**
25
+ -dontwarn javax.lang.model.element.**
@@ -193,11 +193,11 @@ publishing {
193
193
 
194
194
  // Register sources, javadoc as published artifacts (via equivalent tasks' output)
195
195
  artifact sourcesJar
196
- artifact dokkaDocJar
196
+ //artifact dokkaDocJar // waiting for dokka to fix https://github.com/Kotlin/dokka/issues/3153
197
197
 
198
198
  // Also register source, javadoc as archive-artifacts, for signing
199
199
  declareArchive sourcesJar
200
- declareArchive dokkaDocJar
200
+ //declareArchive dokkaDocJar // waiting for dokka to fix https://github.com/Kotlin/dokka/issues/3153
201
201
 
202
202
  // Add detox package metadata to the .pom
203
203
  pom {
@@ -178,7 +178,7 @@ public class DetoxAction {
178
178
  return PickerActions.setDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH));
179
179
  }
180
180
 
181
- public static ViewAction adjustSliderToPosition(final double newPosition) {
181
+ public static ViewAction adjustSliderToPosition(final Float newPosition) {
182
182
  return new AdjustSliderToPositionAction(newPosition);
183
183
  }
184
184
 
@@ -10,7 +10,7 @@ import com.wix.detox.espresso.common.ReactSliderHelper
10
10
  import org.hamcrest.Matcher
11
11
  import org.hamcrest.Matchers
12
12
 
13
- class AdjustSliderToPositionAction(private val targetPositionPct: Double) : ViewAction {
13
+ class AdjustSliderToPositionAction(private val targetPositionPct: Float) : ViewAction {
14
14
  override fun getDescription() = "adjustSliderToPosition"
15
15
  override fun getConstraints(): Matcher<View?>? =
16
16
  Matchers.allOf( isDisplayed(), isAssignableFrom(AppCompatSeekBar::class.java) )
@@ -21,13 +21,13 @@ abstract class ReactSliderHelper(protected val slider: AppCompatSeekBar) {
21
21
  }
22
22
 
23
23
  // TODO Make this more testable (e.g. by delegating the set action away)
24
- fun setProgressPct(valuePct: Double) {
24
+ fun setProgressPct(valuePct: Float) {
25
25
  val maxJSProgress = calcMaxJSProgress()
26
26
  val valueJS = valuePct * maxJSProgress
27
- setProgressJS(valueJS)
27
+ setProgressJS(valueJS.toFloat())
28
28
  }
29
29
 
30
- protected abstract fun setProgressJS(valueJS: Double)
30
+ protected abstract fun setProgressJS(valueJS: Float)
31
31
 
32
32
  private fun calcMaxJSProgress(): Double {
33
33
  val nativeProgress = slider.progress.toDouble()
@@ -60,16 +60,16 @@ abstract class ReactSliderHelper(protected val slider: AppCompatSeekBar) {
60
60
  }
61
61
 
62
62
  private class LegacySliderHelper(slider: AppCompatSeekBar): ReactSliderHelper(slider) {
63
- override fun setProgressJS(valueJS: Double) {
63
+ override fun setProgressJS(valueJS: Float) {
64
64
  val reactSliderManager = Class.forName(CLASS_REACT_SLIDER_LEGACY_MANAGER).newInstance()
65
- Reflect.on(reactSliderManager).call("updateProperties", slider, buildStyles("value", valueJS))
65
+ Reflect.on(reactSliderManager).call("updateProperties", slider, buildStyles("value", valueJS.toDouble()))
66
66
  }
67
67
 
68
68
  private fun buildStyles(vararg keysAndValues: Any) = ReactStylesDiffMap(JavaOnlyMap.of(*keysAndValues))
69
69
  }
70
70
 
71
71
  private class CommunitySliderHelper(slider: AppCompatSeekBar): ReactSliderHelper(slider) {
72
- override fun setProgressJS(valueJS: Double) {
72
+ override fun setProgressJS(valueJS: Float) {
73
73
  val reactSliderManager = Class.forName(CLASS_REACT_SLIDER_COMMUNITY_MANAGER).newInstance()
74
74
  Reflect.on(reactSliderManager).call("setValue", slider, valueJS)
75
75
  }
@@ -3,6 +3,7 @@ package com.wix.detox.adapters.server
3
3
  import com.wix.detox.TestEngineFacade
4
4
  import com.wix.detox.inquiry.DetoxBusyResource
5
5
  import com.wix.detox.inquiry.DetoxBusyResourceDescription
6
+ import org.mockito.kotlin.doReturn
6
7
  import org.mockito.kotlin.eq
7
8
  import org.mockito.kotlin.mock
8
9
  import org.mockito.kotlin.verify
@@ -42,16 +43,17 @@ object QueryStatusActionHandlerSpec : Spek({
42
43
  }
43
44
 
44
45
  describe("given a busy app") {
45
- fun aBusyResourceDescription(description: Map<String, Any>): DetoxBusyResourceDescription =
46
- mock {
47
- on { json() }.thenReturn(description)
48
- }
46
+
49
47
 
50
48
  fun aBusyResource(identifier: String): DetoxBusyResource {
51
- val mockedDescription = aBusyResourceDescription(mapOf("mock" to identifier))
52
- return mock {
53
- on { getDescription() }.thenReturn(mockedDescription)
49
+
50
+ return mock<DetoxBusyResource.BusyIdlingResource> {
51
+ on { getDescription() } doReturn DetoxBusyResourceDescription.Builder()
52
+ .name("mock")
53
+ .addDescription("mock", identifier)
54
+ .build()
54
55
  }
56
+
55
57
  }
56
58
 
57
59
  it("should send a descriptive busy-status indication") {
@@ -60,8 +62,8 @@ object QueryStatusActionHandlerSpec : Spek({
60
62
  val expectedData = mapOf<String, Any>("status" to mapOf(
61
63
  "app_status" to "busy",
62
64
  "busy_resources" to listOf(
63
- mapOf("mock" to "some-resource"),
64
- mapOf("mock" to "yet-another-resource"),
65
+ mapOf("name" to "mock", "description" to mapOf("mock" to "some-resource")),
66
+ mapOf("name" to "mock", "description" to mapOf("mock" to "yet-another-resource"))
65
67
  )
66
68
  ))
67
69
  whenever(testEngineFacade.getAllBusyResources()).thenReturn(listOf(busyResource, busyResource2))
@@ -71,4 +73,4 @@ object QueryStatusActionHandlerSpec : Spek({
71
73
  }
72
74
  }
73
75
  }
74
- })
76
+ })
@@ -1,7 +1,7 @@
1
- #Sun Sep 15 22:36:02 IDT 2019
2
1
  distributionBase=GRADLE_USER_HOME
3
2
  distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
4
+ networkTimeout=10000
5
+ validateDistributionUrl=true
4
6
  zipStoreBase=GRADLE_USER_HOME
5
7
  zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
7
-
package/android/gradlew CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
 
3
3
  #
4
4
  # Copyright © 2015-2021 the original authors.
@@ -55,7 +55,7 @@
55
55
  # Darwin, MinGW, and NonStop.
56
56
  #
57
57
  # (3) This script is generated from the Groovy template
58
- # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58
+ # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59
59
  # within the Gradle project.
60
60
  #
61
61
  # You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,11 @@ do
80
80
  esac
81
81
  done
82
82
 
83
- APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84
-
85
- APP_NAME="Gradle"
83
+ # This is normally unused
84
+ # shellcheck disable=SC2034
86
85
  APP_BASE_NAME=${0##*/}
87
-
88
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89
- DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86
+ # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87
+ APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
90
88
 
91
89
  # Use the maximum available, or set MAX_FD != -1 to use that value.
92
90
  MAX_FD=maximum
@@ -133,22 +131,29 @@ location of your Java installation."
133
131
  fi
134
132
  else
135
133
  JAVACMD=java
136
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134
+ if ! command -v java >/dev/null 2>&1
135
+ then
136
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137
137
 
138
138
  Please set the JAVA_HOME variable in your environment to match the
139
139
  location of your Java installation."
140
+ fi
140
141
  fi
141
142
 
142
143
  # Increase the maximum file descriptors if we can.
143
144
  if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144
145
  case $MAX_FD in #(
145
146
  max*)
147
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148
+ # shellcheck disable=SC3045
146
149
  MAX_FD=$( ulimit -H -n ) ||
147
150
  warn "Could not query maximum file descriptor limit"
148
151
  esac
149
152
  case $MAX_FD in #(
150
153
  '' | soft) :;; #(
151
154
  *)
155
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156
+ # shellcheck disable=SC3045
152
157
  ulimit -n "$MAX_FD" ||
153
158
  warn "Could not set maximum file descriptor limit to $MAX_FD"
154
159
  esac
@@ -193,6 +198,10 @@ if "$cygwin" || "$msys" ; then
193
198
  done
194
199
  fi
195
200
 
201
+
202
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203
+ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204
+
196
205
  # Collect all arguments for the java command;
197
206
  # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198
207
  # shell script including quotes and variable substitutions, so put them in
@@ -205,6 +214,12 @@ set -- \
205
214
  org.gradle.wrapper.GradleWrapperMain \
206
215
  "$@"
207
216
 
217
+ # Stop when "xargs" is not available.
218
+ if ! command -v xargs >/dev/null 2>&1
219
+ then
220
+ die "xargs is not available"
221
+ fi
222
+
208
223
  # Use "xargs" to parse quoted args.
209
224
  #
210
225
  # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
@@ -1,90 +1,92 @@
1
- @if "%DEBUG%" == "" @echo off
2
- @rem ##########################################################################
3
- @rem
4
- @rem Gradle startup script for Windows
5
- @rem
6
- @rem ##########################################################################
7
-
8
- @rem Set local scope for the variables with windows NT shell
9
- if "%OS%"=="Windows_NT" setlocal
10
-
11
- @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12
- set DEFAULT_JVM_OPTS=
13
-
14
- set DIRNAME=%~dp0
15
- if "%DIRNAME%" == "" set DIRNAME=.
16
- set APP_BASE_NAME=%~n0
17
- set APP_HOME=%DIRNAME%
18
-
19
- @rem Find java.exe
20
- if defined JAVA_HOME goto findJavaFromJavaHome
21
-
22
- set JAVA_EXE=java.exe
23
- %JAVA_EXE% -version >NUL 2>&1
24
- if "%ERRORLEVEL%" == "0" goto init
25
-
26
- echo.
27
- echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28
- echo.
29
- echo Please set the JAVA_HOME variable in your environment to match the
30
- echo location of your Java installation.
31
-
32
- goto fail
33
-
34
- :findJavaFromJavaHome
35
- set JAVA_HOME=%JAVA_HOME:"=%
36
- set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37
-
38
- if exist "%JAVA_EXE%" goto init
39
-
40
- echo.
41
- echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42
- echo.
43
- echo Please set the JAVA_HOME variable in your environment to match the
44
- echo location of your Java installation.
45
-
46
- goto fail
47
-
48
- :init
49
- @rem Get command-line arguments, handling Windowz variants
50
-
51
- if not "%OS%" == "Windows_NT" goto win9xME_args
52
- if "%@eval[2+2]" == "4" goto 4NT_args
53
-
54
- :win9xME_args
55
- @rem Slurp the command line arguments.
56
- set CMD_LINE_ARGS=
57
- set _SKIP=2
58
-
59
- :win9xME_args_slurp
60
- if "x%~1" == "x" goto execute
61
-
62
- set CMD_LINE_ARGS=%*
63
- goto execute
64
-
65
- :4NT_args
66
- @rem Get arguments from the 4NT Shell from JP Software
67
- set CMD_LINE_ARGS=%$
68
-
69
- :execute
70
- @rem Setup the command line
71
-
72
- set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73
-
74
- @rem Execute Gradle
75
- "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76
-
77
- :end
78
- @rem End local scope for the variables with windows NT shell
79
- if "%ERRORLEVEL%"=="0" goto mainEnd
80
-
81
- :fail
82
- rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83
- rem the _cmd.exe /c_ return code!
84
- if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85
- exit /b 1
86
-
87
- :mainEnd
88
- if "%OS%"=="Windows_NT" endlocal
89
-
90
- :omega
1
+ @rem
2
+ @rem Copyright 2015 the original author or authors.
3
+ @rem
4
+ @rem Licensed under the Apache License, Version 2.0 (the "License");
5
+ @rem you may not use this file except in compliance with the License.
6
+ @rem You may obtain a copy of the License at
7
+ @rem
8
+ @rem https://www.apache.org/licenses/LICENSE-2.0
9
+ @rem
10
+ @rem Unless required by applicable law or agreed to in writing, software
11
+ @rem distributed under the License is distributed on an "AS IS" BASIS,
12
+ @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ @rem See the License for the specific language governing permissions and
14
+ @rem limitations under the License.
15
+ @rem
16
+
17
+ @if "%DEBUG%"=="" @echo off
18
+ @rem ##########################################################################
19
+ @rem
20
+ @rem Gradle startup script for Windows
21
+ @rem
22
+ @rem ##########################################################################
23
+
24
+ @rem Set local scope for the variables with windows NT shell
25
+ if "%OS%"=="Windows_NT" setlocal
26
+
27
+ set DIRNAME=%~dp0
28
+ if "%DIRNAME%"=="" set DIRNAME=.
29
+ @rem This is normally unused
30
+ set APP_BASE_NAME=%~n0
31
+ set APP_HOME=%DIRNAME%
32
+
33
+ @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34
+ for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35
+
36
+ @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37
+ set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38
+
39
+ @rem Find java.exe
40
+ if defined JAVA_HOME goto findJavaFromJavaHome
41
+
42
+ set JAVA_EXE=java.exe
43
+ %JAVA_EXE% -version >NUL 2>&1
44
+ if %ERRORLEVEL% equ 0 goto execute
45
+
46
+ echo.
47
+ echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48
+ echo.
49
+ echo Please set the JAVA_HOME variable in your environment to match the
50
+ echo location of your Java installation.
51
+
52
+ goto fail
53
+
54
+ :findJavaFromJavaHome
55
+ set JAVA_HOME=%JAVA_HOME:"=%
56
+ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57
+
58
+ if exist "%JAVA_EXE%" goto execute
59
+
60
+ echo.
61
+ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62
+ echo.
63
+ echo Please set the JAVA_HOME variable in your environment to match the
64
+ echo location of your Java installation.
65
+
66
+ goto fail
67
+
68
+ :execute
69
+ @rem Setup the command line
70
+
71
+ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72
+
73
+
74
+ @rem Execute Gradle
75
+ "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76
+
77
+ :end
78
+ @rem End local scope for the variables with windows NT shell
79
+ if %ERRORLEVEL% equ 0 goto mainEnd
80
+
81
+ :fail
82
+ rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83
+ rem the _cmd.exe /c_ return code!
84
+ set EXIT_CODE=%ERRORLEVEL%
85
+ if %EXIT_CODE% equ 0 set EXIT_CODE=1
86
+ if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87
+ exit /b %EXIT_CODE%
88
+
89
+ :mainEnd
90
+ if "%OS%"=="Windows_NT" endlocal
91
+
92
+ :omega
@@ -33,5 +33,6 @@ if (hasProperty('project')) {
33
33
  isRN70OrHigher: rnMajorVer >= 70,
34
34
  isRN71OrHigher: rnMajorVer >= 71,
35
35
  isRN72OrHigher: rnMajorVer >= 72,
36
+ isRN73OrHigher: rnMajorVer >= 73,
36
37
  ]
37
38
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "detox",
3
3
  "description": "E2E tests and automation for mobile",
4
- "version": "20.17.1",
4
+ "version": "20.18.1",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -34,8 +34,10 @@
34
34
  "postinstall": "node scripts/postinstall.js"
35
35
  },
36
36
  "devDependencies": {
37
- "@react-native/eslint-config": "^0.72.2",
38
- "@react-native/metro-config": "^0.72.11",
37
+ "@react-native/babel-preset": "0.73.19",
38
+ "@react-native/eslint-config": "^0.73.2",
39
+ "@react-native/metro-config": "^0.73.3",
40
+ "@react-native/typescript-config": "0.73.1",
39
41
  "@tsconfig/react-native": "^3.0.0",
40
42
  "@types/bunyan": "^1.8.8",
41
43
  "@types/child-process-promise": "^2.2.1",
@@ -53,11 +55,11 @@
53
55
  "eslint-plugin-no-only-tests": "^3.1.0",
54
56
  "eslint-plugin-node": "^11.1.0",
55
57
  "eslint-plugin-unicorn": "^50.0.1",
56
- "jest": "^29.0.0",
57
- "jest-allure2-reporter": "^2.0.0-beta.4",
58
+ "jest": "^29.6.3",
59
+ "jest-allure2-reporter": "^2.0.0-beta.5",
58
60
  "metro-react-native-babel-preset": "0.76.8",
59
61
  "prettier": "^3.1.1",
60
- "react-native": "0.72.8",
62
+ "react-native": "0.73.2",
61
63
  "react-native-codegen": "^0.0.8",
62
64
  "typescript": "^5.3.3",
63
65
  "wtfnode": "^0.9.1"
@@ -108,10 +110,10 @@
108
110
  }
109
111
  },
110
112
  "engines": {
111
- "node": ">=16"
113
+ "node": ">=18"
112
114
  },
113
115
  "browserslist": [
114
- "node 16"
116
+ "node 18"
115
117
  ],
116
- "gitHead": "779b8cc2a44e5153c458471e42ac776d5ab15193"
118
+ "gitHead": "546d07f565b399b149ded11f511ee53ccd7cabee"
117
119
  }
@@ -64,7 +64,8 @@ class DetoxCircusEnvironment extends WithEmitter(NodeEnvironment) {
64
64
  WorkerAssignReporter,
65
65
  });
66
66
 
67
- this.testEvents.on('*', this._onTestEvent.bind(this));
67
+ // Artifacts flushing should be delayed to avoid conflicts with third-party reporters
68
+ this.testEvents.on('*', this._onTestEvent.bind(this), 1e6);
68
69
  }
69
70
 
70
71
  /** @override */
@@ -1,5 +1,8 @@
1
+ const { setGradleVersionByRNVersion } = require('./updateGradle');
1
2
  if (process.platform === 'darwin' && !process.env.DETOX_DISABLE_POSTINSTALL) {
2
3
  require('child_process').execFileSync(`${__dirname}/build_framework.ios.sh`, {
3
4
  stdio: 'inherit'
4
5
  });
6
+
5
7
  }
8
+ setGradleVersionByRNVersion();
@@ -0,0 +1,47 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const rnMinor = require('../src/utils/rn-consts/rn-consts').rnVersion.minor;
5
+
6
+ function getGradleVersionByRNVersion() {
7
+ switch (rnMinor) {
8
+ default:
9
+ return '8.3';
10
+ case '72':
11
+ return '8.0';
12
+ case '71':
13
+ return '7.6.1';
14
+ }
15
+ }
16
+
17
+ /**
18
+ * Update the Gradle wrapper to the version that matches the React Native version.
19
+ */
20
+ function setGradleVersionByRNVersion() {
21
+ const gradleVersion = getGradleVersionByRNVersion();
22
+ updateGradleWrapperSync(gradleVersion);
23
+ }
24
+
25
+ /**
26
+ * Update the Gradle wrapper to the specified version.
27
+ *
28
+ * @param {string} newVersion - the new Gradle wrapper version
29
+ */
30
+ function updateGradleWrapperSync(newVersion) {
31
+ const gradleWrapperPath = path.join(process.cwd(), 'android', 'gradle', 'wrapper', 'gradle-wrapper.properties');
32
+ console.log(`Updating Gradle wrapper to version${newVersion}. File: ${gradleWrapperPath}`);
33
+
34
+ try {
35
+ let data = fs.readFileSync(gradleWrapperPath, 'utf8');
36
+ let updatedData = data.replace(/distributionUrl=.+\n/, `distributionUrl=https\\://services.gradle.org/distributions/gradle-${newVersion}-bin.zip\n`);
37
+
38
+ fs.writeFileSync(gradleWrapperPath, updatedData, 'utf8');
39
+ console.log(`Gradle wrapper updated successfully to version ${newVersion}.`);
40
+ } catch (err) {
41
+ console.error('Error:', err);
42
+ }
43
+ }
44
+
45
+ module.exports = {
46
+ setGradleVersionByRNVersion
47
+ };
@@ -216,7 +216,6 @@ class DetoxAction {
216
216
  }
217
217
 
218
218
  static adjustSliderToPosition(newPosition) {
219
- if (typeof newPosition !== "number") throw new Error("newPosition should be a number, but got " + (newPosition + (" (" + (typeof newPosition + ")"))));
220
219
  return {
221
220
  target: {
222
221
  type: "Class",
@@ -224,7 +223,7 @@ class DetoxAction {
224
223
  },
225
224
  method: "adjustSliderToPosition",
226
225
  args: [{
227
- type: "Double",
226
+ type: "Float",
228
227
  value: newPosition
229
228
  }]
230
229
  };
@@ -51,6 +51,7 @@ class IosUIHierarchyPlugin extends ArtifactPlugin {
51
51
  if (this.enabled) {
52
52
  const scope = this.context.testSummary ? 'perTest' : 'perSession';
53
53
  setUniqueProperty(this._artifacts[scope], name, artifact);
54
+ this.api.trackArtifact(artifact);
54
55
  } else {
55
56
  this._pendingDeletions.push(artifact.discard());
56
57
  }
@@ -97,6 +98,7 @@ class IosUIHierarchyPlugin extends ArtifactPlugin {
97
98
  .map(async ([key, artifact]) => {
98
99
  const destination = await this.api.preparePathForArtifact(`${key}.viewhierarchy`, testSummary);
99
100
  await artifact.save(destination);
101
+ this.api.untrackArtifact(artifact);
100
102
  })
101
103
  .value();
102
104
 
@@ -0,0 +1,15 @@
1
+ const rnVersion = (function parseRNVersion() {
2
+ const packageJson = require('react-native/package.json');
3
+ const raw = packageJson.version;
4
+ const [major, minor, patch] = raw.split('.');
5
+ return {
6
+ major,
7
+ minor,
8
+ patch,
9
+ raw,
10
+ };
11
+ })();
12
+
13
+ module.exports = {
14
+ rnVersion,
15
+ };
@@ -1 +0,0 @@
1
- 092d6d94786ab5be89045a942a642645
@@ -1 +0,0 @@
1
- 22e8033020f38c811ecac466bca97b4568dfe4ce
@@ -1 +0,0 @@
1
- 69e007a7d465eeb5ce62ccdb717b2eebc310cec8275e2bda44fc0a46d75146d6
@@ -1 +0,0 @@
1
- c60752cb4f232d29b34bd9be1a80659c30a2abf13e9e14f99b9554271b4d8ed7d615ca29ed854f01a30e6d3cf105d9a05958856831cbd3f994638cfde80ae8f2
@@ -1 +0,0 @@
1
- ff4aba12ca3a8aba0134a72a4aecc112
@@ -1 +0,0 @@
1
- a447debb37f1098e3cc01e3a0e8d9389c2063b3e
@@ -1 +0,0 @@
1
- a3df3f6f6242d27b067057f2c43ee0a0ce324f253fd35f9022ad154fb29417ad
@@ -1 +0,0 @@
1
- 229287ea69973a935717a40225e16046e52fa0c55a7c33d9f21777d4038cfb1e2d5835bda1e5f10ac443e984a0ccb60a2ec2fbb9581c458c4e997e6e21379e3d
@@ -1 +0,0 @@
1
- cbf6fdff7b21720bd0d4233470855e61
@@ -1 +0,0 @@
1
- b94fb7d24ad48c522b39356c2571f528c7558f6d
@@ -1 +0,0 @@
1
- b287b96336bda839a223ecd80cecfcfd35c54169f1e5785d371ccf37f02a517d
@@ -1 +0,0 @@
1
- f8aae72e64396f3e405b10639bfd56d6a189c56895056821194b0eea05e72e0ba5374853845e22a478429acd0e7dd446b18f3c5a58add3d758bd21490b87e7aa
@@ -1 +0,0 @@
1
- 477c6a72a0144b06450f446c8c797a47
@@ -1 +0,0 @@
1
- 0d1e66d33f5da006c1401c1fc8a6a61567b4669b
@@ -1 +0,0 @@
1
- 967ccdbc40ae218473f0cdfe8890e905c9e9a7ba97113f2955fc7cb440be8b87
@@ -1 +0,0 @@
1
- ecd08351fed3bf2b4efb37cc66c5d7bdc16b9d3dc78fae59cdeb3394d30e8c3916ee9f071dadb022904f4408f4dd1852b0b16afd51778afefd357f3a28362220