detox 20.51.3 → 20.51.4

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 (43) hide show
  1. package/Detox-android/com/wix/detox/{20.51.3/detox-20.51.3-sources.jar → 20.51.4/detox-20.51.4-sources.jar} +0 -0
  2. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4-sources.jar.md5 +1 -0
  3. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4-sources.jar.sha1 +1 -0
  4. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4-sources.jar.sha256 +1 -0
  5. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4-sources.jar.sha512 +1 -0
  6. package/Detox-android/com/wix/detox/{20.51.3/detox-20.51.3.aar → 20.51.4/detox-20.51.4.aar} +0 -0
  7. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4.aar.md5 +1 -0
  8. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4.aar.sha1 +1 -0
  9. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4.aar.sha256 +1 -0
  10. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4.aar.sha512 +1 -0
  11. package/Detox-android/com/wix/detox/{20.51.3/detox-20.51.3.pom → 20.51.4/detox-20.51.4.pom} +1 -1
  12. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4.pom.md5 +1 -0
  13. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4.pom.sha1 +1 -0
  14. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4.pom.sha256 +1 -0
  15. package/Detox-android/com/wix/detox/20.51.4/detox-20.51.4.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-framework.tbz +0 -0
  22. package/Detox-ios-src.tbz +0 -0
  23. package/Detox-ios-xcuitest.tbz +0 -0
  24. package/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/ReactNativeIdlingResources.kt +20 -0
  25. package/detox.d.ts +8 -3
  26. package/package.json +1 -1
  27. package/src/devices/common/drivers/android/tools/instrumentationArgs.js +10 -4
  28. package/src/devices/common/drivers/ios/tools/AppleSimUtils.js +4 -0
  29. package/src/devices/common/drivers/utils/urlBlacklist.js +98 -0
  30. package/src/devices/runtime/RuntimeDevice.js +2 -1
  31. package/src/ios/expectTwo.js +2 -1
  32. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3-sources.jar.md5 +0 -1
  33. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3-sources.jar.sha1 +0 -1
  34. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3-sources.jar.sha256 +0 -1
  35. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3-sources.jar.sha512 +0 -1
  36. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3.aar.md5 +0 -1
  37. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3.aar.sha1 +0 -1
  38. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3.aar.sha256 +0 -1
  39. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3.aar.sha512 +0 -1
  40. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3.pom.md5 +0 -1
  41. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3.pom.sha1 +0 -1
  42. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3.pom.sha256 +0 -1
  43. package/Detox-android/com/wix/detox/20.51.3/detox-20.51.3.pom.sha512 +0 -1
@@ -0,0 +1 @@
1
+ 938a6604697dd62e9aebc083516c4317
@@ -0,0 +1 @@
1
+ bfb651ecf94c66750c79ed33fdc2ce2708c4fb6b
@@ -0,0 +1 @@
1
+ 353e190b70f6cc2f785e816d839472cfd05f91e30be0f092ad995ddf12bcf950
@@ -0,0 +1 @@
1
+ 1345311135bdac5979b2e8f5d816b84fca0e7f46cda19b5db332bdb6f08dff70d28968f553bd766f2824a2c79f62fe22c321d4a264c7fbf8c0c5e00f2ac1fbf4
@@ -0,0 +1 @@
1
+ 7b98283bd95435c42d29c4d2430595e9
@@ -0,0 +1 @@
1
+ dbc14054f7471ad277c86a6019dcfd51f8157c19
@@ -0,0 +1 @@
1
+ 04231f94969d754e338da93a31b261b5fe38ea656c9e765eebb697ceffb584c6
@@ -0,0 +1 @@
1
+ 9b0c96d84d984a4161a3668f9e3464a623f84aecdc96359c8bb29da0186c3e7a94919f957c0316f1ace39f4cbd712a2045f5424da505c20b936af2f4d21735e7
@@ -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.51.3</version>
6
+ <version>20.51.4</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
+ 1c9c1e7afb72bf34b47962011e792e18
@@ -0,0 +1 @@
1
+ 5a6fcff438cbd9f6a9ececb815b78006156848bc
@@ -0,0 +1 @@
1
+ fc98bfd891824fbbc832e999ca236b7008048da47164b317f92d28babff78107
@@ -0,0 +1 @@
1
+ 4c84158a3da3741ef4514ae00759d18b1cf8fdca7b7ee980a7752526b068b9e537cecfd43cf2b5797116289220c1bc00452ea70460dc0ccffc13cb7cd6cfcdd4
@@ -3,11 +3,11 @@
3
3
  <groupId>com.wix</groupId>
4
4
  <artifactId>detox</artifactId>
5
5
  <versioning>
6
- <latest>20.51.3</latest>
7
- <release>20.51.3</release>
6
+ <latest>20.51.4</latest>
7
+ <release>20.51.4</release>
8
8
  <versions>
9
- <version>20.51.3</version>
9
+ <version>20.51.4</version>
10
10
  </versions>
11
- <lastUpdated>20260530100717</lastUpdated>
11
+ <lastUpdated>20260616123723</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 6f9fac5d12a8ad67234cc877070a0cbc
1
+ 7b2a47ae83f4b50472d726efe7bcaa71
@@ -1 +1 @@
1
- dc8fca8c12c46b64490c73b6c7260c8be667abd3
1
+ ee6b2b6492e1ef7efad584693d657b96b1df111a
@@ -1 +1 @@
1
- 8d1feefec6be6b838248dcde3f7460b791f3183ad206142da53391dbfd1da4ea
1
+ 45f7f857bd8b76ba59696c0c8c33de05ed8f2ed8e7c30fb465f1fd2bd567c985
@@ -1 +1 @@
1
- 3e937e4119f83c7844692c495b823fc253dc4f1f7dbf3a8d80e5c08c639ce299000cbbb6b85a8c1e1181d394d5a98830abd0b2876f071d11c276ca4a2a8bcf5e
1
+ 63485308c27fc8ce3f5436c888e3cd8d5030f192eee47a09067945070683d84199d75eb9858c71b588a692897021d1d8d578c02d61ef0e78bdd2e5620e360792
Binary file
package/Detox-ios-src.tbz CHANGED
Binary file
Binary file
@@ -15,6 +15,7 @@ import com.wix.detox.reactnative.idlingresources.looper.MQThreadsReflector
15
15
  import com.wix.detox.reactnative.idlingresources.network.NetworkIdlingResource
16
16
  import kotlinx.coroutines.runBlocking
17
17
  import org.joor.Reflect
18
+ import org.json.JSONArray
18
19
  import java.util.concurrent.ConcurrentHashMap
19
20
 
20
21
  private const val LOG_TAG = "DetoxRNIdleRes"
@@ -170,9 +171,28 @@ class ReactNativeIdlingResources(
170
171
  }
171
172
 
172
173
  private fun toFormattedUrlArray(urlList: String): List<String> {
174
+ parseUrlBlacklistJsonArray(urlList)?.let {
175
+ return it
176
+ }
177
+
173
178
  var formattedUrls = urlList
174
179
  formattedUrls = formattedUrls.replace(Regex("""[()"]"""), "")
175
180
  formattedUrls = formattedUrls.trim()
176
181
  return formattedUrls.split(',')
177
182
  }
183
+
184
+ private fun parseUrlBlacklistJsonArray(urlList: String): List<String>? {
185
+ val trimmedUrlList = urlList.trim()
186
+ if (!trimmedUrlList.startsWith("[")) {
187
+ return null
188
+ }
189
+
190
+ return try {
191
+ val jsonArray = JSONArray(trimmedUrlList)
192
+ List(jsonArray.length()) { index -> jsonArray.getString(index) }
193
+ } catch (e: Exception) {
194
+ Log.w(LOG_TAG, "Failed to parse URL blacklist as JSON array, falling back to legacy parser", e)
195
+ null
196
+ }
197
+ }
178
198
  }
package/detox.d.ts CHANGED
@@ -966,9 +966,13 @@ declare global {
966
966
  /**
967
967
  * Disable network synchronization mechanism on preferred endpoints. Useful if you want to on skip over synchronizing on certain URLs.
968
968
  *
969
+ * Accepts either string patterns or `RegExp` objects. With `RegExp`, only the `i`, `m` and `s`
970
+ * flags are portable across iOS and Android; the `g`, `y`, `d`, `u` and `v` flags are rejected.
971
+ *
969
972
  * @example await device.setURLBlacklist(['.*127.0.0.1.*']);
973
+ * @example await device.setURLBlacklist([/.*127\.0\.0\.1/, /my\.ignored\.endpoint/i]);
970
974
  */
971
- setURLBlacklist(urls: string[]): Promise<void>;
975
+ setURLBlacklist(urls: Array<string | RegExp>): Promise<void>;
972
976
 
973
977
  /**
974
978
  * Temporarily disable synchronization (idle/busy monitoring) with the app - namely, stop waiting for the app to go idle before moving forward in the test execution.
@@ -1516,9 +1520,10 @@ declare global {
1516
1520
  /**
1517
1521
  * In React Native apps, expect UI component of type <Text> to have text.
1518
1522
  * In native iOS apps, expect UI elements of type UIButton, UILabel, UITextField or UITextViewIn to have inputText with text.
1519
- * @example await expect(element(by.id('mainTitle'))).toHaveText('Welcome back!);
1523
+ * @example await expect(element(by.id('mainTitle'))).toHaveText('Welcome back!');
1524
+ * @example await expect(element(by.id('dynamicTitle'))).toHaveText(/^Welcome back/);
1520
1525
  */
1521
- toHaveText(text: string): R;
1526
+ toHaveText(text: string | RegExp): R;
1522
1527
 
1523
1528
  /**
1524
1529
  * Expects a specific accessibilityLabel, as specified via the `accessibilityLabel` prop in React Native.
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.51.3",
4
+ "version": "20.51.4",
5
5
  "bin": "local-cli/cli.js",
6
6
  "files": [
7
7
  "android",
@@ -2,6 +2,11 @@ const _ = require('lodash');
2
2
 
3
3
  const { encodeBase64 } = require('../../../../../utils/encoding');
4
4
  const { autoEscape } = require('../../../../../utils/shellUtils');
5
+ const {
6
+ isSerializedURLBlacklistForAndroid,
7
+ serializeURLBlacklistForAndroid,
8
+ URL_BLACKLIST_LAUNCH_ARG,
9
+ } = require('../../utils/urlBlacklist');
5
10
 
6
11
  const reservedInstrumentationArgs = new Set(['class', 'package', 'func', 'unit', 'size', 'perf', 'debug', 'log', 'emma', 'coverageFile']);
7
12
  const isReservedInstrumentationArg = (arg) => reservedInstrumentationArgs.has(arg);
@@ -9,7 +14,8 @@ const isReservedInstrumentationArg = (arg) => reservedInstrumentationArgs.has(ar
9
14
  function prepareInstrumentationArgs(args) {
10
15
  const usedReservedArgs = [];
11
16
  const preparedLaunchArgs = _.reduce(args, (result, value, key) => {
12
- const valueAsString = _.isString(value) ? value : JSON.stringify(value);
17
+ const serializedValue = key === URL_BLACKLIST_LAUNCH_ARG ? serializeURLBlacklistForAndroid(value) : value;
18
+ const valueAsString = _.isString(serializedValue) ? serializedValue : JSON.stringify(serializedValue);
13
19
 
14
20
  let valueEncoded = valueAsString;
15
21
  if (isReservedInstrumentationArg(key)) {
@@ -18,7 +24,7 @@ function prepareInstrumentationArgs(args) {
18
24
  valueEncoded = encodeBase64(valueAsString);
19
25
  }
20
26
 
21
- const valueEscaped = hasLegacyIssues(key) ? valueEncoded : autoEscape.shell(valueEncoded);
27
+ const valueEscaped = hasLegacyIssues(key, valueEncoded) ? valueEncoded : autoEscape.shell(valueEncoded);
22
28
  result.push('-e', key, valueEscaped);
23
29
  return result;
24
30
  }, []);
@@ -29,8 +35,8 @@ function prepareInstrumentationArgs(args) {
29
35
  };
30
36
  }
31
37
 
32
- function hasLegacyIssues(key) {
33
- return key === 'detoxURLBlacklistRegex';
38
+ function hasLegacyIssues(key, value) {
39
+ return key === URL_BLACKLIST_LAUNCH_ARG && !isSerializedURLBlacklistForAndroid(value);
34
40
  }
35
41
 
36
42
  module.exports = {
@@ -10,6 +10,7 @@ const childProcess = require('../../../../../utils/childProcess');
10
10
  const environment = require('../../../../../utils/environment');
11
11
  const log = require('../../../../../utils/logger').child({ cat: 'device' });
12
12
  const { quote } = require('../../../../../utils/shellQuote');
13
+ const { serializeURLBlacklistForIOS, URL_BLACKLIST_LAUNCH_ARG } = require('../../utils/urlBlacklist');
13
14
 
14
15
  const PERMISSIONS_VALUES = {
15
16
  YES: 'YES',
@@ -530,6 +531,9 @@ class AppleSimUtils {
530
531
  const args = {
531
532
  ...launchArgs,
532
533
  };
534
+ if (URL_BLACKLIST_LAUNCH_ARG in args) {
535
+ args[URL_BLACKLIST_LAUNCH_ARG] = serializeURLBlacklistForIOS(args[URL_BLACKLIST_LAUNCH_ARG]);
536
+ }
533
537
 
534
538
  if (languageAndLocale) {
535
539
  if (languageAndLocale.language) {
@@ -0,0 +1,98 @@
1
+ const URL_BLACKLIST_LAUNCH_ARG = 'detoxURLBlacklistRegex';
2
+
3
+ function isRegExp(value) {
4
+ return value instanceof RegExp;
5
+ }
6
+
7
+ function toURLBlacklistArray(value) {
8
+ if (Array.isArray(value)) {
9
+ return value.map(toRegexPattern);
10
+ }
11
+
12
+ if (isRegExp(value)) {
13
+ return [toRegexPattern(value)];
14
+ }
15
+
16
+ return null;
17
+ }
18
+
19
+ function toRegexPattern(value) {
20
+ if (isRegExp(value)) {
21
+ return withPortableFlags(value);
22
+ }
23
+
24
+ if (typeof value === 'string') {
25
+ return value;
26
+ }
27
+
28
+ throw new TypeError([
29
+ 'detoxURLBlacklistRegex must be a RegExp, string,',
30
+ `or an array of RegExp/string values, got ${typeof value}`,
31
+ ].join(' '));
32
+ }
33
+
34
+ const UNSUPPORTED_FLAGS = ['g', 'y', 'd', 'u', 'v'];
35
+
36
+ function withPortableFlags(regex) {
37
+ const unsupported = UNSUPPORTED_FLAGS.filter(f => regex.flags.includes(f));
38
+ if (unsupported.length > 0) {
39
+ throw new TypeError(
40
+ `detoxURLBlacklistRegex: flag(s) [${unsupported.join(', ')}] in /${regex.source}/${regex.flags} ` +
41
+ `are not portable across iOS and Android — only i, m, s are supported`
42
+ );
43
+ }
44
+
45
+ const flags = [
46
+ regex.ignoreCase && 'i',
47
+ regex.multiline && 'm',
48
+ regex.dotAll && 's',
49
+ ].filter(Boolean).join('');
50
+
51
+ return flags ? `(?${flags}:${regex.source})` : regex.source;
52
+ }
53
+
54
+ function serializeURLBlacklistForIOS(value) {
55
+ const patterns = toURLBlacklistArray(value);
56
+ if (!patterns) {
57
+ return value;
58
+ }
59
+
60
+ return JSON.stringify(patterns);
61
+ }
62
+
63
+ function serializeURLBlacklistForAndroid(value) {
64
+ const patterns = toURLBlacklistArray(value);
65
+ if (!patterns) {
66
+ return value;
67
+ }
68
+
69
+ return JSON.stringify(patterns);
70
+ }
71
+
72
+ function normalizeURLBlacklist(value) {
73
+ const patterns = toURLBlacklistArray(value);
74
+ if (!patterns) {
75
+ return value;
76
+ }
77
+
78
+ return patterns;
79
+ }
80
+
81
+ function isSerializedURLBlacklistForAndroid(value) {
82
+ if (typeof value !== 'string') return false;
83
+ const trimmed = value.trim();
84
+ if (!trimmed.startsWith('[')) return false;
85
+ try {
86
+ return Array.isArray(JSON.parse(trimmed));
87
+ } catch {
88
+ return false;
89
+ }
90
+ }
91
+
92
+ module.exports = {
93
+ URL_BLACKLIST_LAUNCH_ARG,
94
+ isSerializedURLBlacklistForAndroid,
95
+ normalizeURLBlacklist,
96
+ serializeURLBlacklistForAndroid,
97
+ serializeURLBlacklistForIOS,
98
+ };
@@ -4,6 +4,7 @@ const log = require('../../utils/logger').child({ cat: 'device' });
4
4
  const mapDeviceLongPressArguments = require('../../utils/mapDeviceLongPressArguments');
5
5
  const traceMethods = require('../../utils/traceMethods');
6
6
  const wrapWithStackTraceCutter = require('../../utils/wrapWithStackTraceCutter');
7
+ const { normalizeURLBlacklist } = require('../common/drivers/utils/urlBlacklist');
7
8
 
8
9
  const LaunchArgsEditor = require('./utils/LaunchArgsEditor');
9
10
 
@@ -331,7 +332,7 @@ class RuntimeDevice {
331
332
  }
332
333
 
333
334
  async setURLBlacklist(urlList) {
334
- await this.deviceDriver.setURLBlacklist(urlList);
335
+ await this.deviceDriver.setURLBlacklist(normalizeURLBlacklist(urlList));
335
336
  }
336
337
 
337
338
  async enableSynchronization() {
@@ -78,8 +78,9 @@ class Expect {
78
78
  }
79
79
 
80
80
  toHaveText(text) {
81
+ const isRegex = isRegExp(text);
81
82
  const traceDescription = expectDescription.toHaveText(text);
82
- return this.expect('toHaveText', traceDescription, text);
83
+ return this.expect('toHaveText', traceDescription, isRegex ? text.toString() : text, isRegex || undefined);
83
84
  }
84
85
 
85
86
  toNotHaveText(text) {
@@ -1 +0,0 @@
1
- 04a0dee0d2a73dacfee3b72590aca228
@@ -1 +0,0 @@
1
- 3bc48c3b5ad70e79cd9fe187689f49b5e00f5a52
@@ -1 +0,0 @@
1
- 1af828a2654851275c4c925d743878ee3dcfb4b1344e19a300fe5e0d469a458f
@@ -1 +0,0 @@
1
- d49daedb05f8a352431f95f084cad301cb5fbb0b6a78f9e04b8b623ea67de6897a9e0836cb5bce5bd33fe90021728f3ebead39612d30faf67eaff4c00d255c50
@@ -1 +0,0 @@
1
- 8e0d8436e2bb96bf972973f870a8a085
@@ -1 +0,0 @@
1
- 8c632990b86b21310efddead2389ba03909ace2d
@@ -1 +0,0 @@
1
- ec21c0143aef98ba788e5b1df0439004f3becfc8946b77b7fce5191db637f1c6
@@ -1 +0,0 @@
1
- 9da3a9c4afa75981a87d68da9dd6ebc3c127acf19c7357f14609c3bc0c1540763299f931d1edca1d35291d9111dcf75439be40af192a33a8e4e9a380dfd3e94b
@@ -1 +0,0 @@
1
- f883bf7400b38b11330656eebcc0dec9
@@ -1 +0,0 @@
1
- 955dce2e1cbb88295d2bad6691b65dff2952d4ad
@@ -1 +0,0 @@
1
- ca2e5b7cc96a7a296e3ec44b97e19a3d92a4ec48f9cc39986500dd0900ea3e6f
@@ -1 +0,0 @@
1
- 64acbf65aefd593a64c4c39e9c82114b198d3b27b197d09cb189d543ddda02cea633242545960c4178df90543db0d95191dd1d6a144c14e116ab60bc1923fd45