appium-espresso-driver 2.13.0 → 2.13.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.
@@ -48,7 +48,7 @@ class GetClipboard : RequestHandler<GetClipboardParams, String?> {
48
48
  }
49
49
 
50
50
  private fun toBase64String(s: String): String {
51
- return Base64.encodeToString(s.toByteArray(StandardCharsets.UTF_8), Base64.DEFAULT)
51
+ return Base64.encodeToString(s.toByteArray(StandardCharsets.UTF_8), Base64.NO_WRAP)
52
52
  }
53
53
 
54
54
  private inner class GetClipboardRunnable internal constructor(private val contentType: ClipboardDataType) : Runnable {
@@ -45,7 +45,7 @@ class SetClipboard : RequestHandler<SetClipboardParams, Void?> {
45
45
  }
46
46
 
47
47
  private fun fromBase64String(s: String?): String {
48
- return String(Base64.decode(s, Base64.DEFAULT), StandardCharsets.UTF_8)
48
+ return String(Base64.decode(s, Base64.NO_WRAP), StandardCharsets.UTF_8)
49
49
  }
50
50
 
51
51
  // Clip feature should run with main thread
@@ -54,6 +54,6 @@ class ScreenshotsHelper @JvmOverloads constructor(private val view: View? = null
54
54
  }
55
55
  val outputStream = ByteArrayOutputStream()
56
56
  bitmapScreenCap.compress(Bitmap.CompressFormat.PNG, 100, outputStream)
57
- return Base64.encodeToString(outputStream.toByteArray(), Base64.DEFAULT)
57
+ return Base64.encodeToString(outputStream.toByteArray(), Base64.NO_WRAP)
58
58
  }
59
59
  }
@@ -168,8 +168,8 @@ object ViewFinder {
168
168
  // If we're only looking for one item that matches xpath, pass it index 0 or else
169
169
  // Espresso throws an AmbiguousMatcherException
170
170
  return getViews(
171
- if (findOne) withXPath(parent, selector, 0) else withXPath(parent, selector),
172
- true,
171
+ withXPath(parent, selector, if (findOne) 0 else null),
172
+ findOne,
173
173
  parent
174
174
  ).map { ViewState(it) }
175
175
  Strategy.VIEW_TAG ->
@@ -37,10 +37,15 @@ fun fetchIncludedAttributes(xpath: String): Set<AttributesEnum>? {
37
37
  }
38
38
 
39
39
  fun withXPath(root: View?, xpath: String, index: Int? = null): Matcher<View> {
40
- // Get a list of the Views that match the provided xpath
41
- val matchedXPathViews = SourceDocument(root, fetchIncludedAttributes(xpath)).findViewsByXPath(xpath)
40
+ val matchedXPathViews = mutableListOf<View>()
42
41
  return object : TypeSafeMatcher<View>() {
43
42
  override fun matchesSafely(item: View): Boolean {
43
+ if (matchedXPathViews.isEmpty()) {
44
+ matchedXPathViews.addAll(
45
+ SourceDocument(root ?: item.rootView, fetchIncludedAttributes(xpath)).findViewsByXPath(xpath)
46
+ )
47
+ }
48
+
44
49
  return if (index != null) {
45
50
  // If index is not null, match it with the xpath in the list at the provided index
46
51
  index < matchedXPathViews.size && matchedXPathViews[index] == item
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "appium-espresso-driver",
3
- "version": "2.13.0",
3
+ "version": "2.13.2",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "appium-espresso-driver",
9
- "version": "2.13.0",
9
+ "version": "2.13.2",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@babel/runtime": "^7.4.3",
@@ -304,7 +304,7 @@
304
304
  }
305
305
  },
306
306
  "node_modules/@babel/parser": {
307
- "version": "7.19.4",
307
+ "version": "7.20.0",
308
308
  "extraneous": true,
309
309
  "license": "MIT",
310
310
  "bin": {
@@ -315,10 +315,10 @@
315
315
  }
316
316
  },
317
317
  "node_modules/@babel/runtime": {
318
- "version": "7.19.4",
318
+ "version": "7.20.0",
319
319
  "license": "MIT",
320
320
  "dependencies": {
321
- "regenerator-runtime": "^0.13.4"
321
+ "regenerator-runtime": "^0.13.10"
322
322
  },
323
323
  "engines": {
324
324
  "node": ">=6.9.0"
@@ -1000,7 +1000,7 @@
1000
1000
  }
1001
1001
  },
1002
1002
  "node_modules/@types/node": {
1003
- "version": "18.11.2",
1003
+ "version": "18.11.7",
1004
1004
  "license": "MIT"
1005
1005
  },
1006
1006
  "node_modules/@types/normalize-package-data": {
@@ -1206,7 +1206,7 @@
1206
1206
  "license": "MIT"
1207
1207
  },
1208
1208
  "node_modules/appium-adb": {
1209
- "version": "9.10.12",
1209
+ "version": "9.10.14",
1210
1210
  "license": "Apache-2.0",
1211
1211
  "dependencies": {
1212
1212
  "@appium/support": "^2.60.0",
@@ -1252,7 +1252,7 @@
1252
1252
  }
1253
1253
  },
1254
1254
  "node_modules/appium-android-driver": {
1255
- "version": "5.6.0",
1255
+ "version": "5.7.0",
1256
1256
  "license": "Apache-2.0",
1257
1257
  "dependencies": {
1258
1258
  "@babel/runtime": "^7.0.0",
@@ -1316,7 +1316,7 @@
1316
1316
  }
1317
1317
  },
1318
1318
  "node_modules/appium-chromedriver": {
1319
- "version": "5.2.4",
1319
+ "version": "5.2.5",
1320
1320
  "hasInstallScript": true,
1321
1321
  "license": "Apache-2.0",
1322
1322
  "dependencies": {
@@ -1412,6 +1412,10 @@
1412
1412
  "node": ">= 6"
1413
1413
  }
1414
1414
  },
1415
+ "node_modules/archiver-utils/node_modules/isarray": {
1416
+ "version": "1.0.0",
1417
+ "license": "MIT"
1418
+ },
1415
1419
  "node_modules/archiver-utils/node_modules/readable-stream": {
1416
1420
  "version": "2.3.7",
1417
1421
  "license": "MIT",
@@ -2751,7 +2755,7 @@
2751
2755
  }
2752
2756
  },
2753
2757
  "node_modules/io.appium.settings": {
2754
- "version": "4.2.1",
2758
+ "version": "4.2.2",
2755
2759
  "license": "Apache-2.0",
2756
2760
  "engines": {
2757
2761
  "node": ">=14",
@@ -2961,10 +2965,6 @@
2961
2965
  "url": "https://github.com/sponsors/ljharb"
2962
2966
  }
2963
2967
  },
2964
- "node_modules/isarray": {
2965
- "version": "1.0.0",
2966
- "license": "MIT"
2967
- },
2968
2968
  "node_modules/isexe": {
2969
2969
  "version": "2.0.0",
2970
2970
  "license": "ISC"
@@ -3119,6 +3119,10 @@
3119
3119
  "node": ">= 0.6.3"
3120
3120
  }
3121
3121
  },
3122
+ "node_modules/lazystream/node_modules/isarray": {
3123
+ "version": "1.0.0",
3124
+ "license": "MIT"
3125
+ },
3122
3126
  "node_modules/lazystream/node_modules/readable-stream": {
3123
3127
  "version": "2.3.7",
3124
3128
  "license": "MIT",
@@ -5076,7 +5080,7 @@
5076
5080
  "license": "ISC"
5077
5081
  },
5078
5082
  "node_modules/ws": {
5079
- "version": "8.9.0",
5083
+ "version": "8.10.0",
5080
5084
  "license": "MIT",
5081
5085
  "engines": {
5082
5086
  "node": ">=10.0.0"
@@ -5379,13 +5383,13 @@
5379
5383
  }
5380
5384
  },
5381
5385
  "@babel/parser": {
5382
- "version": "7.19.4",
5386
+ "version": "7.20.0",
5383
5387
  "extraneous": true
5384
5388
  },
5385
5389
  "@babel/runtime": {
5386
- "version": "7.19.4",
5390
+ "version": "7.20.0",
5387
5391
  "requires": {
5388
- "regenerator-runtime": "^0.13.4"
5392
+ "regenerator-runtime": "^0.13.10"
5389
5393
  }
5390
5394
  },
5391
5395
  "@colors/colors": {
@@ -5859,7 +5863,7 @@
5859
5863
  }
5860
5864
  },
5861
5865
  "@types/node": {
5862
- "version": "18.11.2"
5866
+ "version": "18.11.7"
5863
5867
  },
5864
5868
  "@types/normalize-package-data": {
5865
5869
  "version": "2.4.1"
@@ -6001,7 +6005,7 @@
6001
6005
  "version": "1.1.0"
6002
6006
  },
6003
6007
  "appium-adb": {
6004
- "version": "9.10.12",
6008
+ "version": "9.10.14",
6005
6009
  "requires": {
6006
6010
  "@appium/support": "^2.60.0",
6007
6011
  "@babel/runtime": "^7.0.0",
@@ -6035,7 +6039,7 @@
6035
6039
  }
6036
6040
  },
6037
6041
  "appium-android-driver": {
6038
- "version": "5.6.0",
6042
+ "version": "5.7.0",
6039
6043
  "requires": {
6040
6044
  "@babel/runtime": "^7.0.0",
6041
6045
  "appium-adb": "^9.10.9",
@@ -6083,7 +6087,7 @@
6083
6087
  }
6084
6088
  },
6085
6089
  "appium-chromedriver": {
6086
- "version": "5.2.4",
6090
+ "version": "5.2.5",
6087
6091
  "requires": {
6088
6092
  "@babel/runtime": "^7.0.0",
6089
6093
  "@xmldom/xmldom": "^0.x",
@@ -6151,6 +6155,9 @@
6151
6155
  "readable-stream": "^2.0.0"
6152
6156
  },
6153
6157
  "dependencies": {
6158
+ "isarray": {
6159
+ "version": "1.0.0"
6160
+ },
6154
6161
  "readable-stream": {
6155
6162
  "version": "2.3.7",
6156
6163
  "requires": {
@@ -7028,7 +7035,7 @@
7028
7035
  }
7029
7036
  },
7030
7037
  "io.appium.settings": {
7031
- "version": "4.2.1"
7038
+ "version": "4.2.2"
7032
7039
  },
7033
7040
  "ipaddr.js": {
7034
7041
  "version": "1.9.1",
@@ -7136,9 +7143,6 @@
7136
7143
  "call-bind": "^1.0.2"
7137
7144
  }
7138
7145
  },
7139
- "isarray": {
7140
- "version": "1.0.0"
7141
- },
7142
7146
  "isexe": {
7143
7147
  "version": "2.0.0"
7144
7148
  },
@@ -7257,6 +7261,9 @@
7257
7261
  "readable-stream": "^2.0.5"
7258
7262
  },
7259
7263
  "dependencies": {
7264
+ "isarray": {
7265
+ "version": "1.0.0"
7266
+ },
7260
7267
  "readable-stream": {
7261
7268
  "version": "2.3.7",
7262
7269
  "requires": {
@@ -8547,7 +8554,7 @@
8547
8554
  "version": "1.0.2"
8548
8555
  },
8549
8556
  "ws": {
8550
- "version": "8.9.0",
8557
+ "version": "8.10.0",
8551
8558
  "requires": {}
8552
8559
  },
8553
8560
  "xhr": {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "automated testing",
8
8
  "android"
9
9
  ],
10
- "version": "2.13.0",
10
+ "version": "2.13.2",
11
11
  "author": "Appium Contributors",
12
12
  "license": "Apache-2.0",
13
13
  "repository": {