detox 20.18.4 → 20.18.6-smoke.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/Detox-ios-src.tbz +0 -0
  2. package/Detox-ios.tbz +0 -0
  3. package/android/build.gradle +4 -4
  4. package/android/detox/build.gradle +23 -3
  5. package/android/detox/proguard-rules-app.pro +4 -0
  6. package/android/detox/proguard-rules.pro +3 -0
  7. package/android/detox/publishing.gradle +8 -3
  8. package/android/detox/src/full/java/com/wix/detox/espresso/DetoxAction.java +1 -1
  9. package/android/detox/src/full/java/com/wix/detox/espresso/action/AdjustSliderToPositionAction.kt +1 -1
  10. package/android/detox/src/full/java/com/wix/detox/espresso/common/ReactSliderHelper.kt +6 -6
  11. package/android/detox/src/testFull/java/com/wix/detox/adapters/server/QueryStatusActionHandlerSpec.kt +12 -10
  12. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  13. package/android/gradle/wrapper/gradle-wrapper.properties +3 -3
  14. package/android/gradlew +24 -9
  15. package/android/gradlew.bat +92 -90
  16. package/android/rninfo.gradle +1 -0
  17. package/package.json +5 -5
  18. package/scripts/postinstall.js +3 -0
  19. package/scripts/updateGradle.js +47 -0
  20. package/src/android/espressoapi/DetoxAction.js +1 -2
  21. package/src/client/Client.js +1 -6
  22. package/src/devices/allocation/drivers/android/genycloud/exec/GenyCloudExec.js +4 -0
  23. package/src/devices/allocation/drivers/android/genycloud/services/GenyAuthService.js +12 -0
  24. package/src/devices/validation/android/GenycloudEnvValidator.js +12 -1
  25. package/src/devices/validation/factories/index.js +4 -1
  26. package/src/utils/rn-consts/rn-consts.js +15 -0
  27. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-javadoc.jar +0 -0
  28. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-javadoc.jar.md5 +0 -1
  29. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-javadoc.jar.sha1 +0 -1
  30. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-javadoc.jar.sha256 +0 -1
  31. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-javadoc.jar.sha512 +0 -1
  32. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-sources.jar +0 -0
  33. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-sources.jar.md5 +0 -1
  34. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-sources.jar.sha1 +0 -1
  35. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-sources.jar.sha256 +0 -1
  36. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4-sources.jar.sha512 +0 -1
  37. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.aar +0 -0
  38. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.aar.md5 +0 -1
  39. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.aar.sha1 +0 -1
  40. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.aar.sha256 +0 -1
  41. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.aar.sha512 +0 -1
  42. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.pom +0 -100
  43. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.pom.md5 +0 -1
  44. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.pom.sha1 +0 -1
  45. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.pom.sha256 +0 -1
  46. package/Detox-android/com/wix/detox/20.18.4/detox-20.18.4.pom.sha512 +0 -1
  47. package/Detox-android/com/wix/detox/maven-metadata.xml +0 -13
  48. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +0 -1
  49. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +0 -1
  50. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +0 -1
  51. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +0 -1
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.**
@@ -3,6 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'org.jetbrains.dokka'
4
4
  apply plugin: 'signing'
5
5
  apply from: './publish-pom.gradle'
6
+ apply from: '../rninfo.gradle'
6
7
 
7
8
  String TARGET_LOCAL_DIR = "$buildDir/../../../Detox-android"
8
9
  String TARGET_MAVEN_CENTRAL_URL = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
@@ -180,7 +181,11 @@ publishing {
180
181
 
181
182
  "maven${variantNameCapitalized}Aar"(MavenPublication) {
182
183
  groupId 'com.wix'
183
- artifactId 'detox'
184
+ if (rnInfo.isRN72OrHigher) {
185
+ artifactId 'detox'
186
+ } else {
187
+ artifactId 'detox-legacy'
188
+ }
184
189
  version "$_versionName"
185
190
 
186
191
  // Register built .aar as published artifact (as a file, explicitly)
@@ -193,11 +198,11 @@ publishing {
193
198
 
194
199
  // Register sources, javadoc as published artifacts (via equivalent tasks' output)
195
200
  artifact sourcesJar
196
- artifact dokkaDocJar
201
+ //artifact dokkaDocJar // waiting for dokka to fix https://github.com/Kotlin/dokka/issues/3153
197
202
 
198
203
  // Also register source, javadoc as archive-artifacts, for signing
199
204
  declareArchive sourcesJar
200
- declareArchive dokkaDocJar
205
+ //declareArchive dokkaDocJar // waiting for dokka to fix https://github.com/Kotlin/dokka/issues/3153
201
206
 
202
207
  // Add detox package metadata to the .pom
203
208
  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.18.4",
4
+ "version": "20.18.6-smoke.0",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -59,7 +59,7 @@
59
59
  "jest-allure2-reporter": "^2.0.0-beta.9",
60
60
  "metro-react-native-babel-preset": "0.76.8",
61
61
  "prettier": "^3.1.1",
62
- "react-native": "0.72.8",
62
+ "react-native": "0.73.2",
63
63
  "react-native-codegen": "^0.0.8",
64
64
  "typescript": "^5.3.3",
65
65
  "wtfnode": "^0.9.1"
@@ -110,10 +110,10 @@
110
110
  }
111
111
  },
112
112
  "engines": {
113
- "node": ">=16"
113
+ "node": ">=18"
114
114
  },
115
115
  "browserslist": [
116
- "node 16"
116
+ "node 18"
117
117
  ],
118
- "gitHead": "a97c48d0d380de88f9279f5fe03be947e3fb2cd6"
118
+ "gitHead": "635cd060a31f1e9bda2f9633a8a78669d354e43a"
119
119
  }
@@ -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
  };
@@ -137,10 +137,6 @@ class Client {
137
137
  }
138
138
 
139
139
  async sendAction(action) {
140
- if (this._pendingAppCrash) {
141
- throw this._pendingAppCrash;
142
- }
143
-
144
140
  const { shouldQueryStatus, ...options } = this._inferSendOptions(action);
145
141
 
146
142
  return await (shouldQueryStatus
@@ -306,8 +302,6 @@ class Client {
306
302
  }
307
303
 
308
304
  _onAppConnected() {
309
- this._pendingAppCrash = null;
310
-
311
305
  if (this._whenAppIsConnected.isPending()) {
312
306
  this._whenAppIsConnected.resolve();
313
307
  } else {
@@ -358,6 +352,7 @@ class Client {
358
352
  if (this._pendingAppCrash) {
359
353
  this._whenAppDisconnected.reject(this._pendingAppCrash);
360
354
  this._asyncWebSocket.rejectAll(this._pendingAppCrash);
355
+ this._pendingAppCrash = null;
361
356
  } else if (this._asyncWebSocket.hasPendingActions()) {
362
357
  const error = new DetoxRuntimeError('The app has unexpectedly disconnected from Detox server.');
363
358
  this._asyncWebSocket.rejectAll(error);
@@ -11,6 +11,10 @@ class GenyCloudExec {
11
11
  return this._exec('--version');
12
12
  }
13
13
 
14
+ whoAmI() {
15
+ return this._exec('auth whoami');
16
+ }
17
+
14
18
  getRecipe(name) {
15
19
  return this._exec(`recipes list --name "${name}"`);
16
20
  }
@@ -0,0 +1,12 @@
1
+ class GenyAuthService {
2
+ constructor(genyCloudExec) {
3
+ this.genyCloudExec = genyCloudExec;
4
+ }
5
+
6
+ async getLoginEmail() {
7
+ const whoAmI = await this.genyCloudExec.whoAmI();
8
+ return whoAmI.auth.email;
9
+ }
10
+ }
11
+
12
+ module.exports = GenyAuthService;
@@ -12,13 +12,15 @@ class GenycloudEnvValidator extends EnvironmentValidatorBase {
12
12
  * @param authService { GenyAuthService }
13
13
  * @param exec { GenyCloudExec }
14
14
  */
15
- constructor({ exec }) {
15
+ constructor({ authService, exec }) {
16
16
  super();
17
+ this._authService = authService;
17
18
  this._exec = exec;
18
19
  }
19
20
 
20
21
  async validate() {
21
22
  await this._validateGmsaasVersion();
23
+ await this._validateGmsaasAuth();
22
24
  }
23
25
 
24
26
  async _validateGmsaasVersion() {
@@ -30,6 +32,15 @@ class GenycloudEnvValidator extends EnvironmentValidatorBase {
30
32
  });
31
33
  }
32
34
  }
35
+
36
+ async _validateGmsaasAuth() {
37
+ if (!await this._authService.getLoginEmail()) {
38
+ throw new DetoxRuntimeError({
39
+ message: `Cannot run tests using 'android.genycloud' type devices, because Genymotion was not logged-in to!`,
40
+ hint: `Log-in to Genymotion-cloud by running this command (and following instructions):\n${environment.getGmsaasPath()} auth login --help`,
41
+ });
42
+ }
43
+ }
33
44
  }
34
45
 
35
46
  module.exports = GenycloudEnvValidator;
@@ -7,8 +7,11 @@ class Genycloud extends EnvValidatorFactory {
7
7
  const serviceLocator = require('../../servicelocator/android');
8
8
  const exec = serviceLocator.genycloud.exec;
9
9
 
10
+ const GenyAuthService = require('../../allocation/drivers/android/genycloud/services/GenyAuthService');
11
+ const authService = new GenyAuthService(exec);
12
+
10
13
  const GenycloudEnvValidator = require('../android/GenycloudEnvValidator');
11
- return new GenycloudEnvValidator({ exec });
14
+ return new GenycloudEnvValidator({ authService, exec });
12
15
  }
13
16
  }
14
17
 
@@ -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
- 598577281aea38f70a9e67c1e00d257f
@@ -1 +0,0 @@
1
- 7dbacc65f88e63e407d32e55b7b8064a7e0e851a
@@ -1 +0,0 @@
1
- d3c41506d8afb1de2a96f07460193671a96f8c729ec5adb5494480c2bad7ca2b
@@ -1 +0,0 @@
1
- 4ef96abd9d6748158e1276077d90cdd63923f77c1a4d09d35c47a744b8c9a6527a7950159d703dd2da3b9c4c6d772dc1a6669a1d5969df81976770d708f83f83
@@ -1 +0,0 @@
1
- 6c3734f87e56e74432e2b7a490544973
@@ -1 +0,0 @@
1
- 08a43eba132a215b981b921e68a627e77505df8d
@@ -1 +0,0 @@
1
- 0f017b4d96966c526dcb4301ac1ed2197dbcdd741eefdd9565cf066c510dda6e
@@ -1 +0,0 @@
1
- d7c1dd7281b3610f383d12d4890236f0992d0d46a6f9906f83626c7fe9614176c18297b75d5f4562464fa4298a89a24e5aa44efc813782e3f9a155334c084286
@@ -1 +0,0 @@
1
- 5189a7f74b7302ce8ade78313f99ad47
@@ -1 +0,0 @@
1
- 9a22d7c4dc49f66daa19658b66f748c94e0d26fe
@@ -1 +0,0 @@
1
- c0635d01a3e13c0c93853465b5649fb017c2d6f12faf10d5e3020f526535f6ba
@@ -1 +0,0 @@
1
- a684ad5165eb6d0ba717fa353ecdec5624393acbec3b2a5cb193a6fcdf5b6a2d34512d7812ec73347b15e1ec70118ec994a381c3df9609c6aa46b5c4cfd4a186
@@ -1,100 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
- <modelVersion>4.0.0</modelVersion>
4
- <groupId>com.wix</groupId>
5
- <artifactId>detox</artifactId>
6
- <version>20.18.4</version>
7
- <packaging>aar</packaging>
8
- <name>Detox</name>
9
- <description>Gray box end-to-end testing and automation library for mobile apps</description>
10
- <url>https://github.com/wix/Detox</url>
11
- <licenses>
12
- <license>
13
- <name>The MIT License</name>
14
- <url>https://github.com/wix/Detox/blob/master/LICENSE</url>
15
- </license>
16
- </licenses>
17
- <developers>
18
- <developer>
19
- <name>WixMobile</name>
20
- <email>mobile1@wix.com</email>
21
- </developer>
22
- <developer>
23
- <name>d4vidi</name>
24
- <email>amitd@wix.com</email>
25
- </developer>
26
- </developers>
27
- <scm>
28
- <connection>scm:git:git://github.com/wix/detox.git</connection>
29
- <developerConnection>scm:git:git@github.com/wix/detox.git</developerConnection>
30
- <url>https://github.com/wix/detox</url>
31
- </scm>
32
- <dependencies>
33
- <dependency>
34
- <groupId>androidx.test.espresso</groupId>
35
- <artifactId>espresso-core</artifactId>
36
- <version>3.5.1</version>
37
- <scope>compile</scope>
38
- </dependency>
39
- <dependency>
40
- <groupId>androidx.test.espresso</groupId>
41
- <artifactId>espresso-web</artifactId>
42
- <version>3.5.1</version>
43
- <scope>compile</scope>
44
- </dependency>
45
- <dependency>
46
- <groupId>androidx.test.espresso</groupId>
47
- <artifactId>espresso-contrib</artifactId>
48
- <version>3.5.1</version>
49
- <scope>compile</scope>
50
- <exclusions>
51
- <exclusion>
52
- <groupId>org.checkerframework</groupId>
53
- <artifactId>checker</artifactId>
54
- </exclusion>
55
- </exclusions>
56
- </dependency>
57
- <dependency>
58
- <groupId>org.hamcrest</groupId>
59
- <artifactId>hamcrest</artifactId>
60
- <version>2.2</version>
61
- <scope>compile</scope>
62
- </dependency>
63
- <dependency>
64
- <groupId>androidx.test</groupId>
65
- <artifactId>rules</artifactId>
66
- <version>1.5.0</version>
67
- <scope>compile</scope>
68
- </dependency>
69
- <dependency>
70
- <groupId>androidx.test.ext</groupId>
71
- <artifactId>junit</artifactId>
72
- <version>1.1.5</version>
73
- <scope>compile</scope>
74
- </dependency>
75
- <dependency>
76
- <groupId>androidx.test.uiautomator</groupId>
77
- <artifactId>uiautomator</artifactId>
78
- <version>2.2.0</version>
79
- <scope>compile</scope>
80
- </dependency>
81
- <dependency>
82
- <groupId>org.jetbrains.kotlin</groupId>
83
- <artifactId>kotlin-stdlib-jdk8</artifactId>
84
- <version>1.2.0</version>
85
- <scope>runtime</scope>
86
- </dependency>
87
- <dependency>
88
- <groupId>org.apache.commons</groupId>
89
- <artifactId>commons-lang3</artifactId>
90
- <version>3.7</version>
91
- <scope>runtime</scope>
92
- </dependency>
93
- <dependency>
94
- <groupId>com.github.anrwatchdog</groupId>
95
- <artifactId>anrwatchdog</artifactId>
96
- <version>1.4.0</version>
97
- <scope>runtime</scope>
98
- </dependency>
99
- </dependencies>
100
- </project>
@@ -1 +0,0 @@
1
- 3036ff10bd5db931f19dc6b326ccf5c7
@@ -1 +0,0 @@
1
- 02cbeb2be2fd7f2241dc5506e4885ac5e0403a43
@@ -1 +0,0 @@
1
- 9ded1ca586441098ae6408c6b3f59ffa82b133aa7ad8eb197d93f4f1539adf2c
@@ -1 +0,0 @@
1
- 0f3ae7213853c4805880ad582e83091f3349e86ff619151e87204c1053669487bde8ccd2d6de626bfdfe54187a3ef86235e1656f80202fdbe66319a156de49c5
@@ -1,13 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <metadata>
3
- <groupId>com.wix</groupId>
4
- <artifactId>detox</artifactId>
5
- <versioning>
6
- <latest>20.18.4</latest>
7
- <release>20.18.4</release>
8
- <versions>
9
- <version>20.18.4</version>
10
- </versions>
11
- <lastUpdated>20240301084037</lastUpdated>
12
- </versioning>
13
- </metadata>
@@ -1 +0,0 @@
1
- 8423955640e5f80a40cdec6fdcd33575
@@ -1 +0,0 @@
1
- 1a7ae4cf3d5fbb91b0c594798e22534ad5c07f16
@@ -1 +0,0 @@
1
- 2cca1d6cd51a495891e6a99bc2cc816ae65c5d3db3976e8c6239eae861e562dd
@@ -1 +0,0 @@
1
- a221a7d31eb5388b9644f5a0a0bff7710d68bc9258a02d9185c81ec379809bee27428cc84d4f211489ab42627e1c3fce69de127412e8ece67d006ff0c042b7fc