test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/Touch.java in calabash-android-0.2.3 vs test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/Touch.java in calabash-android-0.2.4
- old
+ new
@@ -14,28 +14,28 @@
public class Touch implements Action {
@Override
public Result execute(String... args) {
-
- try {
- String queryResult = QueryHelper.executeJavascriptInWebview("calabash.js", args[1], args[0]);
- List<HashMap<String,Object>> p = new ObjectMapper().readValue(queryResult, new TypeReference<List<HashMap<String,Object>>>(){});
-
- if (p.isEmpty()) {
- throw new RuntimeException("No element found");
- }
-
- Map<String, Object> firstRect = QueryHelper.findFirstVisibleRectangle(p);
-
- float[] screenCoordinates = QueryHelper.getScreenCoordinatesForCenter(firstRect);
-
- InstrumentationBackend.solo.clickOnScreen(screenCoordinates[0], screenCoordinates[1]);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- return new Result(true, "");
+ try {
+ String queryResult = QueryHelper.executeJavascriptInWebview("calabash.js", args[1], args[0]);
+ List<HashMap<String,Object>> p = new ObjectMapper().readValue(queryResult, new TypeReference<List<HashMap<String,Object>>>(){});
+
+ if (p.isEmpty()) {
+ throw new RuntimeException("No element found");
+ }
+
+ Map<String, Object> firstRect = QueryHelper.findFirstVisibleRectangle(p);
+
+ float[] screenCoordinates = QueryHelper.getScreenCoordinatesForCenter(firstRect);
+
+ InstrumentationBackend.solo.clickOnScreen(screenCoordinates[0], screenCoordinates[1]);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ return new Result(true, "");
}
@Override
public String key() {
return "touch";