File tree 3 files changed +28
-32
lines changed
3 files changed +28
-32
lines changed Original file line number Diff line number Diff line change @@ -307,10 +307,6 @@ def page_class
307
307
nil
308
308
end
309
309
310
- def lazy_load_strings
311
- @strings_xml ||= mobile ( :getStrings )
312
- end
313
-
314
310
# Android only.
315
311
# Returns a string containing interesting elements.
316
312
# If an element has no content desc or text, then it's not returned by this method.
@@ -416,30 +412,6 @@ def fast_duration
416
412
0.20
417
413
end
418
414
419
- # Search strings.xml's values for target.
420
- # @param target [String] the target to search for in strings.xml values
421
- # @return [Array]
422
- def xml_keys target
423
- lazy_load_strings
424
- @strings_xml . select { |key , value | key . downcase . include? target . downcase }
425
- end
426
-
427
- # Search strings.xml's keys for target.
428
- # @param target [String] the target to search for in strings.xml keys
429
- # @return [Array]
430
- def xml_values target
431
- lazy_load_strings
432
- @strings_xml . select { |key , value | value . downcase . include? target . downcase }
433
- end
434
-
435
- # Resolve id in strings.xml and return the value.
436
- # @param id [String] the id to resolve
437
- # @return [String]
438
- def resolve_id id
439
- lazy_load_strings
440
- @strings_xml [ id ]
441
- end
442
-
443
415
# Lists package, activity, and adb shell am start -n value for current app.
444
416
# Works on local host only (not remote).
445
417
def current_app
Original file line number Diff line number Diff line change @@ -232,4 +232,32 @@ def px_to_window_rel opts={}
232
232
OpenStruct . new ( x : x . to_f / w . width . to_f ,
233
233
y : y . to_f / w . height . to_f )
234
234
end
235
+
236
+ def lazy_load_strings
237
+ @strings_xml ||= mobile ( :getStrings )
238
+ end
239
+
240
+ # Search strings.xml's values for target.
241
+ # @param target [String] the target to search for in strings.xml values
242
+ # @return [Array]
243
+ def xml_keys target
244
+ lazy_load_strings
245
+ @strings_xml . select { |key , value | key . downcase . include? target . downcase }
246
+ end
247
+
248
+ # Search strings.xml's keys for target.
249
+ # @param target [String] the target to search for in strings.xml keys
250
+ # @return [Array]
251
+ def xml_values target
252
+ lazy_load_strings
253
+ @strings_xml . select { |key , value | value . downcase . include? target . downcase }
254
+ end
255
+
256
+ # Resolve id in strings.xml and return the value.
257
+ # @param id [String] the id to resolve
258
+ # @return [String]
259
+ def resolve_id id
260
+ lazy_load_strings
261
+ @strings_xml [ id ]
262
+ end
235
263
end # module Appium::Common
Original file line number Diff line number Diff line change @@ -83,10 +83,6 @@ def page_class
83
83
nil
84
84
end
85
85
86
- def lazy_load_strings
87
- @strings_xml ||= mobile ( :getStrings )
88
- end
89
-
90
86
# Returns a string of interesting elements. iOS only.
91
87
#
92
88
# Defaults to inspecting the 1st windows source only.
You can’t perform that action at this time.
0 commit comments