calabash-android 0.4.7.pre3 → 0.4.7.pre4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 079fd75ffa1a41cf381a4f8cd72b1cadbee2e04d
4
- data.tar.gz: a183f3c9dc459adef3d13f067c868e2c6016dda5
3
+ metadata.gz: 38ea0a7d4c70d2f1e51351ce4cd390af26710880
4
+ data.tar.gz: 715c679a7e4cd6dc255ca1f5028c11b60f808151
5
5
  SHA512:
6
- metadata.gz: 2f7d86ad6876dc8c317385069746046d591d55730aabe3a919ef95e1287405c2c0bf34f81b9a77e18fadc0a60bd16fc3c21486a304302a2b8c5497142a0ee5c1
7
- data.tar.gz: f6e8a2bae10aa4af04f535d4cd7a140ca6c8f83fd55cf5dd4c6e12501f4fcfc1c454615c5c2ef5261008a410cf632519c20b4c3a77a4d3938a0362d2b5178f34
6
+ metadata.gz: 1ae14e2aec7bb5685c387a5a48ab73eadb0f86ac1d2c64b95bcba962bc5037720585b2cec0538958d0799be4cd6303422a4f72fb2f999c7955d2f8817ce0182a
7
+ data.tar.gz: 40b134d72e179604291e76e15274cc81966cb03c95b1f1d8a4f99a71c15d6a83668425baa147f060665717f31a913579d0dcefa435be6aa755925d33de913b68
@@ -1,5 +1,5 @@
1
1
  module Calabash
2
2
  module Android
3
- VERSION = "0.4.7.pre3"
3
+ VERSION = "0.4.7.pre4"
4
4
  end
5
5
  end
@@ -93,7 +93,14 @@ public class HttpServer extends NanoHTTPD {
93
93
  return new NanoHTTPD.Response(HTTP_OK, "application/json;charset=utf-8", JSONUtils.asJson(dumpTree));
94
94
  }
95
95
  Map<?,?> dumpTree = new ViewDump().dumpPathWithoutElements(path);
96
- return new NanoHTTPD.Response(HTTP_OK, "application/json;charset=utf-8", JSONUtils.asJson(dumpTree));
96
+ if (dumpTree == null) {
97
+ return new NanoHTTPD.Response(HTTP_NOTFOUND, "application/json;charset=utf-8", "{}");
98
+ }
99
+ else {
100
+ return new NanoHTTPD.Response(HTTP_OK, "application/json;charset=utf-8", JSONUtils.asJson(dumpTree));
101
+ }
102
+
103
+
97
104
  }
98
105
 
99
106
 
@@ -297,6 +297,7 @@ public class UIQueryUtils {
297
297
 
298
298
  @SuppressWarnings({ "unchecked", "rawtypes" })
299
299
  public static Map<?,?> mapWithElAsNull(Map<?,?> dump) {
300
+ if (dump == null) return null;
300
301
  HashMap result = new HashMap(dump);
301
302
  result.put("el",null);
302
303
  return result;
@@ -330,9 +331,15 @@ public class UIQueryUtils {
330
331
  List<View> currentChildren = dummyQuery.rootViews();
331
332
 
332
333
  for (Integer i:path) {
333
- View child = currentChildren.get(i);
334
- currentView = serializeViewToDump(child);
335
- currentChildren = UIQueryUtils.subviews(child);
334
+ if (i < currentChildren.size()) {
335
+ View child = currentChildren.get(i);
336
+ currentView = serializeViewToDump(child);
337
+ currentChildren = UIQueryUtils.subviews(child);
338
+ }
339
+ else {
340
+ return null;
341
+ }
342
+
336
343
  }
337
344
 
338
345
  return currentView;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calabash-android
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7.pre3
4
+ version: 0.4.7.pre4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Maturana Larsen