detox 19.8.4 → 19.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/Detox-android/com/wix/detox/{19.8.4/detox-19.8.4-javadoc.jar → 19.9.2/detox-19.9.2-javadoc.jar} +0 -0
  2. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2-javadoc.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2-javadoc.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2-javadoc.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2-javadoc.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{19.8.4/detox-19.8.4-sources.jar → 19.9.2/detox-19.9.2-sources.jar} +0 -0
  7. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2-sources.jar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2-sources.jar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2-sources.jar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2-sources.jar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{19.8.4/detox-19.8.4.aar → 19.9.2/detox-19.9.2.aar} +0 -0
  12. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2.aar.md5 +1 -0
  13. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2.aar.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2.aar.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2.aar.sha512 +1 -0
  16. package/Detox-android/com/wix/detox/{19.8.4/detox-19.8.4.pom → 19.9.2/detox-19.9.2.pom} +1 -1
  17. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2.pom.md5 +1 -0
  18. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2.pom.sha1 +1 -0
  19. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2.pom.sha256 +1 -0
  20. package/Detox-android/com/wix/detox/19.9.2/detox-19.9.2.pom.sha512 +1 -0
  21. package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
  22. package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
  23. package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
  24. package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
  25. package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
  26. package/Detox-ios-src.tbz +0 -0
  27. package/Detox-ios.tbz +0 -0
  28. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/uimodule/RN66Workaround.kt +13 -4
  29. package/package.json +2 -2
  30. package/src/artifacts/timeline/TimelineArtifactPlugin.js +9 -4
  31. package/src/devices/allocation/drivers/android/genycloud/GenyAllocDriver.js +1 -0
  32. package/src/devices/common/drivers/android/exec/ADB.js +5 -0
  33. package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +3 -1
  34. package/src/utils/ChromeTracingExporter.js +6 -5
  35. package/src/utils/environment.js +30 -15
  36. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-javadoc.jar.md5 +0 -1
  37. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-javadoc.jar.sha1 +0 -1
  38. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-javadoc.jar.sha256 +0 -1
  39. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-javadoc.jar.sha512 +0 -1
  40. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-sources.jar.md5 +0 -1
  41. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-sources.jar.sha1 +0 -1
  42. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-sources.jar.sha256 +0 -1
  43. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4-sources.jar.sha512 +0 -1
  44. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar.md5 +0 -1
  45. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar.sha1 +0 -1
  46. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar.sha256 +0 -1
  47. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.aar.sha512 +0 -1
  48. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.pom.md5 +0 -1
  49. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.pom.sha1 +0 -1
  50. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.pom.sha256 +0 -1
  51. package/Detox-android/com/wix/detox/19.8.4/detox-19.8.4.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ 445b3420c7150f8bea0a85311a33315d
@@ -0,0 +1 @@
1
+ 42e5208f60f7384b0d367a11633d05e0c89bb02a
@@ -0,0 +1 @@
1
+ 1bb7381a2ffda512bb2f1d3704381cf59e323cd8f7c61de46270f1e419ad8357
@@ -0,0 +1 @@
1
+ 10576a45ba33b66912fd02cb19337b47719c2ce7c0f2234f03fd8c9ce93f31ef8e5f684d3539677a39d6b8472c0cb027fa31db4ab2863aa89ee5d42f468078c4
@@ -0,0 +1 @@
1
+ 4cfde044c88da921818ab32db0493e6d
@@ -0,0 +1 @@
1
+ a8f1e5c74446f6e7571861d1987ab839c4829559
@@ -0,0 +1 @@
1
+ a25dcc79498abea1edfe6827b7ffd85b320318f47a1ec2310c56c3c9a0dcbd3c
@@ -0,0 +1 @@
1
+ 823c23be31da691a931ee32d96845dc22eb7598366728c240b6457b88b541e03a0bfffc629a56906a8c12ee99d261fa761d519717b089c1b0c291800fd5bee63
@@ -0,0 +1 @@
1
+ f00a26db2932c0f5dd9e4ea695c5f55c
@@ -0,0 +1 @@
1
+ 39dba13a0e694adb108fc6bb4d15b58b21a4eed5
@@ -0,0 +1 @@
1
+ c9897fd212cfefb379527e059f6f29a94f29c4681b3659e26f8f08b22e20d1ea
@@ -0,0 +1 @@
1
+ f12faacdbbcf214aba48971b1054310eca06c2a69d403404376b087d86beb76345e383bc6d452f6af8ec25b050895700bd930f8a33c9439153a972a179b3c763
@@ -3,7 +3,7 @@
3
3
  <modelVersion>4.0.0</modelVersion>
4
4
  <groupId>com.wix</groupId>
5
5
  <artifactId>detox</artifactId>
6
- <version>19.8.4</version>
6
+ <version>19.9.2</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
+ 4349454740407bfe0a84123f722d4c50
@@ -0,0 +1 @@
1
+ 54d373ae29b5c1c51a5c284026dcfea431c5c40b
@@ -0,0 +1 @@
1
+ f3d3d79f0ee51a1b60535c305ceaac120dcf8a3662b2731a760b3914c925e7a3
@@ -0,0 +1 @@
1
+ a4ed018382a78e1cd3b68380244b7610384f5ff9b0891cc992af2c43052012e6728004a6d629dd5e257005e03a15e54373549e0b9cb28d07d68e4669275f43f2
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>19.8.4</latest>
7
- <release>19.8.4</release>
6
+ <latest>19.9.2</latest>
7
+ <release>19.9.2</release>
8
8
  <versions>
9
- <version>19.8.4</version>
9
+ <version>19.9.2</version>
10
10
  </versions>
11
- <lastUpdated>20220727140215</lastUpdated>
11
+ <lastUpdated>20220814171948</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- c501ff858a7bb71d219fa1e0504ac399
1
+ 599c8ee4cd5b6c0a76e4e6587929371c
@@ -1 +1 @@
1
- 418f60ae638bc1cf710675ae55dfedfb4a5705a2
1
+ c933b6a10c3326641f2f4f67d105d6c25546092f
@@ -1 +1 @@
1
- 4be1847db0453c931c85f1e489b98839b139e7a7f1cf0a261735d2ba594a0830
1
+ 2ef5136da194e277ca17be542f43edcc8b6eb5a36cf6359dbb7fa2a669721cd6
@@ -1 +1 @@
1
- b5ed6a0e3a4116823cd62582a4bfd638beffbf4400bb5338f882da0ef102ed9c3892df6bc8e963ba94b559d384c25533da0d4e053068aadeee81fa124d94df4e
1
+ 738f2da22dc48e931699662eb116096506ad79b14583a9323b61ff369a19dec46f07033a5752593b20eb6d1123e3fcf35c9201cc74c4c2f0d9207084f7db5f4f
package/Detox-ios-src.tbz CHANGED
Binary file
package/Detox-ios.tbz CHANGED
Binary file
@@ -2,6 +2,7 @@ package com.wix.detox.reactnative.idlingresources.uimodule
2
2
 
3
3
  import android.util.Log
4
4
  import android.view.View
5
+ import com.facebook.react.uimanager.IllegalViewOperationException
5
6
  import com.wix.detox.common.DetoxLog.Companion.LOG_TAG
6
7
  import com.wix.detox.reactnative.ReactNativeInfo
7
8
  import java.lang.ref.WeakReference
@@ -19,9 +20,7 @@ class RN66Workaround {
19
20
  fun isScarceUISwitchCommandStuckInQueue(uiManagerModuleReflected: UIManagerModuleReflected): Boolean {
20
21
  var isStuckSwitchOperation = false
21
22
 
22
- val rnVersion = ReactNativeInfo.rnVersion()
23
-
24
- if (rnVersion.minor >= 66 && uiManagerModuleReflected.getUIOpsCount() >= 1) {
23
+ if (isRelevantRNVersion() && uiManagerModuleReflected.getUIOpsCount() >= 1) {
25
24
  val nextUIOperation = uiManagerModuleReflected.getNextUIOpReflected()
26
25
  val view = getUIOpView(uiManagerModuleReflected, nextUIOperation)
27
26
  val isReactSwitch = isReactSwitch(view)
@@ -46,10 +45,20 @@ class RN66Workaround {
46
45
  return isStuckSwitchOperation
47
46
  }
48
47
 
48
+ private fun isRelevantRNVersion(): Boolean {
49
+ val rnVersion = ReactNativeInfo.rnVersion()
50
+ return rnVersion.minor == 66 || (rnVersion.minor == 67 && rnVersion.patch < 4)
51
+ }
52
+
49
53
  private fun getUIOpView(uiManagerModuleReflected: UIManagerModuleReflected, uiOperation: DispatchCommandOperationReflected?): View? {
50
54
  val nativeViewHierarchyManager = uiManagerModuleReflected.nativeViewHierarchyManager() ?: return null
51
55
  val tag = uiOperation?.tag ?: return null
52
- return nativeViewHierarchyManager.getViewClass(tag)
56
+ return try {
57
+ nativeViewHierarchyManager.getViewClass(tag)
58
+ } catch(e: IllegalViewOperationException) {
59
+ Log.e(LOG_TAG, "failed to get view from tag ", e.cause)
60
+ null
61
+ }
53
62
  }
54
63
 
55
64
  private fun isReactSwitch(view: View?) = try {
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": "19.8.4",
4
+ "version": "19.9.2",
5
5
  "bin": {
6
6
  "detox": "local-cli/cli.js"
7
7
  },
@@ -177,5 +177,5 @@
177
177
  }
178
178
  }
179
179
  },
180
- "gitHead": "9229e64ec8f95574aab5beeeb4fa6bcc84844f69"
180
+ "gitHead": "4427cebefaee0119ec757e18238be088f6c8ed99"
181
181
  }
@@ -12,6 +12,11 @@ const traceNoop = {
12
12
  endSection: _noop,
13
13
  };
14
14
 
15
+ const CONTEXT_TYPES = {
16
+ TEST: 'test',
17
+ DESCRIBE: 'describe'
18
+ };
19
+
15
20
  class TimelineArtifactPlugin extends ArtifactPlugin {
16
21
  constructor(config) {
17
22
  super(config);
@@ -32,23 +37,23 @@ class TimelineArtifactPlugin extends ArtifactPlugin {
32
37
 
33
38
  async onRunDescribeStart(suite) {
34
39
  const sectionName = (suite.name === 'ROOT_DESCRIBE_BLOCK' ? this._deviceName : suite.name);
35
- this._trace.startSection(sectionName);
40
+ this._trace.startSection(sectionName, { context: CONTEXT_TYPES.DESCRIBE });
36
41
  await super.onRunDescribeStart(suite);
37
42
  }
38
43
 
39
44
  async onRunDescribeFinish(suite) {
40
45
  const sectionName = (suite.name === 'ROOT_DESCRIBE_BLOCK' ? this._deviceName : suite.name);
41
- this._trace.endSection(sectionName);
46
+ this._trace.endSection(sectionName, { context: CONTEXT_TYPES.DESCRIBE });
42
47
  await super.onRunDescribeFinish(suite);
43
48
  }
44
49
 
45
50
  async onTestStart(testSummary) {
46
- this._trace.startSection(testSummary.title);
51
+ this._trace.startSection(testSummary.title, { context: CONTEXT_TYPES.TEST });
47
52
  await super.onTestStart(testSummary);
48
53
  }
49
54
 
50
55
  async onTestDone(testSummary) {
51
- this._trace.endSection(testSummary.title, { status: testSummary.status });
56
+ this._trace.endSection(testSummary.title, { status: testSummary.status, context: CONTEXT_TYPES.TEST });
52
57
  await super.onTestDone(testSummary);
53
58
  }
54
59
 
@@ -40,6 +40,7 @@ class GenyAllocDriver extends AllocationDriverBase {
40
40
  const { adbName } = instance;
41
41
 
42
42
  await this._adb.disableAndroidAnimations(adbName);
43
+ await this._adb.setWiFiToggle(adbName, true);
43
44
  await this._adb.apiLevel(adbName);
44
45
  return new GenycloudEmulatorCookie(instance);
45
46
  }
@@ -206,6 +206,11 @@ class ADB {
206
206
  await this.shell(deviceId, `settings put global transition_animation_scale 0`);
207
207
  }
208
208
 
209
+ async setWiFiToggle(deviceId, state) {
210
+ const value = (state === true ? 'enable' : 'disable');
211
+ await this.shell(deviceId, `svc wifi ${value}`);
212
+ }
213
+
209
214
  async screencap(deviceId, path) {
210
215
  await this.shell(deviceId, `screencap ${path}`);
211
216
  }
@@ -246,7 +246,9 @@ class AppleSimUtils {
246
246
  // ```
247
247
  // This workaround is done to ignore the error above, as we do not care if the app was running before, we just
248
248
  // want to make sure it isn't now.
249
- if (err.code === 3 && err.stderr.includes(`the app is not currently running`)) {
249
+ if (err.code === 3 &&
250
+ (err.stderr.includes(`the app is not currently running`) ||
251
+ err.stderr.includes(`The operation couldn’t be completed. found nothing to terminate`))) {
250
252
  return;
251
253
  }
252
254
 
@@ -26,15 +26,16 @@ class ChromeTracingExporter {
26
26
 
27
27
  _parseEvent(event) {
28
28
  const { name, ts, args, type } = event;
29
+ const tsInMicroseconds = ts * 1000;
29
30
  switch (type) {
30
- case 'start': return this._event(name, 'B', ts * 1000, args);
31
- case 'end': return this._event(name, 'E', ts * 1000, args);
31
+ case 'start': return this._event(name, 'B', tsInMicroseconds, args);
32
+ case 'end': return this._event(name, 'E', tsInMicroseconds, args);
32
33
  case 'init': return [
33
- this._event('process_name', 'M', ts, { name: this._process.name }),
34
- this._event('thread_name', 'M', ts, { name: this._thread.name }),
34
+ this._event('process_name', 'M', tsInMicroseconds, { name: this._process.name }),
35
+ this._event('thread_name', 'M', tsInMicroseconds, { name: this._thread.name }),
35
36
  ];
36
37
  default:
37
- throw new DetoxRuntimeError(`Invalid type '${type}' in event: ${event}`);
38
+ throw new DetoxRuntimeError({ message: `Invalid type '${type}' in event: ${event}` });
38
39
  }
39
40
  }
40
41
 
@@ -78,7 +78,7 @@ function getAndroidEmulatorPath() {
78
78
  return legacyPath;
79
79
  }
80
80
 
81
- throwSdkIntegrityError(sdkRoot, 'emulator/emulator');
81
+ throwSdkBinIntegrityError(sdkRoot, 'emulator/emulator');
82
82
  }
83
83
 
84
84
  async function getAaptPath() {
@@ -88,23 +88,33 @@ async function getAaptPath() {
88
88
  }
89
89
 
90
90
  const latestBuildTools = await getLatestBuildToolsPath(sdkRoot);
91
- const defaultPath = latestBuildTools && which('aapt', latestBuildTools);
91
+ if (!latestBuildTools) {
92
+ throwSdkIntegrityError('Failed to find the "aapt" tool under the Android SDK: No build-tools are installed!');
93
+ }
94
+
95
+ const defaultPath = which('aapt', latestBuildTools);
92
96
  if (defaultPath) {
93
97
  return defaultPath;
94
98
  }
95
99
 
96
- throwSdkIntegrityError(sdkRoot, `${latestBuildTools}/aapt`);
100
+ throwSdkToolPathError(`${latestBuildTools}/aapt`);
97
101
  }
98
102
 
99
103
  async function getLatestBuildToolsPath(sdkRoot) {
100
- if (!sdkRoot) return '';
104
+ if (!sdkRoot) {
105
+ return '';
106
+ }
101
107
 
102
108
  const buildToolsDir = path.join(sdkRoot, 'build-tools');
103
- if (!fs.existsSync(buildToolsDir)) return '';
109
+ if (!fs.existsSync(buildToolsDir)) {
110
+ return '';
111
+ }
104
112
 
105
113
  const buildToolsVersions = await fsext.getDirectories(buildToolsDir);
106
114
  const latestBuildToolsVersion = _.last(buildToolsVersions);
107
- if (!latestBuildToolsVersion) return '';
115
+ if (!latestBuildToolsVersion) {
116
+ return '';
117
+ }
108
118
 
109
119
  return path.join(buildToolsDir, latestBuildToolsVersion);
110
120
  }
@@ -120,7 +130,7 @@ function getAdbPath() {
120
130
  return defaultPath;
121
131
  }
122
132
 
123
- throwSdkIntegrityError(sdkRoot, 'platform-tools/adb');
133
+ throwSdkBinIntegrityError(sdkRoot, 'platform-tools/adb');
124
134
  }
125
135
 
126
136
  function getGmsaasPath() {
@@ -142,15 +152,20 @@ function throwMissingAvdError(avdName, avdPath, avdIniPath) {
142
152
  );
143
153
  }
144
154
 
145
- function throwSdkIntegrityError(sdkRoot, relativeExecutablePath) {
146
- const executablePath = path.join(sdkRoot, relativeExecutablePath);
147
- const name = path.basename(executablePath);
148
- const dir = path.dirname(executablePath);
155
+ function throwSdkBinIntegrityError(sdkRoot, relativeBinPath) {
156
+ const executablePath = path.join(sdkRoot, relativeBinPath);
157
+ throwSdkToolPathError(executablePath);
158
+ }
149
159
 
150
- throw new DetoxRuntimeError(
151
- `There was no "${name}" executable file in directory: ${dir}.\n` +
152
- `Check integrity of your Android SDK.`
153
- );
160
+ function throwSdkToolPathError(sdkToolPath) {
161
+ const name = path.basename(sdkToolPath);
162
+ const dir = path.dirname(sdkToolPath);
163
+
164
+ throwSdkIntegrityError(`There was no "${name}" executable file in directory: ${dir}`);
165
+ }
166
+
167
+ function throwSdkIntegrityError(errMessage) {
168
+ throw new DetoxRuntimeError(`${errMessage}\nCheck the integrity of your Android SDK.`);
154
169
  }
155
170
 
156
171
  function throwMissingGmsaasError() {
@@ -1 +0,0 @@
1
- f1eff49df29549c4f094b94f820d8659
@@ -1 +0,0 @@
1
- 00703d0219b1e8ad51dfe52206f2ff795956136d
@@ -1 +0,0 @@
1
- c40e8c0d55385f0ee35aec198dcf9ae2a63c4279786603aa9294436384fb3dcd
@@ -1 +0,0 @@
1
- 00742f6f56f5314f0a1ffa99e4e831615a926fe8e9e32d94725903e23ee6ed8067682d0bedd19350f092aebbe2a90c705e050a20967103e6599ae237a0882baf
@@ -1 +0,0 @@
1
- 7070b5efa82ce7926d40972ca14ec8fd
@@ -1 +0,0 @@
1
- f6c4c5b5f2eb5d89f6605df7b09f7b2689bd132d
@@ -1 +0,0 @@
1
- 558d13035ea21c4f584b8463cfd923bbcfcfd0ef904ec4e9d45b17bff8aa5cea
@@ -1 +0,0 @@
1
- 631b37c92c17dd5158e8b72b305ba18adc69b71a7a72449c00fd9cffa36d7627a341f6825d1c809a77c9dfecd5ffe3a795d23f3f48be3081f2a6cce4a5bd2d8e
@@ -1 +0,0 @@
1
- 6d3f9250a50b2297577f126aa0253833
@@ -1 +0,0 @@
1
- e8a6d8b30ca550020ddcc21a061ea5cb360515d8
@@ -1 +0,0 @@
1
- bc528b332ad97156496b6d44e60005884f2d9ffe79808319e4a844b65cad9810
@@ -1 +0,0 @@
1
- d3b944c0bedc48769416f46594853b759776b04befafc96314f2023f01f94607b43a22f2ebffe2ccd2c1c9144357d8e8888b600bfed1c8550263ff1c63d1f22f
@@ -1 +0,0 @@
1
- 73a0b8c6ccc7b6f6eb6b3cc381eafba5
@@ -1 +0,0 @@
1
- 9212f8d378d2bb72115181b5e2c4d086eaa7ba2f
@@ -1 +0,0 @@
1
- 4a350adbac62859765229611809d3cd99eec3c0d3d46c8dcf49916c9cb53fe34
@@ -1 +0,0 @@
1
- 3fd69cb6ccc763c9bae624716a6e76bcafafd0946c9562505ab5c3592c27ab6873f1f2adaa6d30fc89549f3b50ca451e902559ef290596b903beb696ac883d4e