We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cca5db4 commit 61e92f8Copy full SHA for 61e92f8
lib/appium_lib/android/helper.rb
@@ -275,9 +275,7 @@ def run node
275
out
276
end
277
278
- # Count all classes on screen and print to stdout.
279
- # Useful for appium_console.
280
- def page_class
+ def get_page_class
281
r = []
282
run_internal = lambda do |node|
283
if node.kind_of? Array
@@ -294,11 +292,18 @@ def page_class
294
292
json = get_source
295
293
run_internal.call json['hierarchy']
296
+ res = ''
297
r = r.sort
298
r.uniq.each do |ele|
299
- print r.count(ele)
300
- puts "x #{ele}\n"
+ res += "#{r.count(ele)}x #{ele}\n"
301
+ res
+ end
302
+
303
+ # Count all classes on screen and print to stdout.
304
+ # Useful for appium_console.
305
+ def page_class
306
+ puts get_page_class
307
nil
308
309
0 commit comments