Package org.uiautomation.ios.utils

Examples of org.uiautomation.ios.utils.JSTemplate


  private static final JSTemplate voidTemplate = buildJSTemplate(
      "var parent = UIAutomation.cache.get(%:reference$s);" +
      "parent%:jsMethod$s;UIAutomation.createJSONResponse('%:sessionId$s',0,'')");

  private static JSTemplate buildJSTemplate(String template) {
    return new JSTemplate(template, "sessionId", "reference", "jsMethod");
  }
View Full Code Here


    setJS(computeJS());
  }

  private String computeJS() {
    Class<?> returnType = getRequest().getGenericCommand().returnType();
    JSTemplate template = findTemplate(returnType);
    return getFinalJS(template);
  }
View Full Code Here

      "element.scrollToVisible();" +
      "UIAutomation.createJSONResponse('%:sessionId$s',0,'')");

  private static JSTemplate buildJSTemplate(String template, String... extraArgs) {
    String[] args = {"sessionId", "reference"};
    return new JSTemplate(template, ObjectArrays.concat(args, extraArgs, String.class));
  }
View Full Code Here

    String reference = request.getVariableValue(":reference");
    String sessionId = request.getSession();
    final String js;
    JSONObject payload = request.getPayload();
    if (payload.has("direction")) {
      JSTemplate template;
      switch (payload.optString("direction")) {
        case "up": template = scrollUpTemplate; break;
        case "down": template = scrollDownTemplate; break;
        case "left": template = scrollLeftTemplate; break;
        case "right": template = scrollRightTemplate; break;
        default: throw new WebDriverException("Invalid value for scrolling direction");
      }
      js = template.generate(sessionId, reference);
    } else if (payload.has("name")) {
      String name = payload.optString("name");
      js = scrollToNameTemplate.generate(sessionId, reference, name);
    } else if (payload.has("predicateString")) {
      String predicateString = payload.optString("predicateString");
View Full Code Here

TOP

Related Classes of org.uiautomation.ios.utils.JSTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.